Ticket #4029: 4029.2.diff
File 4029.2.diff, 6.5 KB (added by , 5 years ago) |
---|
-
buddypress.org/public_html/wp-content/themes/bb-base/functions.php
233 233 } 234 234 235 235 // Forum has active data 236 if ( ! empty( $last_active ) ) {237 $topic_text 238 $time_since 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 ); 239 239 240 240 // Forum has no last active data 241 241 } else { 242 $topic_text 242 $topic_text = sprintf( _n( '%s topic', '%s topics', $topic_count, 'bborg' ), bbp_number_format( $topic_count ) ); 243 243 } 244 244 ?> 245 245 … … 303 303 */ 304 304 function bb_base_plugins_api( $action, $args = null ) { 305 305 306 if ( is_array( $args) ) {307 $args = (object) $args;306 if ( is_array( $args ) ) { 307 $args = (object) $args; 308 308 } 309 309 310 if ( ! isset( $args->per_page ) ) {310 if ( ! isset( $args->per_page ) ) { 311 311 $args->per_page = 19; 312 312 } 313 313 314 $args = apply_filters( 'plugins_api_args', $args, $action 315 $res = apply_filters( 'plugins_api', 314 $args = apply_filters( 'plugins_api_args', $args, $action ); 315 $res = apply_filters( 'plugins_api', false, $action, $args ); 316 316 317 317 // Cache individual plugin requests and query requests 318 318 … … 327 327 $res = new WP_Error( 'plugins_api_failed', __( 'An unknown error occurred' ), $request['body'] ); 328 328 } 329 329 } 330 } elseif ( ! is_wp_error( $res ) ) {330 } elseif ( ! is_wp_error( $res ) ) { 331 331 $res->external = true; 332 332 } 333 333 … … 426 426 427 427 // Look for topics 428 428 if ( bbp_has_topics( $r ) ) { 429 $output = bbp_buffer_template_part( 'loop', 'topics',false );429 $output = bbp_buffer_template_part( 'loop', 'topics', false ); 430 430 } else { 431 431 $output = bbp_buffer_template_part( 'feedback', 'no-topics', false ); 432 432 } -
wordpress.org/public_html/wp-content/themes/pub/wporg-learn/functions.php
12 12 add_action( 'widgets_init', 'learn_register_sidebars' ); 13 13 function learn_register_sidebars() { 14 14 register_sidebar( array( 15 'name' => 'Main Sidebar',16 'id' => 'sidebar-1',15 'name' => 'Main Sidebar', 16 'id' => 'sidebar-1', 17 17 '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>', 21 21 ) ); 22 22 } 23 23 -
wordpress.org/public_html/wp-content/themes/pub/wporg-showcase/functions.php
32 32 } 33 33 34 34 if ( '' != $width ) { 35 $screenshot = add_query_arg( 'w', $width, $screenshot );35 $screenshot = add_query_arg( 'w', $width, $screenshot ); 36 36 } 37 37 38 38 $screenshot = apply_filters( 'wporg_showcase_screenshot_src', $screenshot, $post, $width ); … … 48 48 } 49 49 50 50 // build the whole img tag properly for the screenshot, with srcset support 51 function site_screenshot_tag( $width = '', $classes ='screenshot' ) {51 function site_screenshot_tag( $width = '', $classes = 'screenshot' ) { 52 52 global $post; 53 53 54 54 $screenshot = site_screenshot_src( $width, false ); 55 $srcset = $screenshot;55 $srcset = $screenshot; 56 56 57 57 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 ); 60 60 } 61 61 62 62 // mshot images have a 4/3 ratio 63 $height = (int) ( $width * (3/4) );63 $height = (int) ( $width * ( 3 / 4 ) ); 64 64 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}' />"; 66 66 67 67 echo $img; 68 68 } -
wordpress.org/public_html/wp-content/themes/pub/wporg-themes/functions.php
77 77 'nonce' => is_user_logged_in() ? wp_create_nonce( 'modify-theme-favorite' ) : false, 78 78 ), 79 79 ), 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' ), 85 85 86 86 // Downloads Graph 87 'date' => __( 'Date', 'wporg-themes' ),88 'downloads' => __( 'Downloads', 'wporg-themes' ),87 'date' => __( 'Date', 'wporg-themes' ), 88 'downloads' => __( 'Downloads', 'wporg-themes' ), 89 89 90 90 // Tags 91 'tags' => wporg_themes_get_tag_translations(),91 'tags' => wporg_themes_get_tag_translations(), 92 92 93 93 // Active Installs 94 94 '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' ), 96 96 ), 97 97 ) ); 98 98 }