<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[BuddyPress][13530] trunk/src: Blogs: move site creation confirmation markup into BP Template Packs</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://buddypress.trac.wordpress.org/changeset/13530">13530</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://buddypress.trac.wordpress.org/changeset/13530","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>imath</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2023-07-27 11:30:13 +0000 (Thu, 27 Jul 2023)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>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 <a href="http://buddypress.trac.wordpress.org/ticket/8068">#8068</a>
Closes https://github.com/buddypress/buddypress/pull/142</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcbpblogsbpblogstemplatephp">trunk/src/bp-blogs/bp-blogs-template.php</a></li>
<li><a href="#trunksrcbptemplatesbplegacybuddypressblogscreatephp">trunk/src/bp-templates/bp-legacy/buddypress/blogs/create.php</a></li>
<li><a href="#trunksrcbptemplatesbplegacybuddypressblogsindexphp">trunk/src/bp-templates/bp-legacy/buddypress/blogs/index.php</a></li>
<li><a href="#trunksrcbptemplatesbpnouveauincludesblogstemplatetagsphp">trunk/src/bp-templates/bp-nouveau/includes/blogs/template-tags.php</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunksrcbptemplatesbplegacybuddypressblogsconfirmphp">trunk/src/bp-templates/bp-legacy/buddypress/blogs/confirm.php</a></li>
<li><a href="#trunksrcbptemplatesbpnouveaubuddypressblogsconfirmphp">trunk/src/bp-templates/bp-nouveau/buddypress/blogs/confirm.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcbpblogsbpblogstemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-blogs/bp-blogs-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-blogs/bp-blogs-template.php 2023-07-27 11:01:08 UTC (rev 13529)
+++ trunk/src/bp-blogs/bp-blogs-template.php 2023-07-27 11:30:13 UTC (rev 13530)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1327,26 +1327,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $login_url = set_url_scheme( wp_login_url() );
</span><span class="cx" style="display: block; padding: 0 10px"> restore_current_blog();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ?>
- <p class="success"><?php esc_html_e( 'Congratulations! You have successfully registered a new site.', 'buddypress' ) ?></p>
- <p>
- <?php printf(
- '%s %s',
- sprintf(
- /* translators: %s: the link of the new site */
- __( '%s is your new site.', 'buddypress' ),
- sprintf( '<a href="%s">%s</a>', esc_url( $blog_url ), esc_url( $blog_url ) )
- ),
- sprintf(
- /* translators: 1: Login URL, 2: User name */
- __( '<a href="%1$s">Log in</a> as "%2$s" using your existing password.', 'buddypress' ),
- esc_url( $login_url ),
- esc_html( $user_name )
- )
- ); ?>
- </p>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $args = array(
+ 'blog_url' => $blog_url,
+ 'login_url' => $login_url,
+ 'user_name' => $user_name,
+ );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ bp_get_template_part( 'blogs/confirm', null, $args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Fires after the default successful blog registration message markup.
</span></span></pre></div>
<a id="trunksrcbptemplatesbplegacybuddypressblogsconfirmphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/src/bp-templates/bp-legacy/buddypress/blogs/confirm.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-templates/bp-legacy/buddypress/blogs/confirm.php (rev 0)
+++ trunk/src/bp-templates/bp-legacy/buddypress/blogs/confirm.php 2023-07-27 11:30:13 UTC (rev 13530)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,64 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * BuddyPress - Blogs Confirm
+ *
+ * @since 12.0.0
+ * @version 12.0.0
+ */
+?>
+
+<div id="buddypress">
+
+ <div id="template-notices" role="alert" aria-atomic="true">
+ <?php
+
+ /** This action is documented in bp-templates/bp-legacy/buddypress/activity/index.php */
+ do_action( 'template_notices' ); ?>
+
+ </div>
+
+ <?php
+ /**
+ * Fires before the display of the blog creation confirmation message.
+ *
+ * @since 12.0.0
+ */
+ do_action( 'bp_before_blog_confirmed_content' ); ?>
+
+ <?php if ( bp_blog_signup_enabled() ) : ?>
+
+ <p class="success"><?php esc_html_e( 'Congratulations! You have successfully registered a new site.', 'buddypress' ) ?></p>
+ <p>
+ <?php printf(
+ '%s %s',
+ sprintf(
+ /* translators: %s: the link of the new site */
+ __( '%s is your new site.', 'buddypress' ),
+ sprintf( '<a href="%s">%s</a>', esc_url( $args['blog_url'] ), esc_url( $args['blog_url'] ) )
+ ),
+ sprintf(
+ /* translators: 1: Login URL, 2: User name */
+ __( '<a href="%1$s">Log in</a> as "%2$s" using your existing password.', 'buddypress' ),
+ esc_url( $args['login_url'] ),
+ esc_html( $args['user_name'] )
+ )
+ ); ?>
+ </p>
+
+ <?php else : ?>
+
+ <div id="message" class="info">
+ <p><?php esc_html_e( 'Site registration is currently disabled', 'buddypress' ); ?></p>
+ </div>
+
+ <?php endif; ?>
+
+ <?php
+ /**
+ * Fires before the display of the blog creation confirmation message.
+ *
+ * @since 12.0.0
+ */
+ do_action( 'bp_after_blog_confirmed_content' ); ?>
+
+</div>
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/src/bp-templates/bp-legacy/buddypress/blogs/confirm.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunksrcbptemplatesbplegacybuddypressblogscreatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-templates/bp-legacy/buddypress/blogs/create.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-templates/bp-legacy/buddypress/blogs/create.php 2023-07-27 11:01:08 UTC (rev 13529)
+++ trunk/src/bp-templates/bp-legacy/buddypress/blogs/create.php 2023-07-27 11:30:13 UTC (rev 13530)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4,7 +4,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @package BuddyPress
</span><span class="cx" style="display: block; padding: 0 10px"> * @subpackage bp-legacy
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @version 3.0.0
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @version 12.0.0
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -40,7 +40,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php else: ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <div id="message" class="info">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <p><?php _e( 'Site registration is currently disabled', 'buddypress' ); ?></p>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <p><?php esc_html_e( 'Site registration is currently disabled', 'buddypress' ); ?></p>
</ins><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php endif; ?>
</span></span></pre></div>
<a id="trunksrcbptemplatesbplegacybuddypressblogsindexphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-templates/bp-legacy/buddypress/blogs/index.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-templates/bp-legacy/buddypress/blogs/index.php 2023-07-27 11:01:08 UTC (rev 13529)
+++ trunk/src/bp-templates/bp-legacy/buddypress/blogs/index.php 2023-07-27 11:30:13 UTC (rev 13530)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -61,7 +61,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="item-list-tabs" aria-label="<?php esc_attr_e( 'Sites directory main navigation', 'buddypress' ); ?>" role="navigation">
</span><span class="cx" style="display: block; padding: 0 10px"> <ul>
</span><span class="cx" style="display: block; padding: 0 10px"> <li class="selected" id="blogs-all">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <a href="<?php bp_blogs_directory_permalink(); ?>">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <a href="<?php bp_blogs_directory_url(); ?>">
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: all blogs count */
</span><span class="cx" style="display: block; padding: 0 10px"> printf( __( 'All Sites %s', 'buddypress' ), '<span>' . bp_get_total_blog_count() . '</span>' ); ?>
</span></span></pre></div>
<a id="trunksrcbptemplatesbpnouveaubuddypressblogsconfirmphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/src/bp-templates/bp-nouveau/buddypress/blogs/confirm.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-templates/bp-nouveau/buddypress/blogs/confirm.php (rev 0)
+++ trunk/src/bp-templates/bp-nouveau/buddypress/blogs/confirm.php 2023-07-27 11:30:13 UTC (rev 13530)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,42 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * BuddyPress - Blogs Confirm
+ *
+ * @since 12.0.0
+ * @version 12.0.0
+ */
+
+bp_nouveau_template_notices(); ?>
+
+<?php bp_nouveau_blogs_confirm_hook( 'before', 'content' ); ?>
+
+<?php if ( bp_blog_signup_enabled() ) : ?>
+
+ <p class="success"><?php esc_html_e( 'Congratulations! You have successfully registered a new site.', 'buddypress' ) ?></p>
+ <p>
+ <?php printf(
+ '%s %s',
+ sprintf(
+ /* translators: %s: the link of the new site */
+ __( '%s is your new site.', 'buddypress' ),
+ sprintf( '<a href="%s">%s</a>', esc_url( $args['blog_url'] ), esc_url( $args['blog_url'] ) )
+ ),
+ sprintf(
+ /* translators: 1: Login URL, 2: User name */
+ __( '<a href="%1$s">Log in</a> as "%2$s" using your existing password.', 'buddypress' ),
+ esc_url( $args['login_url'] ),
+ esc_html( $args['user_name'] )
+ )
+ ); ?>
+ </p>
+
+<?php
+else :
+
+ bp_nouveau_user_feedback( 'blogs-no-signup' );
+
+endif;
+?>
+
+<?php
+bp_nouveau_blogs_confirm_hook( 'after', 'content' );
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/src/bp-templates/bp-nouveau/buddypress/blogs/confirm.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunksrcbptemplatesbpnouveauincludesblogstemplatetagsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-templates/bp-nouveau/includes/blogs/template-tags.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-templates/bp-nouveau/includes/blogs/template-tags.php 2023-07-27 11:01:08 UTC (rev 13529)
+++ trunk/src/bp-templates/bp-nouveau/includes/blogs/template-tags.php 2023-07-27 11:30:13 UTC (rev 13530)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -99,6 +99,31 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Fire specific hooks into the blogs confirm template
+ *
+ * @since 12.0.0
+ *
+ * @param string $when Optional. Either 'before' or 'after'.
+ * @param string $suffix Optional. Use it to add terms at the end of the hook name.
+ */
+function bp_nouveau_blogs_confirm_hook( $when = '', $suffix = '' ) {
+ $hook = array( 'bp' );
+
+ if ( $when ) {
+ $hook[] = $when;
+ }
+
+ // It's a create a blog hook
+ $hook[] = 'blog_confirmed';
+
+ if ( $suffix ) {
+ $hook[] = $suffix;
+ }
+
+ bp_nouveau_hook( $hook );
+}
+
+/**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Fire an isolated hook inside the blogs loop
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.0.0
</span></span></pre>
</div>
</div>
</body>
</html>