Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/26/2024 11:10:35 PM (2 years ago)
Author:
espellcaste
Message:

WPCS: Part I: miscellaneous fixes for some of the files of the blogs component.

See #9174
See #9173

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-blogs/classes/class-bp-blogs-component.php

    r13522 r14010  
    3535                        array(
    3636                                'adminbar_myaccount_order' => 30,
    37                                 'search_query_arg' => 'sites_search',
    38                                 'features' => array( 'site-icon' )
     37                                'search_query_arg'         => 'sites_search',
     38                                'features'                 => array( 'site-icon' ),
    3939                        )
    4040                );
     
    7474                // Fetch the default directory title.
    7575                $default_directory_titles = bp_core_get_directory_page_default_titles();
    76                 $default_directory_title  = $default_directory_titles[$this->id];
     76                $default_directory_title  = $default_directory_titles[ $this->id ];
    7777
    7878                // All globals for blogs component.
     
    8585                                'create_single_item'         => 'blog_create',
    8686                                'directory_action'           => 'blogs_action',
    87                                 'directory_action_variables' => 'blogs_action_variables'
     87                                'directory_action_variables' => 'blogs_action_variables',
    8888                        ),
    8989                        'directory_title'       => isset( $bp->pages->blogs->title ) ? $bp->pages->blogs->title : $default_directory_title,
     
    218218                 */
    219219                if ( ! is_multisite() ) {
    220                         return false;
     220                        return;
    221221                }
    222222
     
    229229                        'screen_function'     => 'bp_blogs_screen_my_blogs',
    230230                        'default_subnav_slug' => 'my-sites',
    231                         'item_css_id'         => $this->id
     231                        'item_css_id'         => $this->id,
    232232                );
    233233
     
    237237                        'parent_slug'     => $slug,
    238238                        'screen_function' => 'bp_blogs_screen_my_blogs',
    239                         'position'        => 10
     239                        'position'        => 10,
    240240                );
    241241
     
    334334                                        'title'    => __( 'Create a Site', 'buddypress' ),
    335335                                        'href'     => $url,
    336                                         'position' => 99
     336                                        'position' => 99,
    337337                                );
    338338                        }
     
    356356                                }
    357357
    358                         // If we are not viewing the logged in user, set up the current
    359                         // users avatar and name.
     358                                // If we are not viewing the logged in user, set up the current
     359                                // users avatar and name.
    360360                        } else {
    361                                 $bp->bp_options_avatar = bp_core_fetch_avatar( array(
    362                                         'item_id' => bp_displayed_user_id(),
    363                                         'type'    => 'thumb',
    364                                         'alt'     => sprintf(
     361                                $bp->bp_options_avatar = bp_core_fetch_avatar(
     362                                        array(
     363                                                'item_id' => bp_displayed_user_id(),
     364                                                'type'    => 'thumb',
     365                                                'alt'     => sprintf(
    365366                                                /* translators: %s: member name */
    366                                                 __( 'Profile picture of %s', 'buddypress' ),
    367                                                 bp_get_displayed_user_fullname()
    368                                         ),
    369                                 ) );
    370                                 $bp->bp_options_title = bp_get_displayed_user_fullname();
     367                                                        __( 'Profile picture of %s', 'buddypress' ),
     368                                                        bp_get_displayed_user_fullname()
     369                                                ),
     370                                        )
     371                                );
     372                                $bp->bp_options_title  = bp_get_displayed_user_fullname();
    371373                        }
    372374                }
     
    383385
    384386                // Global groups.
    385                 wp_cache_add_global_groups( array(
    386                         'bp_blog_meta'
    387                 ) );
     387                wp_cache_add_global_groups(
     388                        array(
     389                                'bp_blog_meta',
     390                        )
     391                );
    388392
    389393                parent::setup_cache_groups();
     
    430434                                'query' => 'index.php?' . $this->rewrite_ids['directory'] . '=1&' . $this->rewrite_ids['directory_action'] . '=$matches[1]',
    431435                        ),
    432                         'create_single_item' => array(
     436                        'create_single_item'         => array(
    433437                                'regex' => $this->root_slug . '/' . $create_slug . '/?$',
    434438                                'order' => 50,
     
    455459                 */
    456460                if ( ! is_multisite() || 'rewrites' !== bp_core_get_query_parser() ) {
    457                         return parent::parse_query( $query );
     461                        parent::parse_query( $query );
     462                        return;
    458463                }
    459464
     
    507512        public function rest_api_init( $controllers = array() ) {
    508513                if ( is_multisite() ) {
    509                         $controllers = array(
    510                                 'BP_REST_Blogs_Endpoint',
    511                         );
     514                        $controllers = array( 'BP_REST_Blogs_Endpoint' );
    512515
    513516                        // Support to Blog Avatar.
Note: See TracChangeset for help on using the changeset viewer.