diff --git src/bp-core/deprecated/1.6.php src/bp-core/deprecated/1.6.php
index c5550b6dd..9101f52a9 100644
|
|
|
if ( !function_exists( 'bp_dtheme_register_actions' ) ) :
|
| 265 | 265 | |
| 266 | 266 | // For each of the problematic hooks, exit at the very end of execution |
| 267 | 267 | foreach( $actions as $action ) { |
| 268 | | add_action( 'wp_ajax_' . $action, create_function( '', 'exit;' ), 9999 ); |
| 269 | | add_action( 'wp_ajax_nopriv_' . $action, create_function( '', 'exit;' ), 9999 ); |
| | 268 | add_action( 'wp_ajax_' . $action, function() { |
| | 269 | exit; |
| | 270 | }, 9999 ); |
| | 271 | |
| | 272 | add_action( 'wp_ajax_nopriv_' . $action, function() { |
| | 273 | exit; |
| | 274 | }, 9999 ); |
| 270 | 275 | } |
| 271 | 276 | } |
| 272 | 277 | add_action( 'after_setup_theme', 'bp_die_legacy_ajax_callbacks', 20 ); |
diff --git src/bp-groups/classes/class-bp-group-extension.php src/bp-groups/classes/class-bp-group-extension.php
index 3e9a2bb5f..598bd02a9 100644
|
|
|
class BP_Group_Extension {
|
| 753 | 753 | // When we are viewing the extension display page, set the title and options title. |
| 754 | 754 | if ( bp_is_current_action( $this->slug ) ) { |
| 755 | 755 | add_filter( 'bp_group_user_has_access', array( $this, 'group_access_protection' ), 10, 2 ); |
| 756 | | add_action( 'bp_template_content_header', create_function( '', 'echo "' . esc_attr( $this->name ) . '";' ) ); |
| 757 | | add_action( 'bp_template_title', create_function( '', 'echo "' . esc_attr( $this->name ) . '";' ) ); |
| | 756 | |
| | 757 | $extension_name = $this->name; |
| | 758 | add_action( 'bp_template_content_header', function() use ( $extension_name ) { |
| | 759 | echo esc_attr( $extension_name ); |
| | 760 | } ); |
| | 761 | add_action( 'bp_template_title', function() use ( $extension_name ) { |
| | 762 | echo esc_attr( $extension_name ); |
| | 763 | } ); |
| 758 | 764 | } |
| 759 | 765 | } |
| 760 | 766 | |
| … |
… |
class BP_Group_Extension {
|
| 1196 | 1202 | $group_id = isset( $_GET['gid'] ) ? (int) $_GET['gid'] : 0; |
| 1197 | 1203 | $screen = $this->screens['admin']; |
| 1198 | 1204 | |
| | 1205 | $extension_slug = $this->slug; |
| | 1206 | $callback = function() use ( $extension_slug ) { |
| | 1207 | do_action( 'bp_groups_admin_meta_box_content_' . $extension_slug, $group_id ); |
| | 1208 | }; |
| | 1209 | |
| 1199 | 1210 | add_meta_box( |
| 1200 | 1211 | $screen['slug'], |
| 1201 | 1212 | $screen['name'], |
| 1202 | | create_function( '', 'do_action( "bp_groups_admin_meta_box_content_' . $this->slug . '", ' . $group_id . ' );' ), |
| | 1213 | $callback, |
| 1203 | 1214 | get_current_screen()->id, |
| 1204 | 1215 | $screen['metabox_context'], |
| 1205 | 1216 | $screen['metabox_priority'] |
diff --git src/bp-members/bp-members-screens.php src/bp-members/bp-members-screens.php
index 34f7c4e01..ece83582b 100644
|
|
|
function bp_core_screen_signup() {
|
| 183 | 183 | // Add any errors to the action for the field in the template for display. |
| 184 | 184 | if ( !empty( $bp->signup->errors ) ) { |
| 185 | 185 | foreach ( (array) $bp->signup->errors as $fieldname => $error_message ) { |
| 186 | | /* |
| 187 | | * The addslashes() and stripslashes() used to avoid create_function() |
| 188 | | * syntax errors when the $error_message contains quotes. |
| 189 | | */ |
| 190 | | |
| 191 | 186 | /** |
| 192 | 187 | * Filters the error message in the loop. |
| 193 | 188 | * |
| … |
… |
function bp_core_screen_signup() {
|
| 195 | 190 | * |
| 196 | 191 | * @param string $value Error message wrapped in html. |
| 197 | 192 | */ |
| 198 | | add_action( 'bp_' . $fieldname . '_errors', create_function( '', 'echo apply_filters(\'bp_members_signup_error_message\', "<div class=\"error\">" . stripslashes( \'' . addslashes( $error_message ) . '\' ) . "</div>" );' ) ); |
| | 193 | add_action( 'bp_' . $fieldname . '_errors', function() use ( $error_message ) { |
| | 194 | echo apply_filters( 'bp_members_signup_error_message', "<div class=\"error\">" . $error_message . "</div>" ); |
| | 195 | } ); |
| 199 | 196 | } |
| 200 | 197 | } else { |
| 201 | 198 | $bp->signup->step = 'save-details'; |
diff --git src/bp-templates/bp-legacy/buddypress-functions.php src/bp-templates/bp-legacy/buddypress-functions.php
index ade8604a1..331f375e8 100644
|
|
|
function bp_legacy_theme_ajax_messages_send_reply() {
|
| 1611 | 1611 | bp_messages_embed(); |
| 1612 | 1612 | |
| 1613 | 1613 | // Add new-message css class. |
| 1614 | | add_filter( 'bp_get_the_thread_message_css_class', create_function( '$retval', ' |
| 1615 | | $retval[] = "new-message"; |
| | 1614 | add_filter( 'bp_get_the_thread_message_css_class', function( $retval ) { |
| | 1615 | $retval[] = 'new-message'; |
| 1616 | 1616 | return $retval; |
| 1617 | | ' ) ); |
| | 1617 | } ); |
| 1618 | 1618 | |
| 1619 | 1619 | // Output single message template part. |
| 1620 | 1620 | bp_get_template_part( 'members/single/messages/message' ); |
diff --git src/bp-templates/bp-legacy/buddypress/members/single/messages/message.php src/bp-templates/bp-legacy/buddypress/members/single/messages/message.php
index 70ab06d54..b0a5686e9 100644
|
|
|
|
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | 14 | ?> |
| 15 | | |
| 16 | 15 | <div class="message-box <?php bp_the_thread_message_css_class(); ?>"> |
| 17 | 16 | |
| 18 | 17 | <div class="message-metadata"> |
diff --git src/bp-templates/bp-nouveau/includes/messages/ajax.php src/bp-templates/bp-nouveau/includes/messages/ajax.php
index c14a0a21d..ef8b5e149 100644
|
|
|
function bp_nouveau_ajax_messages_send_message() {
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | // Trim @ from usernames |
| 63 | | $recipients = apply_filters( 'bp_messages_recipients', array_map( create_function( '$r', "return trim( \$r, '@' );" ), $_POST['send_to'] ) ); |
| | 63 | $recipients = apply_filters( 'bp_messages_recipients', array_map( function( $username ) { |
| | 64 | return trim( $r, '@' ); |
| | 65 | }, $_POST['send_to'] ) ); |
| 64 | 66 | |
| 65 | 67 | // Attempt to send the message. |
| 66 | 68 | $send = messages_new_message( array( |