Making WordPress.org

Ticket #4029: 4029.2.diff

File 4029.2.diff, 6.5 KB (added by faisal03, 5 years ago)
  • buddypress.org/public_html/wp-content/themes/bb-base/functions.php

     
    233233        }
    234234
    235235        // Forum has active data
    236         if ( !empty( $last_active ) ) {
    237                 $topic_text      = bbp_get_forum_topics_link( $forum_id );
    238                 $time_since      = bbp_get_forum_freshness_link( $forum_id );
     236        if ( ! empty( $last_active ) ) {
     237                $topic_text = bbp_get_forum_topics_link( $forum_id );
     238                $time_since = bbp_get_forum_freshness_link( $forum_id );
    239239
    240240        // Forum has no last active data
    241241        } else {
    242                 $topic_text      = sprintf( _n( '%s topic', '%s topics', $topic_count, 'bborg' ), bbp_number_format( $topic_count ) );
     242                $topic_text = sprintf( _n( '%s topic', '%s topics', $topic_count, 'bborg' ), bbp_number_format( $topic_count ) );
    243243        }
    244244        ?>
    245245
     
    303303 */
    304304function bb_base_plugins_api( $action, $args = null ) {
    305305
    306         if ( is_array($args) ) {
    307                 $args = (object)$args;
     306        if ( is_array( $args ) ) {
     307                $args = (object) $args;
    308308        }
    309309
    310         if ( !isset( $args->per_page ) ) {
     310        if ( ! isset( $args->per_page ) ) {
    311311                $args->per_page = 19;
    312312        }
    313313
    314         $args = apply_filters( 'plugins_api_args', $args, $action        );
    315         $res  = apply_filters( 'plugins_api',      false, $action, $args );
     314        $args = apply_filters( 'plugins_api_args', $args, $action );
     315        $res  = apply_filters( 'plugins_api', false, $action, $args );
    316316
    317317        // Cache individual plugin requests and query requests
    318318
     
    327327                                $res = new WP_Error( 'plugins_api_failed', __( 'An unknown error occurred' ), $request['body'] );
    328328                        }
    329329                }
    330         } elseif ( !is_wp_error( $res ) ) {
     330        } elseif ( ! is_wp_error( $res ) ) {
    331331                $res->external = true;
    332332        }
    333333
     
    426426
    427427                // Look for topics
    428428                if ( bbp_has_topics( $r ) ) {
    429                         $output = bbp_buffer_template_part( 'loop',     'topics',    false );
     429                        $output = bbp_buffer_template_part( 'loop', 'topics', false );
    430430                } else {
    431431                        $output = bbp_buffer_template_part( 'feedback', 'no-topics', false );
    432432                }
  • wordpress.org/public_html/wp-content/themes/pub/wporg-learn/functions.php

     
    1212add_action( 'widgets_init', 'learn_register_sidebars' );
    1313function learn_register_sidebars() {
    1414        register_sidebar( array(
    15                 'name' => 'Main Sidebar',
    16                 'id' => 'sidebar-1',
     15                'name'          => 'Main Sidebar',
     16                'id'            => 'sidebar-1',
    1717                'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    18                 'after_widget' => "</aside>",
    19                 'before_title' => '<h4 class="widget-title">',
    20                 'after_title' => '</h4>',
     18                'after_widget'  => "</aside>",
     19                'before_title'  => '<h4 class="widget-title">',
     20                'after_title'   => '</h4>',
    2121        ) );
    2222}
    2323
  • wordpress.org/public_html/wp-content/themes/pub/wporg-showcase/functions.php

     
    3232        }
    3333
    3434        if ( '' != $width ) {
    35                 $screenshot = add_query_arg( 'w', $width, $screenshot);
     35                $screenshot = add_query_arg( 'w', $width, $screenshot );
    3636        }
    3737
    3838        $screenshot = apply_filters( 'wporg_showcase_screenshot_src', $screenshot, $post, $width );
     
    4848}
    4949
    5050// build the whole img tag properly for the screenshot, with srcset support
    51 function site_screenshot_tag( $width = '', $classes='screenshot' ) {
     51function site_screenshot_tag( $width = '', $classes = 'screenshot' ) {
    5252        global $post;
    5353
    5454        $screenshot = site_screenshot_src( $width, false );
    55         $srcset = $screenshot;
     55        $srcset     = $screenshot;
    5656
    5757        if ( '' != $width ) {
    58                 $screenshot = add_query_arg( 'w', $width, $screenshot);
    59                 $srcset = add_query_arg( 'w', $width*2 , $screenshot);
     58                $screenshot = add_query_arg( 'w', $width, $screenshot );
     59                $srcset     = add_query_arg( 'w', $width * 2, $screenshot );
    6060        }
    6161
    6262        // mshot images have a 4/3 ratio
    63         $height = (int)( $width * (3/4) );
     63        $height = (int) ( $width * ( 3 / 4 ) );
    6464
    65         $img = "<img src='{$screenshot}' srcset='$srcset 2x' width='{$width}' height='{$height}' alt='". the_title_attribute(array('echo'=>false)) . "' class='{$classes}' />";
     65        $img = "<img src='{$screenshot}' srcset='$srcset 2x' width='{$width}' height='{$height}' alt='" . the_title_attribute( array( 'echo' => false ) ) . "' class='{$classes}' />";
    6666
    6767        echo $img;
    6868}
  • wordpress.org/public_html/wp-content/themes/pub/wporg-themes/functions.php

     
    7777                                        'nonce'  => is_user_logged_in() ? wp_create_nonce( 'modify-theme-favorite' ) : false,
    7878                                ),
    7979                        ),
    80                         'l10n' => array(
    81                                 'locale'            => str_replace( '_', '-', get_locale() ),
    82                                 'search'            => __( 'Search Themes', 'wporg-themes' ),
    83                                 'searchPlaceholder' => __( 'Search themes...', 'wporg-themes' ), // placeholder (no ellipsis)
    84                                 'error'             => __( 'An unexpected error occurred.', 'wporg-themes' ),
     80                        'l10n'     => array(
     81                                'locale'                       => str_replace( '_', '-', get_locale() ),
     82                                'search'                       => __( 'Search Themes', 'wporg-themes' ),
     83                                'searchPlaceholder'            => __( 'Search themes...', 'wporg-themes' ), // placeholder (no ellipsis)
     84                                'error'                        => __( 'An unexpected error occurred.', 'wporg-themes' ),
    8585
    8686                                // Downloads Graph
    87                                 'date'      => __( 'Date', 'wporg-themes' ),
    88                                 'downloads' => __( 'Downloads', 'wporg-themes' ),
     87                                'date'                         => __( 'Date', 'wporg-themes' ),
     88                                'downloads'                    => __( 'Downloads', 'wporg-themes' ),
    8989
    9090                                // Tags
    91                                 'tags' => wporg_themes_get_tag_translations(),
     91                                'tags'                         => wporg_themes_get_tag_translations(),
    9292
    9393                                // Active Installs
    9494                                'active_installs_less_than_10' => __( 'Less than 10', 'wporg-themes' ),
    95                                 'active_installs_1_million' => __( '1+ million', 'wporg-themes' ),
     95                                'active_installs_1_million'    => __( '1+ million', 'wporg-themes' ),
    9696                        ),
    9797                ) );
    9898        }