Changeset 12336 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/functions.php
- Timestamp:
- 12/15/2022 05:57:02 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/functions.php
r12324 r12336 88 88 wp_enqueue_script( 'wporg-plugins-popover', get_stylesheet_directory_uri() . '/js/popover.js', array( 'jquery' ), '20171002', true ); 89 89 wp_enqueue_script( 'wporg-plugins-faq', get_stylesheet_directory_uri() . '/js/section-faq.js', array( 'jquery' ), filemtime( __DIR__ . '/js/section-faq.js' ), true ); 90 91 $post = get_post(); 92 if ( $post && current_user_can( 'plugin_admin_edit', $post ) ) { 93 wp_enqueue_script( 'wporg-plugins-categorization', get_stylesheet_directory_uri() . '/js/section-categorization.js', array( 'jquery' ), filemtime( __DIR__ . '/js/section-categorization.js' ), true ); 94 wp_localize_script( 'wporg-plugins-categorization', 'categorizationOptions', [ 95 'restUrl' => get_rest_url(), 96 'restNonce' => wp_create_nonce( 'wp_rest' ), 97 'pluginSlug' => $post->post_name, 98 ] ); 99 } 90 100 } 91 101 … … 230 240 */ 231 241 function custom_body_class( $classes ) { 242 $post = get_post(); 243 232 244 $classes[] = 'no-js'; 245 246 if ( $post && is_singular( 'plugin' ) ) { 247 if ( has_term( 'commercial', 'plugin_business_model', $post ) ) { 248 $classes[] = 'is-commercial-plugin'; 249 } 250 251 if ( has_term( 'community', 'plugin_business_model', $post ) ) { 252 $classes[] = 'is-community-plugin'; 253 } 254 } 255 233 256 return $classes; 234 257 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)