Skip to:
Content

BuddyPress.org

Changeset 13530


Ignore:
Timestamp:
07/27/2023 11:30:13 AM (3 years ago)
Author:
imath
Message:

Blogs: move site creation confirmation markup into BP Template Packs

To make the site creation confirmation markup generated by the bp_blogs_confirm_blog_signup() function easily customizable, we've moved it inside a new template of our BP Template Packs:

  • src/bp-templates/bp-legacy/buddypress/blogs/confirm.php
  • src/bp-templates/bp-nouveau/buddypress/blogs/confirm.php

Props boonebgorges, dcavins

Fixes #8068
Closes https://github.com/buddypress/buddypress/pull/142

Location:
trunk/src
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-blogs/bp-blogs-template.php

    r13443 r13530  
    13281328        restore_current_blog();
    13291329
    1330         ?>
    1331         <p class="success"><?php esc_html_e( 'Congratulations! You have successfully registered a new site.', 'buddypress' ) ?></p>
    1332         <p>
    1333                 <?php printf(
    1334                         '%s %s',
    1335                         sprintf(
    1336                                 /* translators: %s: the link of the new site */
    1337                                 __( '%s is your new site.', 'buddypress' ),
    1338                                 sprintf( '<a href="%s">%s</a>', esc_url( $blog_url ), esc_url( $blog_url ) )
    1339                         ),
    1340                         sprintf(
    1341                                 /* translators: 1: Login URL, 2: User name */
    1342                                 __( '<a href="%1$s">Log in</a> as "%2$s" using your existing password.', 'buddypress' ),
    1343                                 esc_url( $login_url ),
    1344                                 esc_html( $user_name )
    1345                         )
    1346                 ); ?>
    1347         </p>
    1348 
    1349 <?php
     1330        $args = array(
     1331                'blog_url'  => $blog_url,
     1332                'login_url' => $login_url,
     1333                'user_name' => $user_name,
     1334        );
     1335
     1336        bp_get_template_part( 'blogs/confirm', null, $args );
    13501337
    13511338        /**
  • trunk/src/bp-templates/bp-legacy/buddypress/blogs/create.php

    r12734 r13530  
    55 * @package BuddyPress
    66 * @subpackage bp-legacy
    7  * @version 3.0.0
     7 * @version 12.0.0
    88 */
    99
     
    4141
    4242                <div id="message" class="info">
    43                         <p><?php _e( 'Site registration is currently disabled', 'buddypress' ); ?></p>
     43                        <p><?php esc_html_e( 'Site registration is currently disabled', 'buddypress' ); ?></p>
    4444                </div>
    4545
  • trunk/src/bp-templates/bp-legacy/buddypress/blogs/index.php

    r13442 r13530  
    6262                        <ul>
    6363                                <li class="selected" id="blogs-all">
    64                                         <a href="<?php bp_blogs_directory_permalink(); ?>">
     64                                        <a href="<?php bp_blogs_directory_url(); ?>">
    6565                                                <?php
    6666                                                /* translators: %s: all blogs count */
  • trunk/src/bp-templates/bp-nouveau/includes/blogs/template-tags.php

    r13504 r13530  
    9191        // It's a create a blog hook
    9292        $hook[] = 'create_blog';
     93
     94        if ( $suffix ) {
     95                $hook[] = $suffix;
     96        }
     97
     98        bp_nouveau_hook( $hook );
     99}
     100
     101/**
     102 * Fire specific hooks into the blogs confirm template
     103 *
     104 * @since 12.0.0
     105 *
     106 * @param string $when   Optional. Either 'before' or 'after'.
     107 * @param string $suffix Optional. Use it to add terms at the end of the hook name.
     108 */
     109function bp_nouveau_blogs_confirm_hook( $when = '', $suffix = '' ) {
     110        $hook = array( 'bp' );
     111
     112        if ( $when ) {
     113                $hook[] = $when;
     114        }
     115
     116        // It's a create a blog hook
     117        $hook[] = 'blog_confirmed';
    93118
    94119        if ( $suffix ) {
Note: See TracChangeset for help on using the changeset viewer.