Skip to:
Content

BuddyPress.org

Changeset 11901


Ignore:
Timestamp:
03/19/2018 04:43:51 PM (7 years ago)
Author:
djpaul
Message:

Templates, Nouveau: code pass.

Location:
trunk/src/bp-templates/bp-nouveau
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-nouveau/buddypress-functions.php

    r11900 r11901  
    464464     * @since 3.0.0
    465465     *
    466      * @param  array $templates Array of templates.
    467      * @uses   apply_filters() call 'bp_legacy_theme_compat_page_templates_directory_only' and return false
    468      *                         to use the defined page template for component's directory and its single items
     466     * @param array $templates Array of templates.
     467     *
    469468     * @return array
    470469     */
     
    477476         * @param bool $value Whether or not we are viewing a directory.
    478477         */
    479         if ( true === (bool) apply_filters( 'bp_legacy_theme_compat_page_templates_directory_only', ! bp_is_directory() ) ) {
     478        if ( true === (bool) apply_filters( 'bp_nouveau_theme_compat_page_templates_directory_only', ! bp_is_directory() ) ) {
    480479            return $templates;
    481480        }
  • trunk/src/bp-templates/bp-nouveau/buddypress/blogs/blogs-loop.php

    r11899 r11901  
    22/**
    33 * BuddyPress - Blogs Loop
    4  *
    5  * Querystring is set via AJAX in _inc/ajax.php - bp_legacy_theme_object_filter().
    64 *
    75 * @since 3.0.0
  • trunk/src/bp-templates/bp-nouveau/buddypress/groups/groups-loop.php

    r11899 r11901  
    22/**
    33 * BuddyPress - Groups Loop
    4  *
    5  * Querystring is set via AJAX in _inc/ajax.php - bp_legacy_theme_object_filter().
    64 *
    75 * @since 3.0.0
  • trunk/src/bp-templates/bp-nouveau/buddypress/members/members-loop.php

    r11899 r11901  
    22/**
    33 * BuddyPress - Members Loop
    4  *
    5  * Querystring is set via AJAX in _inc/ajax.php - bp_legacy_theme_object_filter()
    64 *
    75 * @since 3.0.0
  • trunk/src/bp-templates/bp-nouveau/includes/ajax.php

    r11899 r11901  
    1212 * Load the template loop for the current object.
    1313 *
    14  * @return string Prints template loop for the specified object
    1514 * @since 3.0.0
     15 *
     16 * @return string Template loop for the specified object
    1617 */
    1718function bp_nouveau_ajax_object_template_loader() {
     
    4142        $scope = '';
    4243        if ( ! empty( $_POST['scope'] ) ) {
    43             $scope = $_POST['scope'];
     44            $scope = sanitize_text_field( $_POST['scope'] );
    4445        }
    4546
     
    7172                break;
    7273            default:
    73                 $feed_url = home_url( bp_get_activity_root_slug() . '/feed/' );
     74                $feed_url = bp_get_sitewide_activity_feed_link();
    7475                break;
    7576        }
    7677
    77         $result['feed_url'] = apply_filters( 'bp_legacy_theme_activity_feed_url', $feed_url, $scope );
     78        $result['feed_url'] = apply_filters( 'bp_nouveau_ajax_object_template_loader', $feed_url, $scope );
    7879    }
    7980
     
    113114
    114115    $template_path = bp_locate_template( array( $template_part ), false );
    115     $template_path = apply_filters( 'bp_legacy_object_template_path', $template_path );
     116    $template_path = apply_filters( 'bp_nouveau_object_template_path', $template_path );
    116117
    117118    load_template( $template_path );
     
    129130 *
    130131 * @param array $ajax_actions {
    131  *      Multi-dimensional array. For example:
     132 *      Optional. Multi-dimensional array. For example:
    132133 *
    133134 *      $ajax_actions = array(
     
    140141 *     - 'nopriv' indicates whether the AJAX action is allowed for logged-out users.
    141142 * }
     143 *
    142144 * @return array
    143145 */
  • trunk/src/bp-templates/bp-nouveau/includes/groups/ajax.php

    r11899 r11901  
    376376
    377377    foreach ( (array) $_POST['users'] as $user_id ) {
    378         $invited[ $user_id ] = groups_invite_user(
     378        $invited[ (int) $user_id ] = groups_invite_user(
    379379            array(
    380380                'user_id'  => $user_id,
  • trunk/src/bp-templates/bp-nouveau/includes/messages/ajax.php

    r11899 r11901  
    5555    // Validate recipients
    5656    if ( empty( $_POST['send_to'] ) || ! is_array( $_POST['send_to'] ) ) {
    57         $response['feedback'] = __( 'Your message was not sent. Please enter at least one @username.', 'buddypress' );
     57        $response['feedback'] = __( 'Your message was not sent. Please enter at least one username.', 'buddypress' );
    5858
    5959        wp_send_json_error( $response );
     
    7070        'subject'    => $_POST['subject'],
    7171        'content'    => $_POST['message_content'],
    72         'error_type' => 'wp_error'
     72        'error_type' => 'wp_error',
    7373    ) );
    7474
Note: See TracChangeset for help on using the changeset viewer.