Changeset 12050
- Timestamp:
- 09/05/2022 05:14:31 AM (2 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer
- Files:
-
- 10 added
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/content-reference.php
r4902 r12050 24 24 ) ); 25 25 26 $content = '<div class="content-toc">' . $TOC->add_toc( $content ) . '</div>';26 $content = $TOC->add_toc( $content ); 27 27 28 28 endif; -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/functions.php
r11903 r12050 148 148 add_action( 'widgets_init', __NAMESPACE__ . '\\widgets_init' ); 149 149 150 /** 151 * Set up the theme. 152 */ 150 153 function init() { 151 154 … … 165 168 166 169 // Modify default breadcrumbs. 167 add_filter( 'breadcrumb_trail_items', __NAMESPACE__ . '\\breadcrumb_trail_items_for_hooks', 10, 2 ); 168 add_filter( 'breadcrumb_trail_items', __NAMESPACE__ . '\\breadcrumb_trail_items_for_handbook_root', 10, 2 ); 169 170 add_filter( 'syntaxhighlighter_htmlresult', __NAMESPACE__ . '\\syntaxhighlighter_htmlresult' ); 170 add_filter( 'breadcrumb_trail_items', __NAMESPACE__ . '\\breadcrumb_trail_items_for_hooks', 10, 2 ); 171 add_filter( 'breadcrumb_trail_items', __NAMESPACE__ . '\\breadcrumb_trail_items_for_handbook_root', 10, 2 ); 172 173 add_filter( 'mkaz_code_syntax_force_loading', '__return_true' ); 174 add_filter( 'mkaz_prism_css_path', __NAMESPACE__ . '\\update_prism_css_path' ); 171 175 } 172 176 … … 178 182 * be shown. 179 183 * 180 * @param array $items The breadcrumb trail items 181 * @param array $args Original args 184 * @param array $items The breadcrumb trail items. 185 * @param array $args Original args. 182 186 * @return array 183 187 */ … … 186 190 187 191 // Bail early when not the single archive for hook 188 if ( ! is_singular() || $post_type !== get_post_type()|| ! isset( $items[4] ) ) {192 if ( ! is_singular() || get_post_type() !== $post_type || ! isset( $items[4] ) ) { 189 193 return $items; 190 194 } … … 209 213 * item is already the unlinked handbook name, which is sufficient. 210 214 * 211 * @param array $items The breadcrumb trail items 212 * @param array $args Original args 215 * @param array $items The breadcrumb trail items. 216 * @param array $args Original args. 213 217 * @return array 214 218 */ … … 226 230 227 231 /** 228 * widgets_init function.232 * Register widget areas. 229 233 * 230 234 * @access public … … 232 236 */ 233 237 function widgets_init() { 234 register_sidebar( array( 235 'name' => __( 'Sidebar', 'wporg' ), 236 'id' => 'sidebar-1', 237 'before_widget' => '<aside id="%1$s" class="box gray widget %2$s">', 238 'after_widget' => '</div></aside>', 239 'before_title' => '<h1 class="widget-title">', 240 'after_title' => '</h1><div class="widget-content">', 241 ) ); 242 243 register_sidebar( array( 244 'name' => __( 'Landing Page Footer - Left', 'wporg' ), 245 'id' => 'landing-footer-1', 246 'description' => __( 'Appears in footer of the primary landing page', 'wporg' ), 247 'before_widget' => '<div id="%1$s" class="widget box %2$s">', 248 'after_widget' => '</div>', 249 'before_title' => '<h4 class="widget-title">', 250 'after_title' => '</h4>', 251 ) ); 252 253 register_sidebar( array( 254 'name' => __( 'Landing Page Footer - Center', 'wporg' ), 255 'id' => 'landing-footer-2', 256 'description' => __( 'Appears in footer of the primary landing page', 'wporg' ), 257 'before_widget' => '<div id="%1$s" class="widget box %2$s">', 258 'after_widget' => '</div>', 259 'before_title' => '<h4 class="widget-title">', 260 'after_title' => '</h4>', 261 ) ); 262 263 register_sidebar( array( 264 'name' => __( 'Landing Page Footer - Right', 'wporg' ), 265 'id' => 'landing-footer-3', 266 'description' => __( 'Appears in footer of the primary landing page', 'wporg' ), 267 'before_widget' => '<div id="%1$s" class="widget box %2$s">', 268 'after_widget' => '</div>', 269 'before_title' => '<h4 class="widget-title">', 270 'after_title' => '</h4>', 271 ) ); 272 } 273 274 /** 238 register_sidebar( 239 array( 240 'name' => __( 'Sidebar', 'wporg' ), 241 'id' => 'sidebar-1', 242 'before_widget' => '<aside id="%1$s" class="box gray widget %2$s">', 243 'after_widget' => '</div></aside>', 244 'before_title' => '<h1 class="widget-title">', 245 'after_title' => '</h1><div class="widget-content">', 246 ) 247 ); 248 249 register_sidebar( 250 array( 251 'name' => __( 'Landing Page Footer - Left', 'wporg' ), 252 'id' => 'landing-footer-1', 253 'description' => __( 'Appears in footer of the primary landing page', 'wporg' ), 254 'before_widget' => '<div id="%1$s" class="widget box %2$s">', 255 'after_widget' => '</div>', 256 'before_title' => '<h4 class="widget-title">', 257 'after_title' => '</h4>', 258 ) 259 ); 260 261 register_sidebar( 262 array( 263 'name' => __( 'Landing Page Footer - Center', 'wporg' ), 264 'id' => 'landing-footer-2', 265 'description' => __( 'Appears in footer of the primary landing page', 'wporg' ), 266 'before_widget' => '<div id="%1$s" class="widget box %2$s">', 267 'after_widget' => '</div>', 268 'before_title' => '<h4 class="widget-title">', 269 'after_title' => '</h4>', 270 ) 271 ); 272 273 register_sidebar( 274 array( 275 'name' => __( 'Landing Page Footer - Right', 'wporg' ), 276 'id' => 'landing-footer-3', 277 'description' => __( 'Appears in footer of the primary landing page', 'wporg' ), 278 'before_widget' => '<div id="%1$s" class="widget box %2$s">', 279 'after_widget' => '</div>', 280 'before_title' => '<h4 class="widget-title">', 281 'after_title' => '</h4>', 282 ) 283 ); 284 } 285 286 /** 287 * Modify the default query. 288 * 275 289 * @param \WP_Query $query 276 290 */ … … 289 303 } 290 304 305 /** 306 * Regiser navigation menu area. 307 */ 291 308 function register_nav_menus() { 292 293 \register_nav_menus( array( 294 'devhub-menu' => __( 'Developer Resources Menu', 'wporg' ), 295 'devhub-cli-menu' => __( 'WP-CLI Commands Menu', 'wporg' ), 296 'reference-home-api' => __( 'Reference API Menu', 'wporg' ), 297 ) ); 309 \register_nav_menus( 310 array( 311 'devhub-menu' => __( 'Developer Resources Menu', 'wporg' ), 312 'devhub-cli-menu' => __( 'WP-CLI Commands Menu', 'wporg' ), 313 'reference-home-api' => __( 'Reference API Menu', 'wporg' ), 314 ) 315 ); 298 316 } 299 317 … … 319 337 } 320 338 339 /** 340 * Filer the permalink for a taxonomy. 341 */ 321 342 function taxonomy_permalink( $link, $term, $taxonomy ) { 322 343 global $wp_rewrite; … … 326 347 } 327 348 328 if ( $taxonomy === 'wp-parser-source-file') {349 if ( 'wp-parser-source-file' === $taxonomy ) { 329 350 $slug = $term->slug; 330 351 if ( substr( $slug, -4 ) === '-php' ) { … … 333 354 } 334 355 $link = home_url( user_trailingslashit( "reference/files/$slug" ) ); 335 } elseif ( $taxonomy === 'wp-parser-since') {356 } elseif ( 'wp-parser-since' === $taxonomy ) { 336 357 $link = str_replace( $term->slug, str_replace( '-', '.', $term->slug ), $link ); 337 358 } 359 338 360 return $link; 339 361 } … … 354 376 } 355 377 378 /** 379 * Register and enqueue the theme assets. 380 */ 356 381 function theme_scripts_styles() { 357 382 wp_enqueue_style( 'dashicons' ); 383 // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion 358 384 wp_enqueue_style( 'open-sans', '//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,400,300,600' ); 359 wp_enqueue_style( 'wporg-developer-style', get_stylesheet_uri(), array(), '4');385 wp_enqueue_style( 'wporg-developer-style', get_stylesheet_uri(), array(), filemtime( __DIR__ . '/style.css' ) ); 360 386 wp_enqueue_style( 361 387 'wp-dev-sass-compiled', … … 364 390 filemtime( __DIR__ . '/stylesheets/main.css' ) 365 391 ); 366 wp_enqueue_script( 'wporg-developer-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20181209', true ); 367 wp_enqueue_script( 'wporg-developer-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true ); 368 wp_enqueue_script( 'wporg-developer-search', get_template_directory_uri() . '/js/search.js', array(), '20150430', true ); 369 wp_enqueue_script( 'wporg-developer-chapters', get_template_directory_uri() . '/js/chapters.js', array( 'jquery' ), '20190603' ); 370 wp_enqueue_script( 'wporg-developer-menu', get_template_directory_uri() . '/js/menu.js', array( 'jquery' ), '20180201', true ); 392 wp_enqueue_script( 'wporg-developer-navigation', get_stylesheet_directory_uri() . '/js/navigation.js', array(), filemtime( __DIR__ . '/js/navigation.js' ), true ); 393 wp_enqueue_script( 'wporg-developer-chapters', get_stylesheet_directory_uri() . '/js/chapters.js', array( 'jquery' ), filemtime( __DIR__ . '/js/chapters.js' ) ); 394 wp_enqueue_script( 'wporg-developer-menu', get_stylesheet_directory_uri() . '/js/menu.js', array( 'jquery' ), filemtime( __DIR__ . '/js/menu.js' ), true ); 371 395 } 372 396 … … 385 409 386 410 /** 387 * If a syntax highlighted code block exceeds a given number of lines, wrap the 388 * markup with other markup to trigger the code expansion/collapse JS handling 389 * already implemented for the code reference. 390 * 391 * @param string $text The pending result of the syntax highlighting. 411 * Customize the syntax highlighter style. 412 * See https://github.com/PrismJS/prism-themes. 413 * 414 * @param string $path Path to the file to override, relative to the theme. 392 415 * @return string 393 416 */ 394 function syntaxhighlighter_htmlresult( $text ) { 395 396 // is_admin() is true in front end AJAX requests. 397 if ( is_admin() && !( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) { 398 return $text; 399 } 400 401 $new_text = ''; 402 // Collapse is handled for >10 lines. But just go ahead and show the full 403 // code if that is just barely being exceeded (no one wants to expand to 404 // see one or two more lines). 405 $lines_to_show = 12; 406 $do_collapse = ( substr_count( $text, "\n" ) - 1 ) > $lines_to_show; 407 408 if ( $do_collapse ) { 409 $new_text .= '<section class="source-content">'; 410 $new_text .= '<div class="source-code-container">'; 411 } 412 413 $new_text .= $text; 414 415 if ( $do_collapse ) { 416 $new_text .= '</div>'; 417 $new_text .= '<p class="source-code-links"><span>'; 418 $new_text .= '<a href="#" class="show-complete-source">' . __( 'Expand full source code', 'wporg' ) . '</a>'; 419 $new_text .= '<a href="#" class="less-complete-source">' . __( 'Collapse full source code', 'wporg' ) . '</a>'; 420 $new_text .= '</span></p>'; 421 $new_text .= '</section>'; 422 } 423 424 return $new_text; 425 } 417 function update_prism_css_path( $path ) { 418 return '/stylesheets/prism.css'; 419 } -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/header.php
r11496 r12050 8 8 */ 9 9 10 \WordPressdotorg\skip_to( '#content' ); 11 10 12 echo do_blocks( '<!-- wp:wporg/global-header /-->' ); 13 14 $show_search = DevHub\should_show_search_bar(); 15 16 // When to show the masthead 17 $show_masthead = is_front_page() || is_page( 'reference' ); 11 18 12 19 ?> 13 20 14 <header id="masthead" class="site-header<?php if ( is_front_page()) { echo ' home'; } ?>" role="banner">21 <header id="masthead" class="site-header<?php if ( $show_masthead ) { echo ' home'; } ?>" role="banner"> 15 22 <?php if ( function_exists( 'wporg_is_handbook' ) && wporg_is_handbook() && ! is_search() ) : ?> 16 23 <a href="#" id="secondary-toggle" onclick="return false;"><strong><?php _e( 'Menu', 'wporg' ); ?></strong></a> 17 24 <?php endif; ?> 18 <div class="site-branding"> 25 <div class="site-branding<?php echo ! $show_masthead && $show_search ? ' has-actions': '' ?>"> 26 19 27 <h1 class="site-title"> 20 28 <a href="<?php echo esc_url( DevHub\get_site_section_url() ); ?>" rel="home"><?php echo DevHub\get_site_section_title(); ?></a> … … 25 33 <?php endif; ?> 26 34 27 <nav id="site-navigation" class="main-navigation" role="navigation"> 28 <button class="menu-toggle dashicons dashicons-arrow-down-alt2" aria-controls="primary-menu" aria-expanded="false" aria-label="<?php esc_attr_e( 'Primary Menu', 'wporg' ); ?>"></button> 29 <?php 30 $active_menu = is_post_type_archive( 'command' ) || is_singular( 'command' ) ? 'devhub-cli-menu' : 'devhub-menu'; 31 wp_nav_menu( array( 32 'theme_location' => $active_menu, 33 'container_class' => 'menu-container', 34 'container_id' => 'primary-menu', 35 ) ); ?> 36 </nav> 35 <div> 36 <?php if ( $show_search ) : ?> 37 <?php get_search_form(); ?> 38 <?php endif; ?> 39 40 <?php if ( ! $show_masthead ) : ?> 41 <nav id="site-navigation" class="main-navigation" role="navigation"> 42 <button class="menu-toggle dashicons dashicons-arrow-down-alt2" aria-controls="primary-menu" aria-expanded="false" aria-label="<?php esc_attr_e( 'Primary Menu', 'wporg' ); ?>"></button> 43 <?php 44 $active_menu = is_post_type_archive( 'command' ) || is_singular( 'command' ) ? 'devhub-cli-menu' : 'devhub-menu'; 45 wp_nav_menu( array( 46 'theme_location' => $active_menu, 47 'container_class' => 'menu-container', 48 'container_id' => 'primary-menu', 49 ) ); ?> 50 </nav> 51 <?php endif; ?> 52 </div> 37 53 </div> 38 54 </header><!-- #masthead --> 39 55 40 56 <div id="page" class="hfeed site devhub-wrap"> 41 <a href="#main" class="screen-reader-text"><?php _e( 'Skip to content', 'wporg' ); ?></a>42 43 57 <?php do_action( 'before' ); ?> 44 <?php45 if ( DevHub\should_show_search_bar() ) : ?>46 <div id="inner-search">47 <?php get_search_form(); ?>48 <div id="inner-search-icon-container">49 <div id="inner-search-icon">50 <div class="dashicons dashicons-search"><span class="screen-reader-text"><?php _e( 'Search', 'wporg' ); ?></span></div>51 </div>52 </div>53 </div>54 55 <?php endif; ?>56 58 <div id="content" class="site-content"> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/autocomplete.php
r6301 r12050 43 43 wp_enqueue_script( 'awesomplete' ); 44 44 45 wp_register_script( 'autocomplete', get_ template_directory_uri() . '/js/autocomplete.js', array( 'awesomplete' ), '20160524', true );45 wp_register_script( 'autocomplete', get_stylesheet_directory_uri() . '/js/autocomplete.js', array( 'awesomplete' ), filemtime( dirname( __DIR__ ) . '/js/autocomplete.js' ), true ); 46 46 wp_localize_script( 'autocomplete', 'autocomplete', array( 47 47 'ajaxurl' => admin_url( 'admin-ajax.php' ), … … 100 100 'search_orderby_title' => 1, 101 101 'order' => 'ASC', 102 '_autocomplete_search' => true, 102 103 ); 103 104 104 105 $search = get_posts( $args ); 105 106 106 if ( !empty( $search ) ) { 107 $titles = wp_list_pluck( $search, 'post_title' ); 108 $form_data['posts'] = array_values( array_unique( $titles ) ); 107 if ( ! empty( $search ) ) { 108 $post_types_function_like = array( 'wp-parser-function', 'wp-parser-method' ); 109 110 foreach ( $search as $post ) { 111 $permalink = get_permalink( $post->ID ); 112 $title = $post->post_title; 113 114 if ( in_array( $post->post_type, $post_types_function_like ) ) { 115 $title .= '()'; 116 } 117 118 if ( $post->post_type == 'wp-parser-class' ) { 119 $title = 'class ' . $title . ' {}'; 120 } 121 122 $form_data['posts'][ $title ] = $permalink; 123 } 109 124 } 110 125 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/cli-commands.php
r11949 r12050 102 102 } 103 103 104 // Determine importing user's ID. 104 // Determine importing user's ID. 105 105 $user = get_user_by( 'id', $user_id ); 106 106 if ( ! $user ) { … … 113 113 'posts-to-posts' => 'posts-to-posts/posts-to-posts.php', 114 114 ]; 115 116 // Get the phpdoc-parser plugin if not installed.117 $all_plugins = get_plugins();118 if ( ! in_array( $plugins['phpdoc-parser'], array_keys( $all_plugins ) ) ) {119 WP_CLI::log( "Installing phpdoc-parser plugin..." );120 WP_CLI::runcommand( 'plugin install https://github.com/WordPress/phpdoc-parser/archive/master.zip' );121 touch( WP_PLUGIN_DIR . '/phpdoc-parser/.devhub-parser-installed' );122 }123 124 // Verify the phpdoc-parser plugin is available locally.125 wp_cache_set( 'plugins', [], 'plugins' ); // Reset cache of plugins.126 $all_plugins = get_plugins();127 if ( ! in_array( $plugins['phpdoc-parser'], array_keys( $all_plugins ) ) ) {128 WP_CLI::error( 'The PHPDoc-Parser plugin (from https://github.com/WordPress/phpdoc-parser) could not be automatically installed locally in ' . WP_PLUGIN_DIR . '/. Please do so manually.' );129 }130 115 131 116 // Install phpdoc-parser plugin dependencies if not installed. … … 189 174 190 175 // 3. Run the parser. 176 // If running locally, run a quick parse which skips DB replication-lag sleep()'s 177 $quick = in_array( wp_get_environment_type(), array( 'local', 'development' ) ) ? '--quick' : ''; 191 178 WP_CLI::log( 'Running the parser (this will take awhile)...' ); 192 WP_CLI::runcommand( "parser create {$path} --user={$user_id} " );179 WP_CLI::runcommand( "parser create {$path} --user={$user_id} {$quick}" ); 193 180 194 181 // 4. Deactivate phpdoc-parser plugin. … … 279 266 } 280 267 281 // Remove the phpdoc-parser plugin.282 // @todo Add argument to facilitate disabling this step, or do a git checkout and only delete if no local changes.283 $plugin = 'phpdoc-parser';284 $all_plugins = get_plugins();285 if ( in_array( $plugin . '/plugin.php', array_keys( $all_plugins ) ) ) {286 // Only delete the plugin if it was automatically installed via parse command.287 if ( file_exists( WP_PLUGIN_DIR . '/phpdoc-parser/.devhub-parser-installed' ) ) {288 WP_CLI::log( "Deleting plugin {$plugin}..." );289 WP_CLI::runcommand( "plugin delete {$plugin}" );290 } else {291 WP_CLI::log( "Plugin {$plugin} present but was manually installed or looks to have customizations so it must be deleted manually, if so desired." );292 }293 } else {294 WP_CLI::log( "Plugin {$plugin} not present so it can't be deleted." );295 }296 297 268 WP_CLI::success( 'Clean-up is complete.' ); 298 269 } -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/formatting.php
r10493 r12050 40 40 add_filter( 'devhub-format-description', array( __CLASS__, 'fix_param_hash_formatting' ), 9 ); 41 41 add_filter( 'devhub-format-description', array( __CLASS__, 'fix_param_description_html_as_code' ) ); 42 add_filter( 'devhub-format-description', array( __CLASS__, 'fix_param_description_quotes_to_code' ) ); 42 43 add_filter( 'devhub-format-description', array( __CLASS__, 'convert_lists_to_markup' ) ); 43 44 44 45 add_filter( 'devhub-format-hash-param-description', array( __CLASS__, 'autolink_references' ) ); 45 46 add_filter( 'devhub-format-hash-param-description', array( __CLASS__, 'fix_param_description_parsedown_bug' ) ); 47 add_filter( 'devhub-format-hash-param-description', array( __CLASS__, 'fix_param_description_quotes_to_code' ) ); 48 add_filter( 'devhub-format-hash-param-description', array( __CLASS__, 'convert_lists_to_markup' ) ); 46 49 47 50 add_filter( 'devhub-function-return-type', array( __CLASS__, 'autolink_references' ) ); 48 51 49 add_filter( 'syntaxhighlighter_htmlresult', array( __CLASS__, 'fix_code_entity_encoding' ), 20 ); 50 } 51 52 /** 53 * Fixes bug in (or at least in using) SyntaxHighlighter code shortcodes that 54 * causes double-encoding of `>` character. 55 * 56 * @param string $content The text being handled as code. 57 * @return string 58 */ 59 public static function fix_code_entity_encoding( $content ) { 60 return str_replace( '&gt;', '>', $content ); 52 add_shortcode( 'php', array( __CLASS__, 'do_shortcode_php' ) ); 53 add_shortcode( 'js', array( __CLASS__, 'do_shortcode_js' ) ); 54 add_shortcode( 'css', array( __CLASS__, 'do_shortcode_css' ) ); 55 add_shortcode( 'code', array( __CLASS__, 'do_shortcode_code' ) ); 56 57 add_filter( 58 'no_texturize_shortcodes', 59 function ( $shortcodes ) { 60 $shortcodes[] = 'php'; 61 $shortcodes[] = 'js'; 62 $shortcodes[] = 'css'; 63 $shortcodes[] = 'code'; 64 return $shortcodes; 65 } 66 ); 61 67 } 62 68 … … 314 320 // Note: This precludes them from being able to be used in an encoded fashion 315 321 // within a parameter description. 316 $allowable_tags = array( 'code' );322 $allowable_tags = array( 'code', 'br' ); 317 323 foreach ( $allowable_tags as $tag ) { 318 324 $text = str_replace( array( "<{$tag}>", "</{$tag}>" ), array( "<{$tag}>", "</{$tag}>" ), $text ); … … 379 385 380 386 // Only if the text contains something that might be a function. 381 if ( false !== strpos( $content, '()' ) ) {387 if ( str_contains( $content, '()' ) || str_contains( $content, '::' ) || str_contains( $content, '->' ) ) { 382 388 383 389 // Detect references to class methods, e.g. WP_Query::query() … … 385 391 $content = preg_replace_callback( 386 392 '~ 387 (?!<.*?) # Non-capturing check to ensure not matching what looks like the inside of an HTML tag. 388 ( # 1: The full method or function name. 389 ((\w+)::)? # 2: The class prefix, if a method reference. 390 (\w+) # 3: The method or function name. 393 (?!<.*?) # Non-capturing check to ensure not matching what looks like the inside of an HTML tag. 394 (?P<name> 395 (?P<class> 396 (\w+) # Class Name 397 (::|->|->) # Object reference 398 (\w+) # Method 399 (?P<after>\(\)| ) # () or whitespace to terminate. 400 ) 401 | 402 (?P<function>\w+\(\)) # Functions must always end in (). 391 403 ) 392 \(\) # The () that signifies either a method or function. 393 (?![^<>]*?>) # Non-capturing check to ensure not matching what looks like the inside of an HTML tag. 404 (?![^<>]*?>) # Non-capturing check to ensure not matching what looks like the inside of an HTML tag. 394 405 ~x', 395 function ( $matches ) { 406 function( $matches ) { 407 $name = rtrim( $matches['name'], '() ' ); 408 $after = ( '()' === $matches['after'] ? '' : ' ' ); 409 396 410 // Reference to a class method. 397 if ( $matches[2] ) { 411 if ( $matches['class'] ) { 412 $name = str_replace( array( '->', '->' ), '::', $name ); 413 398 414 // Only link actually parsed methods. 399 if ( $post = get_page_by_title( $ matches[1], OBJECT, 'wp-parser-method' ) ) {415 if ( $post = get_page_by_title( $name, OBJECT, 'wp-parser-method' ) ) { 400 416 return sprintf( 401 '<a href="%s" >%s</a>',417 '<a href="%s" rel="method">%s</a>' . $after, 402 418 get_permalink( $post->ID ), 403 $ matches[0]419 $name . '()' 404 420 ); 405 421 } … … 408 424 } else { 409 425 // Only link actually parsed functions. 410 if ( $post = get_page_by_title( $ matches[1], OBJECT, 'wp-parser-function' ) ) {426 if ( $post = get_page_by_title( $name, OBJECT, 'wp-parser-function' ) ) { 411 427 return sprintf( 412 '<a href="%s" >%s</a>',428 '<a href="%s" rel="function">%s</a>' . $after, 413 429 get_permalink( $post->ID ), 414 $ matches[0]430 $name . '()' 415 431 ); 416 432 } … … 452 468 if ( $post = get_page_by_title( $matches[0], OBJECT, 'wp-parser-class' ) ) { 453 469 return sprintf( 454 '<a href="%s" >%s</a>',470 '<a href="%s" rel="class">%s</a>', 455 471 get_permalink( $post->ID ), 456 472 $matches[0] … … 484 500 * 485 501 * Recognizes lists where list items are denoted with an asterisk or dash. 502 * Examples: 503 * - https://developer.wordpress.org/reference/functions/add_menu_page/ 504 * - https://developer.wordpress.org/reference/classes/wp_term_query/__construct/ 505 * - https://developer.wordpress.org/reference/hooks/password_change_email/ 506 * - https://developer.wordpress.org/reference/classes/WP_Query/parse_query/ 486 507 * 487 508 * Does not handle nesting of lists. … … 491 512 */ 492 513 public static function convert_lists_to_markup( $text ) { 493 $inline_list = false; 494 $li = '<br /> * '; 495 496 // Convert asterisks to a list. 497 // Example: https://developer.wordpress.org/reference/functions/add_menu_page/ 498 if ( false !== strpos( $text, ' * ' ) ) { 499 // Display as simple plaintext list. 500 $text = str_replace( ' * ', "\n" . $li, $text ); 501 $inline_list = true; 502 } 503 504 // Convert dashes to a list. 505 // Example: https://developer.wordpress.org/reference/classes/wp_term_query/__construct/ 506 // Example: https://developer.wordpress.org/reference/hooks/password_change_email/ 507 if ( false !== strpos( $text, ' - ' ) ) { 508 // Display as simple plaintext list. 509 $text = str_replace( ' - ', "\n" . $li, $text ); 510 $inline_list = true; 511 } 512 513 // If list detected. 514 if ( $inline_list ) { 515 // Replace first item, ensuring the opening 'ul' tag is prepended. 516 $text = preg_replace( '~^' . preg_quote( $li ) . '(.+)$~mU', "<ul><li>\$1</li>\n", $text, 1 ); 517 // Wrap subsequent list items in 'li' tags. 518 $text = preg_replace( '~^' . preg_quote( $li ) . '(.+)$~mU', "<li>\$1</li>\n", $text ); 519 $text = trim( $text ); 520 521 // Close the list if it hasn't been closed before start of next hash parameter. 522 //$text = preg_replace( '~(</li>)(\s+</li>)~smU', '$1</ul>$2', $text ); 523 $text = preg_replace( '~(</li>)(\s*</li>)~smU', '$1</ul>$2', $text ); 524 525 // Closethe list if it hasn't been closed and it's the end of the description. 526 if ( '</li>' === substr( trim( $text ), -5 ) ) { 527 $text .= '</ul>'; 528 } 529 } 514 // Expand new lines for ease of matching. 515 $text = preg_replace( '!<br>\s*!', "<br>\n", $text ); 516 517 // Trim any trailing <br>s on strings. 518 $text = preg_replace( '/<br>\s*$/s', '', $text ); 519 520 // Add line items 521 $text = preg_replace( '!^\s*[*-] (.+?)(<br>)*$!m', '<li>$1</li>', $text, -1, $replacements_made ); 522 523 if ( ! $replacements_made ) { 524 return $text; 525 } 526 527 // Wrap in a `ul`. 528 $text = substr_replace( $text, '<ul><li>', strpos( $text, '<li>' ), 4 ); // First instance 529 $text = substr_replace( $text, '</li></ul>', strrpos( $text, '</li>' ), 5 ); // Last instance. 530 530 531 531 return $text; … … 598 598 } 599 599 if ( $name ) { 600 $new_text .= "< b>'{$name}'</b><br />";601 } 602 $new_text .= "< i><span class='type'>({$type})</span></i> {$description}";600 $new_text .= "<code>{$name}</code>"; 601 } 602 $new_text .= "<span class='type'>{$type}</span><div class='desc'>{$description}</div>"; 603 603 if ( ! $skip_closing_li ) { 604 604 $new_text .= '</li>'; … … 671 671 } 672 672 673 /** 674 * Wraps code-like references within 'code' tags. 675 * 676 * Example: https://developer.wordpress.org/reference/classes/wp_term_query/__construct/ 677 * 678 * @param string $text Text. 679 * @return string 680 */ 681 public static function fix_param_description_quotes_to_code( $text ) { 682 // Don't do anything if this is a hash notation string. 683 if ( ! $text || str_starts_with( $text, '{' ) || str_contains( $text, '<ul class="param-hash">' ) ) { 684 return $text; 685 } 686 687 $textarr = preg_split( '/(<[^<>]+>)/', $text, -1, PREG_SPLIT_DELIM_CAPTURE ); // split out HTML tags 688 $text = ''; 689 $within_code = false; 690 foreach ( $textarr as $piece ) { 691 // HTML tags are untouched. 692 if ( str_starts_with( $piece, '<' ) || $within_code ) { 693 $text .= $piece; 694 695 if ( str_starts_with( $piece, '</code' ) ) { 696 $within_code = false; 697 } elseif ( ! $within_code ) { 698 $within_code = str_starts_with( $piece, '<code' ); 699 } 700 701 continue; 702 } 703 704 // Pipe delimited types inline. 705 $piece = preg_replace( "/(([\w'\[\]]+\|)+[\w'\[\]]+)/", '<code>$1</code>', $piece, -1 ); 706 707 // Quoted strings. 708 $piece = preg_replace( "/('[^' ]*')/", '<code>$1</code>', $piece, -1 ); 709 710 // Replace ###PARAM### too. 711 // Example: http://localhost:8888/reference/hooks/password_change_email/ 712 $piece = preg_replace( "/((#{2,})\w+\\2)/", '<code>$1</code>', $piece ); 713 714 $text .= $piece; 715 } 716 717 return $text; 718 } 719 720 /** 721 * Render the php shortcode using the Code Syntax Block syntax. 722 * 723 * This is a workaround for user-submitted code, which used the php shortcode from Syntax Highlighter Evolved. 724 * 725 * @param array|string $attr Shortcode attributes array or empty string. 726 * @param string $content Shortcode content. 727 * @param string $tag Shortcode name. 728 * @return string 729 */ 730 public static function do_shortcode_php( $attr, $content, $tag ) { 731 $attr = is_array( $attr ) ? $attr : array(); 732 $attr['lang'] = 'php'; 733 734 return self::do_shortcode_code( $attr, $content, $tag ); 735 } 736 737 /** 738 * Render the js shortcode using the Code Syntax Block syntax. 739 * 740 * This is a workaround for user-submitted code, which used the js shortcode from Syntax Highlighter Evolved. 741 * 742 * @param array|string $attr Shortcode attributes array or empty string. 743 * @param string $content Shortcode content. 744 * @param string $tag Shortcode name. 745 * @return string 746 */ 747 public static function do_shortcode_js( $attr, $content, $tag ) { 748 $attr = is_array( $attr ) ? $attr : array(); 749 $attr['lang'] = 'js'; 750 751 return self::do_shortcode_code( $attr, $content, $tag ); 752 } 753 754 /** 755 * Render the css shortcode using the Code Syntax Block syntax. 756 * 757 * This is a new shortcode, but built to mirror the above two, `js` & `php`. 758 * 759 * @param array|string $attr Shortcode attributes array or empty string. 760 * @param string $content Shortcode content. 761 * @param string $tag Shortcode name. 762 * @return string 763 */ 764 public static function do_shortcode_css( $attr, $content, $tag ) { 765 $attr = is_array( $attr ) ? $attr : array(); 766 $attr['lang'] = 'css'; 767 768 return self::do_shortcode_code( $attr, $content, $tag ); 769 } 770 771 /** 772 * Render the code shortcode using the Code Syntax Block syntax. 773 * 774 * This is used in the handbooks content. 775 * 776 * @param array|string $attr Shortcode attributes array or empty string. 777 * @param string $content Shortcode content. 778 * @param string $tag Shortcode name. 779 * @return string 780 */ 781 public static function do_shortcode_code( $attr, $content, $tag ) { 782 // Use an allowedlist of languages, falling back to PHP. 783 // This should account for all languages used in the handbooks. 784 $lang_list = [ 'js', 'json', 'sh', 'bash', 'html', 'css', 'scss', 'php', 'markdown', 'yaml' ]; 785 $lang = in_array( $attr['lang'], $lang_list ) ? $attr['lang'] : 'php'; 786 787 $content = self::_trim_code( $content ); 788 // Hides numbers if <= 4 lines of code (last line has no linebreak). 789 $show_line_numbers = substr_count( $content, "\n" ) > 3; 790 791 // Shell is flagged with `sh` or `bash` in the handbooks, but Prism uses `shell`. 792 if ( 'sh' === $lang || 'bash' === $lang ) { 793 $lang = 'shell'; 794 } 795 796 return do_blocks( 797 sprintf( 798 '<!-- wp:code {"lineNumbers":$3$s} --><pre class="wp-block-code"><code lang="%1$s" class="language-%1$s %4$s">%2$s</code></pre><!-- /wp:code -->', 799 $lang, 800 $content, 801 $show_line_numbers ? 'true' : 'false', 802 $show_line_numbers ? 'line-numbers' : '' 803 ) 804 ); 805 } 806 807 /** 808 * Trim off any extra space, including initial new lines. 809 * Strip out <br /> and <p> added by WordPress. 810 * 811 * @param string $content Shortcode content. 812 * @return string 813 */ 814 public static function _trim_code( $content ) { 815 $content = preg_replace( '/<br \/>/', '', $content ); 816 $content = preg_replace( '/<\/p>\s*<p>/', "\n\n", $content ); 817 // Trim everything except leading spaces. 818 $content = trim( $content, "\n\r\t\v\x00" ); 819 return $content; 820 } 673 821 } // DevHub_Formatting 674 822 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/import-block-editor.php
r11422 r12050 21 21 add_filter( 'wporg_markdown_after_transform', array( $this, 'wporg_markdown_after_transform' ), 10, 2 ); 22 22 add_filter( 'wporg_markdown_edit_link', array( $this, 'wporg_markdown_edit_link' ), 10, 2 ); 23 24 add_filter( 'syntaxhighlighter_htmlresult', array( $this, 'fix_code_entity_encoding' ) );25 23 26 24 add_action( 'pre_post_update', function( $post_id, $data ) { … … 144 142 145 143 /** 146 * Fixes unwarranted HTML entity encoding within code shortcodes.147 *148 * @param string $content Post content.149 * @return string150 */151 public function fix_code_entity_encoding( $content ) {152 if ( $this->get_post_type() !== get_post_type() ) {153 return $content;154 }155 156 if ( false !== mb_strpos( $content, '&' ) ) {157 $content = preg_replace_callback(158 '|(<pre class="brush[^>]+)(.+)(</pre)|Us',159 function( $matches ) {160 return $matches[1] . html_entity_decode( $matches[2], ENT_QUOTES | ENT_HTML401 ) . $matches[3];161 },162 $content163 );164 }165 166 return $content;167 }168 169 /**170 144 * Fixes fetched value of markdown_source meta field to not be the 171 145 * raw.githubcontent.com domain that is currently incorrectly used … … 343 317 */ 344 318 public function wporg_markdown_edit_link( $link, $post_id ) { 345 if ( $this->get_post_type() === get_post_type( $post_id ) ) {319 if ( $this->get_post_type() === get_post_type( $post_id ) && defined( 'WP_CORE_STABLE_BRANCH' ) ) { 346 320 $link = str_replace( '/wp/' . WP_CORE_STABLE_BRANCH . '/', '/trunk/', $link ); 347 321 } -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/loop-pagination.php
r8233 r12050 55 55 'current' => $current, 56 56 'prev_next' => true, 57 //'prev_text' => __( '« Previous' ), // This is the WordPress default.58 //'next_text' => __( 'Next »' ), // This is the WordPress default.57 'prev_text' => __( 'Previous', 'wporg' ), 58 'next_text' => __( 'Next', 'wporg' ), 59 59 'show_all' => false, 60 'end_size' => 1,60 'end_size' => 2, 61 61 'mid_size' => 1, 62 62 'add_fragment' => '', … … 111 111 } 112 112 113 ?> 113 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/registrations.php
r8869 r12050 75 75 ) ); 76 76 77 // Methods77 // Rewrite rules. The more specific rules like `/embed` must be first, to override the more generic rules. 78 78 add_rewrite_rule( 'reference/classes/page/([0-9]{1,})/?$', 'index.php?post_type=wp-parser-class&paged=$matches[1]', 'top' ); 79 add_rewrite_rule( 'reference/classes/([^/]+)/embed/?$', 'index.php?post_type=wp-parser-class&name=$matches[1]&embed=true', 'top' ); 80 add_rewrite_rule( 'reference/classes/([^/]+)/([^/]+)/embed/?$', 'index.php?post_type=wp-parser-method&name=$matches[1]-$matches[2]&embed=true', 'top' ); 79 81 add_rewrite_rule( 'reference/classes/([^/]+)/([^/]+)/?$', 'index.php?post_type=wp-parser-method&name=$matches[1]-$matches[2]', 'top' ); 80 82 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/search.php
r9866 r12050 69 69 public static function pre_get_posts( $query ) { 70 70 // Don't modify anything if not a non-admin main search query. 71 if ( ! ( ! is_admin() && $query->is_main_query() && $query->is_search() ) ) { 71 if ( 72 ( 73 // Not the admin 74 is_admin() || 75 // Not non-main queries / non-searches 76 ( ! $query->is_main_query() || ! $query->is_search() ) 77 ) && 78 // but yes if it's the autocomplete search (which is admin, and not the main query). 79 ! $query->get( '_autocomplete_search' ) 80 ) { 72 81 return; 73 82 } … … 86 95 // If user has '()' at end of a search string, assume they want a specific function/method. 87 96 $s = htmlentities( $query->get( 's' ) ); 88 if ( '()' === substr( $s, -2 ) ) {97 if ( '()' === substr( $s, -2 ) || '(' == substr( $s, -1 ) ) { 89 98 // Enable exact search. 90 99 $query->set( 'exact', true ); 91 100 // Modify the search query to omit the parentheses. 92 $query->set( 's', substr( $s, 0, -2 ) ); // remove '()'101 $query->set( 's', trim( $s, '()' ) ); 93 102 // Restrict search to function-like content. 94 103 $query->set( 'post_type', array( 'wp-parser-function', 'wp-parser-method' ) ); -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php
r11311 r12050 114 114 // Check if the current page is a reply to a note. 115 115 $reply_id = 0; 116 if ( isset( $_GET['replytocom'] ) && $_GET['replytocom'] ) { 116 if ( isset( $_GET['replytocom'] ) && $_GET['replytocom'] ) { 117 117 /* Javascript uses preventDefault() when clicking links with '?replytocom={comment_ID}' 118 118 * We assume Javascript is disabled when visiting a page with this query var. … … 176 176 $can_user_post_note = DevHub\can_user_post_note( true, get_the_ID() ); 177 177 $is_user_verified = $is_user_logged_in && $can_user_post_note; 178 178 179 179 $args['updated_note'] = 0; 180 180 if ( isset( $_GET['updated-note'] ) && $_GET['updated-note'] ) { … … 621 621 */ 622 622 function get_site_section_url() { 623 $parts = explode( '/', $GLOBALS['wp']->request ); 624 switch ( $parts[0] ) { 625 case 'reference': 626 case 'plugins': 627 case 'themes': 628 return home_url( '/' . $parts[0] . '/' ); 629 case 'cli': 630 return home_url( '/cli/commands/' ); 631 default: 632 return home_url( '/' ); 633 } 623 return home_url( '/' ); 634 624 } 635 625 … … 645 635 case 'resource': 646 636 return sprintf( __( 'Developer Resources: %s', 'wporg' ), get_the_title() ); 647 case 'reference':648 return __( 'Code Reference', 'wporg' );649 case 'plugins':650 return __( 'Plugin Handbook', 'wporg' );651 case 'themes':652 return __( 'Theme Handbook', 'wporg' );653 case 'apis':654 return __( 'Common APIs Handbook', 'wporg' );655 case 'block-editor':656 return __( 'Block Editor Handbook', 'wporg' );657 case 'cli':658 return __( 'WP-CLI Commands', 'wporg' );659 case 'coding-standards':660 return __( 'Coding Standards Handbook', 'wporg' );661 case 'rest-api':662 return __( 'REST API Handbook', 'wporg' );663 637 default: 638 if( is_page( 'reference' ) ) { 639 return __( 'Code Reference', 'wporg' ); 640 } 641 664 642 return __( 'Developer Resources', 'wporg' ); 665 643 } … … 685 663 } 686 664 return $name; 665 } 666 667 /** 668 * Returns the hook string. 669 * 670 * @param int $post_id 671 * 672 * @return string 673 */ 674 function get_hook_type_name( $post_id ) { 675 $hook_type = get_post_meta( $post_id, '_wp-parser_hook_type', true ); 676 if ( false !== strpos( $hook_type, 'action' ) ) { 677 if ( 'action_reference' === $hook_type ) { 678 $hook_type = 'do_action_ref_array'; 679 } elseif ( 'action_deprecated' === $hook_type ) { 680 $hook_type = 'do_action_deprecated'; 681 } else { 682 $hook_type = 'do_action'; 683 } 684 } else { 685 if ( 'filter_reference' === $hook_type ) { 686 $hook_type = 'apply_filters_ref_array'; 687 } elseif ( 'filter_deprecated' === $hook_type ) { 688 $hook_type = 'apply_filters_deprecated'; 689 } else { 690 $hook_type = 'apply_filters'; 691 } 692 } 693 694 return $hook_type; 687 695 } 688 696 … … 708 716 709 717 if ( 'wp-parser-class' === get_post_type( $post_id ) ) { 710 return $signature;718 return '<span class="keyword">class</span> ' . $signature . ' {}'; 711 719 } 712 720 … … 726 734 } 727 735 728 $hook_type = get_post_meta( $post_id, '_wp-parser_hook_type', true ); 729 if ( false !== strpos( $hook_type, 'action' ) ) { 730 if ( 'action_reference' === $hook_type ) { 731 $hook_type = 'do_action_ref_array'; 732 } elseif ( 'action_deprecated' === $hook_type ) { 733 $hook_type = 'do_action_deprecated'; 734 } else { 735 $hook_type = 'do_action'; 736 } 737 } else { 738 if ( 'filter_reference' === $hook_type ) { 739 $hook_type = 'apply_filters_ref_array'; 740 } elseif ( 'filter_deprecated' === $hook_type ) { 741 $hook_type = 'apply_filters_deprecated'; 742 } else { 743 $hook_type = 'apply_filters'; 744 } 745 } 736 $hook_type = get_hook_type_name( $post_id ); 746 737 747 738 $delimiter = false !== strpos( $signature, '$' ) ? '"' : "'"; … … 783 774 $signature .= ')'; 784 775 776 $return = get_return( $post_id, false ); 777 if ( $return ) { 778 $signature .= ': ' . $return; 779 } 780 785 781 return wp_kses_post( $signature ); 786 782 } … … 805 801 $encountered_optional = false; 806 802 foreach ( $tags as $tag ) { 807 // Fix unintended markup introduced by parser.808 $tag = str_replace( array( '<strong>', '</strong>' ), '__', $tag );809 810 803 if ( ! empty( $tag['name'] ) && 'param' == $tag['name'] ) { 811 804 $params[ $tag['variable'] ] = $tag; … … 872 865 } 873 866 } 874 875 867 } 876 868 } … … 878 870 return $params; 879 871 } 872 873 /** 874 * Recurse through parameters that referer to arguments in other functions or methods, and find the innermost parameter description. 875 * For example the description for the wp_count_terms( $args ) parameter refers to get_terms( $args ) which in turn refers to WP_Term_Query::__construct( $query ). 876 * Given the wp_count_terms( $args ) parameter, this will find and return the one for WP_Term_Query::__construct( $query ). 877 * 878 * @param array $param A single parameter array as found in `_wp-parser_args` postmeta. 879 * @param int $recursion_limit Maximum number of levels to recurse through. 880 * 881 * @return array|null 882 */ 883 884 function get_param_reference( $param, $recursion_limit = 3 ) { 885 if ( $recursion_limit > 0 && preg_match_all( '#rel="(function|method)">([^<>()]+)[(][)]</a>#', $param[ 'content' ], $matches, PREG_SET_ORDER ) ) { 886 foreach ( $matches as $match ) { 887 if ( $_post = get_page_by_title( $match[2], OBJECT, 'wp-parser-' . $match[1] ) ) { 888 if ( $_params = get_params( $_post->ID ) ) { 889 890 $arg_names_to_try = array_unique([ 891 $param['variable'], // An exact match for the name eg $args 892 '$args', 893 '$query', // For example get_terms( $args ) -> WP_Term_Query::__construct( $query ) 894 ]); 895 896 foreach ( $arg_names_to_try as $variable_name ) { 897 if ( isset( $_params[ $variable_name ] ) ) { 898 // Sometimes the referenced doc page has another level of indirection! 899 $recurse = get_param_reference( $_params[ $variable_name ], $recursion_limit - 1 ); 900 if ( $recurse ) { 901 $recurse[ 'parent' ] = $_post->post_title; 902 $recurse[ 'parent_var' ] = $variable_name; 903 return $recurse; 904 } else { 905 $result = $_params[ $variable_name ]; 906 $result[ 'parent' ] = $_post->post_title; 907 $result[ 'parent_var' ] = $variable_name; 908 return $result; 909 } 910 } 911 } 912 } 913 } 914 } 915 } 916 917 return null; 918 } 919 880 920 881 921 /** … … 916 956 * @return string 917 957 */ 918 function get_return( $post_id = null ) {958 function get_return( $post_id = null, $include_description = true ) { 919 959 920 960 if ( empty( $post_id ) ) { … … 935 975 $type = apply_filters( 'devhub-function-return-type', $type, $post_id ); 936 976 937 return "<span class='return-type'>({$type})</span> $description"; 977 if ( $include_description ) { 978 return "<span class='return-type'>{$type}</span> $description"; 979 } else { 980 return "<span class='return-type'>{$type}</span>"; 981 } 938 982 } 939 983 … … 1246 1290 */ 1247 1291 function post_type_has_uses_info( $post_type = null ) { 1292 $post_type = $post_type ? $post_type : get_post_type(); 1293 $post_types_with_uses = array( 'wp-parser-function', 'wp-parser-method', 'wp-parser-class' ); 1294 1295 return in_array( $post_type, $post_types_with_uses ); 1296 } 1297 1298 /** 1299 * Does the post type support hooks information? 1300 * 1301 * @param string $post_type Optional. The post type name. If blank, assumes current post type. 1302 * 1303 * @return boolean 1304 */ 1305 function post_type_has_hooks_info( $post_type = null ) { 1248 1306 $post_type = $post_type ? $post_type : get_post_type(); 1249 $post_types_with_ uses = array( 'wp-parser-function', 'wp-parser-method', 'wp-parser-class' );1250 1251 return in_array( $post_type, $post_types_with_ uses );1307 $post_types_with_hooks = array( 'wp-parser-function', 'wp-parser-method' ); 1308 1309 return in_array( $post_type, $post_types_with_hooks ); 1252 1310 } 1253 1311 … … 1273 1331 return $connected; 1274 1332 } elseif ( 'wp-parser-function' === $post_type ) { 1275 $connection_types = array( 'functions_to_functions', 'functions_to_methods' , 'functions_to_hooks');1333 $connection_types = array( 'functions_to_functions', 'functions_to_methods' ); 1276 1334 } else { 1277 $connection_types = array( 'methods_to_functions', 'methods_to_methods' , 'methods_to_hooks');1335 $connection_types = array( 'methods_to_functions', 'methods_to_methods' ); 1278 1336 } 1279 1337 1280 1338 $connected = new \WP_Query( array( 1281 'post_type' => array( 'wp-parser-function', 'wp-parser-method' , 'wp-parser-hook'),1339 'post_type' => array( 'wp-parser-function', 'wp-parser-method' ), 1282 1340 'connected_type' => $connection_types, 1283 'connected_direction' => array( 'from', 'from', 'from' ), 1341 'connected_direction' => array( 'from', 'from' ), 1342 'connected_items' => $post_id, 1343 'nopaging' => true, 1344 ) ); 1345 1346 return $connected; 1347 } 1348 1349 /** 1350 * Retrieves a WP_Query object for the hook posts that the current post is linked to. 1351 * 1352 * @param int|WP_Post|null $post Optional. Post ID or post object. Default is global $post. 1353 * @return WP_Query|null The WP_Query if the post's post type supports 'uses', null otherwise. 1354 */ 1355 function get_hooks( $post = null ) { 1356 $post_id = get_post_field( 'ID', $post ); 1357 $post_type = get_post_type( $post ); 1358 1359 if ( 'wp-parser-function' === $post_type ) { 1360 $connection_types = array( 'functions_to_hooks' ); 1361 } else { 1362 $connection_types = array( 'methods_to_hooks' ); 1363 } 1364 1365 $connected = new \WP_Query( array( 1366 'post_type' => 'wp-parser-hook', 1367 'connected_type' => $connection_types, 1368 'connected_direction' => array( 'from' ), 1284 1369 'connected_items' => $post_id, 1285 1370 'nopaging' => true, … … 1337 1422 1338 1423 /** 1424 * Find functions & methods that are often used by other functions and methods. 1425 */ 1426 function _get_functions_to_exclude_from_uses() { 1427 global $wpdb; 1428 1429 $ids = get_transient( __METHOD__ ); 1430 if ( $ids ) { 1431 return $ids; 1432 } 1433 1434 $ids = $wpdb->get_col( 1435 "SELECT p2p_to 1436 FROM {$wpdb->p2p} p2p 1437 WHERE p2p_type IN ( 'methods_to_functions', 'functions_to_functions', 'methods_to_methods', 'functions_to_methods' ) 1438 GROUP BY p2p_to 1439 HAVING COUNT(*) > 50" 1440 ); 1441 1442 set_transient( __METHOD__, $ids, DAY_IN_SECONDS ); 1443 1444 return $ids; 1445 } 1446 1447 /** 1448 * Rearrange the results of get_uses() so that frequent functions are pushed to the bottom. 1449 * Sorts the array in-place. 1450 * 1451 * @return int The number of infrequent items in the list (ie the cutoff point for show/hide). 1452 */ 1453 function split_uses_by_frequent_funcs( &$posts ) { 1454 1455 $frequent_funcs = _get_functions_to_exclude_from_uses(); 1456 1457 // Sort the posts array so frequently used functions are at the end 1458 usort( $posts, function( $a, $b ) use ( $frequent_funcs ) { 1459 return (int) in_array( $a->ID, $frequent_funcs ) - (int) in_array( $b->ID, $frequent_funcs ); 1460 } ); 1461 1462 $infrequent_count = 0; 1463 foreach ( $posts as $i => $post ) { 1464 if ( in_array( $post->ID, $frequent_funcs ) ) { 1465 break; 1466 } 1467 $infrequent_count = $i + 1; 1468 } 1469 1470 return $infrequent_count; 1471 } 1472 1473 /** 1339 1474 * Returns the array of post types that have source code. 1340 1475 * … … 1342 1477 */ 1343 1478 function get_post_types_with_source_code() { 1344 return array( 'wp-parser-class', 'wp-parser-method', 'wp-parser-function' );1479 return array( 'wp-parser-class', 'wp-parser-method', 'wp-parser-function', 'wp-parser-hook' ); 1345 1480 } 1346 1481 … … 1428 1563 } 1429 1564 fclose( $handle ); 1565 } 1566 1567 // Trim leading whitespace. 1568 if ( preg_match_all( "!^([\t ]*).+$!m", $source_code, $m ) ) { 1569 $strip_prefix = min( array_map( 'strlen', $m[1] ) ); 1570 if ( $strip_prefix ) { 1571 $source_code = preg_replace( "!^[\t ]{" . $strip_prefix . "}!m", '$1', $source_code ); 1572 } 1430 1573 } 1431 1574 … … 1594 1737 $description = $post->post_content; 1595 1738 1739 // Replace code blocks generated by Markdown with wp:code blocks. 1740 $description = str_replace( '<pre><code>', '[code lang="php"]', $description ); 1741 $description = str_replace( '</code></pre>', '[/code]', $description ); 1742 1596 1743 if ( $description ) { 1597 1744 $description = apply_filters( 'the_content', apply_filters( 'get_the_content' , $description ) ); … … 1624 1771 $taxonomies = array( 'wp-parser-since', 'wp-parser-package', 'wp-parser-source-file' ); 1625 1772 1626 return ! ( is_search() || is_404() ) && ( is_singular( $post_types ) || is_post_type_archive( $post_types ) || is_tax( $taxonomies ) ); 1773 return ! ( is_search() || is_404() ) && ( is_singular( $post_types ) || is_post_type_archive( $post_types ) || is_tax( $taxonomies ) || is_page( 'reference' ) ); 1774 } 1775 1776 /** 1777 * Should the search bar filters be shown? 1778 * 1779 * @return bool True if search bar filters should be shown. 1780 */ 1781 function should_show_search_filters() { 1782 $is_handbook = $GLOBALS['wp_query']->is_handbook; 1783 return ( is_page( 'reference' ) || is_search() ) && ! $is_handbook; 1627 1784 } 1628 1785 … … 1859 2016 'return', 1860 2017 'explanation', 2018 'methods', 1861 2019 'source', 2020 'hooks', 1862 2021 'related', 1863 'methods',1864 2022 'changelog', 1865 2023 'notes' -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/user-content.php
r11765 r12050 55 55 // Customize allowed tags 56 56 add_filter( 'wp_kses_allowed_html', array( __CLASS__, 'wp_kses_allowed_html' ), 10, 2 ); 57 58 // Make 'php' the default language59 add_filter( 'syntaxhighlighter_shortcodeatts', array( __CLASS__, 'syntaxhighlighter_shortcodeatts' ) );60 61 // Tweak code contained in shortcode62 add_filter( 'syntaxhighlighter_precode', array( __CLASS__, 'syntaxhighlighter_precode' ) );63 57 64 58 // Allowed HTML for a new child comment … … 170 164 public static function scripts_and_styles() { 171 165 if ( is_singular() ) { 172 wp_enqueue_script( 'wporg-developer-function-reference', get_template_directory_uri() . '/js/function-reference.js', array( 'jquery', 'syntaxhighlighter-core', 'syntaxhighlighter-brush-php' ), '20180724', true ); 173 wp_enqueue_style( 'syntaxhighlighter-core' ); 174 wp_enqueue_style( 'syntaxhighlighter-theme-default' ); 175 176 wp_enqueue_script( 'wporg-developer-user-notes', get_template_directory_uri() . '/js/user-notes.js', array( 'jquery', 'quicktags' ), '20200110', true ); 177 wp_enqueue_script( 'wporg-developer-user-notes-feedback', get_template_directory_uri() . '/js/user-notes-feedback.js', array( 'jquery', 'quicktags' ), '20181023', true ); 178 wp_localize_script( 'wporg-developer-user-notes-feedback', 'wporg_note_feedback', array( 179 'show' => __( 'Show Feedback', 'wporg' ), 180 'hide' => __( 'Hide Feedback', 'wporg' ), 181 ) ); 182 } 183 } 184 185 /** 186 * Sets the default language for SyntaxHighlighter shortcode. 187 * 188 * @param array $atts Shortcode attributes. 189 * @return array 190 */ 191 public static function syntaxhighlighter_shortcodeatts( $atts ) { 192 $atts['language'] = 'php'; 193 return $atts; 194 } 195 196 /** 197 * Subverts capital_P_dangit for SyntaxHighlighter shortcode. 198 * 199 * @param string $code 200 * @return string 201 */ 202 public static function syntaxhighlighter_precode( $code ) { 203 return str_replace( 'Wordpress', 'Wordpress', $code ); 166 wp_enqueue_script( 167 'wporg-developer-function-reference', 168 get_template_directory_uri() . '/js/function-reference.js', 169 array( 'jquery', 'wp-a11y' ), 170 filemtime( dirname( __DIR__ ) . '/js/function-reference.js' ), 171 true 172 ); 173 wp_localize_script( 174 'wporg-developer-function-reference', 175 'wporgFunctionReferenceI18n', 176 array( 177 'copy' => __( 'Copy', 'wporg' ), 178 'copied' => __( 'Code copied', 'wporg' ), 179 'expand' => __( 'Expand code', 'wporg' ), 180 'collapse' => __( 'Collapse code', 'wporg' ), 181 ) 182 ); 183 184 wp_enqueue_script( 185 'wporg-developer-user-notes', 186 get_template_directory_uri() . '/js/user-notes.js', 187 array( 'jquery', 'quicktags' ), 188 filemtime( dirname( __DIR__ ) . '/js/user-notes.js' ), 189 true 190 ); 191 192 wp_enqueue_script( 193 'wporg-developer-user-notes-feedback', 194 get_template_directory_uri() . '/js/user-notes-feedback.js', 195 array( 'jquery', 'quicktags' ), 196 filemtime( dirname( __DIR__ ) . '/js/user-notes-feedback.js' ), 197 true 198 ); 199 wp_localize_script( 200 'wporg-developer-user-notes-feedback', 201 'wporg_note_feedback', 202 array( 203 'show' => __( 'Show Feedback', 'wporg' ), 204 'hide' => __( 'Hide Feedback', 'wporg' ), 205 ) 206 ); 207 } 204 208 } 205 209 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/autocomplete.js
r3244 r12050 19 19 var searchfield = $( '#search-field', form ), 20 20 processing = false, 21 search = ''; 21 search = '', 22 autocompleteResults = {}; 22 23 23 24 var awesome = new Awesomplete( searchfield.get( 0 ), { … … 63 64 return false; 64 65 }, 66 replace: function( text ) { 67 searchfield.val( text ); 68 69 if ( text in autocompleteResults ) { 70 window.location = autocompleteResults[ text ]; 71 } 72 } 65 73 } ); 66 74 … … 102 110 } 103 111 104 if ( ( response.success === true ) && response.data.posts.length ) { 112 if ( response.success === true && Object.values( response.data.posts ).length ) { 113 autocompleteResults = response.data.posts; 114 105 115 // Update the autocomplete list 106 awesome.list = response.data.posts;116 awesome.list = Object.keys( response.data.posts ); 107 117 } 108 118 } ) -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/function-reference.js
r7491 r12050 1 /* global jQuery, Prism, wporgFunctionReferenceI18n */ 1 2 /** 2 3 * function-reference.js … … 4 5 * Handles all interactivity on the single function page 5 6 */ 6 var wporg_developer = ( function( $ ) {7 'use strict';8 7 9 var $sourceCollapsedHeight; 8 // eslint-disable-next-line id-length -- $ OK. 9 jQuery( function ( $ ) { 10 // 22.5px (line height) * 15 for 15 lines + 15px top padding + 10px extra. 11 // The extra 10px added to partially show next line so it's clear there is more. 12 const MIN_HEIGHT = 22.5 * 15 + 15 + 10; 10 13 11 var $usesList, $usedByList, $showMoreUses, $hideMoreUses, $showMoreUsedBy, $hideMoreUsedBy; 12 13 function onLoad() { 14 sourceCodeHighlightInit(); 15 16 toggleUsageListInit(); 14 function collapseCodeBlock( $element, $button ) { 15 $button.text( wporgFunctionReferenceI18n.expand ); 16 $button.attr( 'aria-expanded', 'false' ); 17 // This uses `css()` instead of `height()` to prevent jQuery from adding 18 // in the padding. We want to add in just the top padding, since the 19 // bottom is intentionally cut off. 20 $element.css( { height: MIN_HEIGHT + 'px' } ); 17 21 } 18 22 19 function sourceCodeHighlightInit() { 23 function expandCodeBlock( $element, $button ) { 24 $button.text( wporgFunctionReferenceI18n.collapse ); 25 $button.attr( 'aria-expanded', 'true' ); 26 // { height: auto; } can't be used here or the transition effect won't work. 27 $element.height( $element.data( 'height' ) ); 28 } 20 29 21 // We require the SyntaxHighlighter javascript library 22 if ( undefined === window.SyntaxHighlighter ) { 23 return; 30 // For each code block, add the copy button & expanding functionality. 31 $( '.wp-block-code' ).each( function ( i, element ) { 32 const $element = $( element ); 33 let timeoutId; 34 35 const $copyButton = $( document.createElement( 'button' ) ); 36 $copyButton.text( wporgFunctionReferenceI18n.copy ); 37 $copyButton.on( 'click', function () { 38 clearTimeout( timeoutId ); 39 const code = $element.find( 'code' ).text(); 40 if ( ! code ) { 41 return; 42 } 43 44 // This returns a promise which will resolve if the copy suceeded, 45 // and we can set the button text to tell the user it worked. 46 // We don't do anything if it fails. 47 window.navigator.clipboard.writeText( code ).then( function () { 48 $copyButton.text( wporgFunctionReferenceI18n.copied ); 49 wp.a11y.speak( wporgFunctionReferenceI18n.copied ); 50 51 // After 5 seconds, reset the button text. 52 timeoutId = setTimeout( function () { 53 $copyButton.text( wporgFunctionReferenceI18n.copy ); 54 }, 5000 ); 55 } ); 56 } ); 57 58 const $container = $( document.createElement( 'div' ) ); 59 $container.addClass( 'wp-code-block-button-container' ); 60 61 $container.append( $copyButton ); 62 63 // Check code block height, and if it's larger, add in the collapse 64 // button, and set it to be collapsed differently. 65 const originalHeight = $element.height(); 66 if ( originalHeight > MIN_HEIGHT ) { 67 $element.data( 'height', originalHeight ); 68 69 const $expandButton = $( document.createElement( 'button' ) ); 70 $expandButton.on( 'click', function () { 71 if ( 'true' === $expandButton.attr( 'aria-expanded' ) ) { 72 collapseCodeBlock( $element, $expandButton ); 73 } else { 74 expandCodeBlock( $element, $expandButton ); 75 } 76 } ); 77 78 collapseCodeBlock( $element, $expandButton ); 79 $container.append( $expandButton ); 24 80 } 25 81 26 SyntaxHighlighter.highlight(); 82 $element.before( $container ); 83 } ); 27 84 28 // 1em (margin) + 10 * 17px + 10. Lines are 1.1em which rounds to 17px: calc( 1em + 17px * 10 + 10 ). 29 // Extra 10px added to partially show next line so it's clear there is more. 30 $sourceCollapsedHeight = 196; 31 sourceCodeDisplay(); 32 } 33 34 function sourceCodeDisplay( element ) { 35 36 if ( element !== undefined ) { 37 // Find table inside a specific source code element if passed. 38 var sourceCode = $( '.source-content', element ).find( 'table' ); 39 } else { 40 // Find table inside all source code elements. 41 var sourceCode = $( '.source-content' ).find( 'table' ); 42 } 43 44 if ( !sourceCode.length ) { 45 return; 46 } 47 48 sourceCode.each( function( t ) { 49 if ( ( $sourceCollapsedHeight - 12 ) < $( this ).height() ) { 50 51 var sourceContent = $( this ).closest( '.source-content' ); 52 53 // Do this with javascript so javascript-less can enjoy the total sourcecode 54 sourceContent.find( '.source-code-container' ).css( { 55 height: $sourceCollapsedHeight + 'px' 56 } ); 57 58 sourceContent.find( '.source-code-links' ).find( 'span:first' ).show(); 59 sourceContent.find( '.show-complete-source' ).show(); 60 sourceContent.find( '.show-complete-source' ).off( 'click.togglesource' ).on( 'click.togglesource', toggleCompleteSource ); 61 sourceContent.find( '.less-complete-source' ).off( 'click.togglesource' ).on( 'click.togglesource', toggleCompleteSource ); 62 } 63 } ); 64 } 65 66 function toggleCompleteSource( e ) { 67 e.preventDefault(); 68 69 var sourceContent = $( this ).closest( '.source-content' ); 70 71 if ( $( this ).parent().find( '.show-complete-source' ).is( ':visible' ) ) { 72 var heightGoal = sourceContent.find( 'table' ).height() + 45; // takes into consideration potential x-scrollbar 73 } else { 74 var heightGoal = $sourceCollapsedHeight; 75 } 76 77 sourceContent.find( '.source-code-container:first' ).animate( { height: heightGoal + 'px' } ); 78 79 $( this ).parent().find( 'a' ).toggle(); 80 } 85 let $usesList, $usedByList, $showMoreUses, $hideMoreUses, $showMoreUsedBy, $hideMoreUsedBy; 81 86 82 87 function toggleUsageListInit() { 88 var usesToShow = $( '#uses-table' ).data( 'show' ), 89 usedByToShow = $( '#used-by-table' ).data( 'show' ); 83 90 84 91 // We only expect one used_by and uses per document 85 92 $usedByList = $( 'tbody tr', '#used-by-table' ); 86 $usesList 93 $usesList = $( 'tbody tr', '#uses-table' ); 87 94 88 if ( $usedByList.length > 5) {89 $usedByList = $usedByList.slice( 5).hide();95 if ( $usedByList.length > usedByToShow ) { 96 $usedByList = $usedByList.slice( usedByToShow ).hide(); 90 97 91 98 $showMoreUsedBy = $( '.used-by .show-more' ).show().on( 'click', toggleMoreUsedBy ); … … 93 100 } 94 101 95 if ( $usesList.length > 5) {96 $usesList = $usesList.slice( 5).hide();102 if ( $usesList.length > usesToShow ) { 103 $usesList = $usesList.slice( usesToShow ).hide(); 97 104 98 105 $showMoreUses = $( '.uses .show-more' ).show().on( 'click', toggleMoreUses ); … … 101 108 } 102 109 103 function toggleMoreUses( e ) {104 e .preventDefault();110 function toggleMoreUses( event ) { 111 event.preventDefault(); 105 112 106 113 $usesList.toggle(); … … 110 117 } 111 118 112 function toggleMoreUsedBy( e ) {113 e .preventDefault();119 function toggleMoreUsedBy( event ) { 120 event.preventDefault(); 114 121 115 122 $usedByList.toggle(); … … 119 126 } 120 127 121 $( onLoad);128 toggleUsageListInit(); 122 129 123 // Expose the sourceCodeDisplay() function for usage outside of this function. 124 return { 125 sourceCodeDisplay: sourceCodeDisplay 126 }; 130 // Runs before the highlight parsing is run. 131 // `env` is defined here: https://github.com/PrismJS/prism/blob/2815f699970eb8387d741e3ac886845ce5439afb/prism.js#L583-L588 132 Prism.hooks.add( 'before-highlight', function ( env ) { 133 // If the code starts with `<`, it's either already got an opening tag, 134 // or it starts with HTML. Either way, we don't want to inject here. 135 if ( 'php' === env.language && ! env.code.startsWith( '<' ) ) { 136 env.code = '<? ' + env.code; 137 env.hasAddedTag = true; 138 } 139 } ); 127 140 128 } )( jQuery ); 141 // Runs before `highlightedCode` is set to the `innerHTML` of the container. 142 Prism.hooks.add( 'before-insert', function ( env ) { 143 if ( env.hasAddedTag ) { 144 env.highlightedCode = env.highlightedCode.replace( 145 '<span class="token delimiter important"><?</span> ', 146 '' 147 ); 148 } 149 } ); 150 } ); -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/user-notes-preview.js
r9391 r12050 116 116 } 117 117 118 // Add toggle links to source code in preview if needed.119 function updateSourceCode() {120 if ( undefined !== wporg_developer ) {121 wporg_developer.sourceCodeDisplay( preview );122 }123 }124 125 118 function updatePreview_HTML( content ) { 126 119 // Update preview content 127 120 previewContent.html( content ); 128 121 129 if ( undefined !== window.SyntaxHighlighter ) {130 SyntaxHighlighter.highlight();131 }132 133 // Add toggle link to source code in preview if needed.134 updateSourceCode();135 122 spinner.hide(); 136 123 } -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/package.json
r11195 r12050 1 1 { 2 2 "name": "wporg-developer", 3 "version": "1.0.0", 3 4 "description": "Theme for WordPress Developer Resources", 4 5 "repository": { … … 14 15 "matchdep": "~2.0.0", 15 16 "node-sass": "^6.0.1" 17 }, 18 "scripts": { 19 "start": "grunt watch", 20 "build": "grunt" 16 21 } 17 22 } -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/page-home-landing.php
r11903 r12050 17 17 18 18 <div class="box box-code-ref"> 19 <h3 class="widget-title"><div class="dashicons dashicons-editor-code"></div><?php _e( 'Code Reference', 'wporg' ); ?></h3>19 <h3><a href="<?php echo esc_url( home_url( '/reference' ) ); ?>" class="widget-title"><div class="dashicons dashicons-editor-code"></div><?php _e( 'Code Reference', 'wporg' ); ?></a></h3> 20 20 <p class="widget-description"><?php _e( 'Looking for documentation for the codebase?', 'wporg' ); ?></p> 21 21 <a href="<?php echo esc_url( home_url( '/reference' ) ); ?>" class="go"><?php _e( 'Visit the reference', 'wporg' ); ?></a> … … 23 23 24 24 <div class="box box-coding-standards"> 25 <h3 class="widget-title"><div class="dashicons dashicons-code-standards"></div><?php _e( 'Coding Standards', 'wporg' ); ?></h3>25 <h3><a href="<?php echo esc_url( get_post_type_archive_link( 'wpcs-handbook' ) ); ?>" class="widget-title"><div class="dashicons dashicons-code-standards"></div><?php _e( 'Coding Standards', 'wporg' ); ?></a></h3> 26 26 <p class="widget-description"><?php _e( 'Looking to ensure your code meets the standards?', 'wporg' ); ?></p> 27 27 <a href="<?php echo esc_url( get_post_type_archive_link( 'wpcs-handbook' ) ); ?>" class="go"><?php _e( 'Follow Standards ', 'wporg' ); ?></a> … … 29 29 30 30 <div class="box box-block-editor"> 31 <h3 class="widget-title"><div class="dashicons dashicons-edit"></div><?php _e( 'Block Editor', 'wporg' ); ?></h3>31 <h3><a href="<?php echo esc_url( get_post_type_archive_link( 'blocks-handbook' ) ); ?>" class="widget-title"><div class="dashicons dashicons-edit"></div><?php _e( 'Block Editor', 'wporg' ); ?></a></h3> 32 32 <p class="widget-description"><?php _e( 'Creating the building blocks of WordPress?', 'wporg' ); ?></p> 33 33 <a href="<?php echo esc_url( get_post_type_archive_link( 'blocks-handbook' ) ); ?>" class="go"><?php _e( 'Build Blocks ', 'wporg' ); ?></a> … … 35 35 36 36 <div class="box box-apis"> 37 <h3 class="widget-title"><div class="dashicons dashicons-admin-site-alt3"></div><?php _e( 'Common APIs', 'wporg' ); ?></h3>37 <h3><a href="<?php echo esc_url( get_post_type_archive_link( 'apis-handbook' ) ); ?>" class="widget-title"><div class="dashicons dashicons-admin-site-alt3"></div><?php _e( 'Common APIs', 'wporg' ); ?></a></h3> 38 38 <p class="widget-description"><?php _e( 'Interested in interacting with various APIs?', 'wporg' ); ?></p> 39 39 <a href="<?php echo esc_url( get_post_type_archive_link( 'apis-handbook' ) ); ?>" class="go"><?php _e( 'Utilize APIs', 'wporg' ); ?></a> … … 41 41 42 42 <div class="box box-themes"> 43 <h3 class="widget-title"><div class="dashicons dashicons-admin-appearance"></div><?php _e( 'Themes', 'wporg' ); ?></h3>43 <h3><a href="<?php echo esc_url( get_post_type_archive_link( 'theme-handbook' ) ); ?>" class="widget-title"><div class="dashicons dashicons-admin-appearance"></div><?php _e( 'Themes', 'wporg' ); ?></a></h3> 44 44 <p class="widget-description"><?php _e( 'Want to learn how to start theming WordPress?', 'wporg' ); ?></p> 45 45 <a href="<?php echo esc_url( get_post_type_archive_link( 'theme-handbook' ) ); ?>" class="go"><?php _e( 'Develop Themes ', 'wporg' ); ?></a> … … 47 47 48 48 <div class="box box-plugins"> 49 <h3 class="widget-title"><div class="dashicons dashicons-admin-plugins"></div><?php _e( 'Plugins', 'wporg' ); ?></h3>49 <h3><a href="<?php echo esc_url( get_post_type_archive_link( 'plugin-handbook' ) ); ?>" class="widget-title"><div class="dashicons dashicons-admin-plugins"></div><?php _e( 'Plugins', 'wporg' ); ?></a></h3> 50 50 <p class="widget-description"><?php _e( 'Ready to dive deep into the world of plugin authoring?', 'wporg' ); ?></p> 51 51 <a href="<?php echo esc_url( get_post_type_archive_link( 'plugin-handbook' ) ); ?>" class="go"><?php _e( 'Develop Plugins ', 'wporg' ); ?></a> … … 53 53 54 54 <div class="box box-rest-api"> 55 <h3 class="widget-title"><div class="dashicons dashicons-rest-api"></div><?php _e( 'REST API', 'wporg' ); ?></h3>55 <h3><a href="<?php echo esc_url( get_post_type_archive_link( 'rest-api-handbook' ) ); ?>" class="widget-title"><div class="dashicons dashicons-rest-api"></div><?php _e( 'REST API', 'wporg' ); ?></a></h3> 56 56 <p class="widget-description"><?php _e( 'Getting started on making WordPress applications?', 'wporg' ); ?></p> 57 57 <a href="<?php echo esc_url( get_post_type_archive_link( 'rest-api-handbook' ) ); ?>" class="go"><?php _e( 'Make Applications ', 'wporg' ); ?></a> … … 59 59 60 60 <div class="box box-wp-cli"> 61 <h3 class="widget-title"><div class="dashicons dashicons-arrow-right-alt2"></div><?php _e( 'WP-CLI', 'wporg' ); ?></h3>61 <h3><a href="<?php echo esc_url( get_post_type_archive_link( 'command' ) ); ?>" class="widget-title"><div class="dashicons dashicons-arrow-right-alt2"></div><?php _e( 'WP-CLI', 'wporg' ); ?></a></h3> 62 62 <p class="widget-description"><?php _e( 'Want to accelerate your workflow managing WordPress?', 'wporg' ); ?></p> 63 63 <a href="<?php echo esc_url( get_post_type_archive_link( 'command' ) ); ?>" class="go"><?php _e( 'Run Commands ', 'wporg' ); ?></a> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/page-reference-landing.php
r9325 r12050 14 14 <div id="content-area"> 15 15 <?php breadcrumb_trail(); ?> 16 17 <main id="main" class="site-main" role="main"> 18 <div class="reference-landing"> 19 <div class="new-in-guide two-columns clear"> 20 <div class="widget box gray"> 21 <?php $version = DevHub\get_current_version_term(); ?> 22 <?php if ( $version && ! is_wp_error( $version ) ) : ?> 23 <h3 class="widget-title"><?php printf( __( 'New & Updated in WordPress %s:', 'wporg' ), substr( $version->name, 0, -2 ) ); ?></h3> 24 <div class="widget-content"> 25 <ul class="unordered-list no-bullets"> 26 <?php 27 28 $list = new WP_Query( array( 29 'posts_per_page' => 15, 30 'post_type' => DevHub\get_parsed_post_types(), 31 'orderby' => 'title', 32 'order' => 'ASC', 33 'tax_query' => array( array( 34 'taxonomy' => 'wp-parser-since', 35 'field' => 'ids', 36 'terms' => $version->term_id, 37 ) ), 38 ) ); 39 40 while ( $list->have_posts() ) : $list->the_post(); 41 ?> 42 43 <li> 44 <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"> 45 <?php the_title(); ?> 46 </a> 47 </li> 48 49 <?php endwhile; ?> 50 <li class="view-all-new-in"><a href="<?php echo esc_attr( get_term_link( $version, 'wp-parser-since' ) ); ?>"><?php _e( 'View all…', 'wporg' ); ?></a></li> 51 </ul> 52 </div> 53 <?php endif; ?> 54 </div> 55 <div class="widget box gray"> 56 <h3 class="widget-title"><?php _e( 'API', 'wporg' ); ?></h3> 57 <div class="widget-content"> 58 <?php 59 60 if ( has_nav_menu( 'reference-home-api' ) ) : 61 wp_nav_menu( 62 [ 63 'theme_location' => 'reference-home-api', 64 'menu_class' => 'unordered-list no-bullets', 65 ] 66 ); 67 else: 68 ?> 69 70 <ul class="unordered-list no-bullets"> 71 <li><a href="https://codex.wordpress.org/Dashboard_Widgets_API"><?php _e( 'Dashboard widgets', 'wporg'); ?></a></li> 72 <li><a href="https://codex.wordpress.org/Database_API"><?php _e( 'Database', 'worg' ); ?></a></li> 73 <li><a href="https://codex.wordpress.org/HTTP_API"><?php _e( 'HTTP API', 'wporg' ); ?></a></li> 74 <li><a href="https://codex.wordpress.org/Filesystem_API"><?php _e( 'Filesystem', 'wporg' ); ?></a></li> 75 <li><a href="https://codex.wordpress.org/Global_Variables"><?php _e( 'Global Variables', 'wporg' ); ?></a></li> 76 <li><a href="https://codex.wordpress.org/Metadata_API"><?php _e( 'Metadata', 'wporg' ); ?></a></li> 77 <li><a href="https://codex.wordpress.org/Options_API"><?php _e( 'Options', 'wporg' ); ?></a></li> 78 <li><a href="https://developer.wordpress.org/plugins/"><?php _e( 'Plugins', 'wporg' ); ?></a></li> 79 <li><a href="https://codex.wordpress.org/Quicktags_API"><?php _e( 'Quicktags', 'wporg' ); ?></a></li> 80 <li><a href="https://developer.wordpress.org/rest-api/"><?php _e( 'REST API', 'wporg' ); ?></a></li> 81 <li><a href="https://codex.wordpress.org/Rewrite_API"><?php _e( 'Rewrite', 'wporg' ); ?></a></li> 82 <li><a href="https://codex.wordpress.org/Settings_API"><?php _e( 'Settings', 'wporg' ); ?></a></li> 83 <li><a href="https://codex.wordpress.org/Shortcode_API"><?php _e( 'Shortcode', 'wporg' ); ?></a></li> 84 <li><a href="https://developer.wordpress.org/themes/"><?php _e( 'Theme Modification', 'wporg' ); ?></a></li> 85 <li><a href="https://codex.wordpress.org/Transients_API"><?php _e( 'Transients', 'wporg' ); ?></a></li> 86 <li><a href="https://codex.wordpress.org/XML-RPC_WordPress_API"><?php _e( 'XML-RPC', 'wporg' ); ?></a></li> 87 </ul> 88 <?php endif; ?> 89 90 </div> 91 </div> 92 </div><!-- /new-in-guide --> 93 94 </div><!-- /reference-landing --> 95 96 </main><!-- #main --> 16 97 </div> 17 18 <main id="main" class="site-main" role="main">19 <div class="reference-landing">20 <div class="search-guide section clear">21 <h4 class="ref-intro"><?php _e( 'Want to know what's going on inside WordPress? Search the Code Reference for more information about WordPress' functions, classes, methods, and hooks.', 'wporg' ); ?></h4>22 <h3 class="search-intro"><?php _e( 'Try it out:', 'wporg' ); ?></h3>23 <?php get_search_form(); ?>24 </div><!-- /search-guide -->25 26 <div class="topic-guide section">27 <h4><?php _e( 'Or browse through topics:', 'wporg' ); ?></h4>28 <ul class="unordered-list horizontal-list no-bullets">29 <li><a href="<?php echo get_post_type_archive_link( 'wp-parser-function' ) ?>"><?php _e( 'Functions', 'wporg' ); ?></a></li>30 <li><a href="<?php echo get_post_type_archive_link( 'wp-parser-hook' ) ?>"><?php _e( 'Hooks', 'wporg' ); ?></a></li>31 <li><a href="<?php echo get_post_type_archive_link( 'wp-parser-class' ) ?>"><?php _e( 'Classes', 'wporg' ); ?></a></li>32 <li><a href="<?php echo get_post_type_archive_link( 'wp-parser-method' ) ?>"><?php _e( 'Methods', 'wporg' ); ?></a></li>33 </ul>34 </div><!-- /topic-guide -->35 36 <div class="new-in-guide section two-columns clear">37 <div class="widget box gray">38 <?php $version = DevHub\get_current_version_term(); ?>39 <?php if ( $version && ! is_wp_error( $version ) ) : ?>40 <h3 class="widget-title"><?php printf( __( 'New & Updated in WordPress %s:', 'wporg' ), substr( $version->name, 0, -2 ) ); ?></h3>41 <div class="widget-content">42 <ul class="unordered-list no-bullets">43 <?php44 45 $list = new WP_Query( array(46 'posts_per_page' => 15,47 'post_type' => DevHub\get_parsed_post_types(),48 'orderby' => 'title',49 'order' => 'ASC',50 'tax_query' => array( array(51 'taxonomy' => 'wp-parser-since',52 'field' => 'ids',53 'terms' => $version->term_id,54 ) ),55 ) );56 57 while ( $list->have_posts() ) : $list->the_post();58 ?>59 60 <li>61 <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">62 <?php the_title(); ?>63 </a>64 </li>65 66 <?php endwhile; ?>67 <li class="view-all-new-in"><a href="<?php echo esc_attr( get_term_link( $version, 'wp-parser-since' ) ); ?>"><?php _e( 'View all…', 'wporg' ); ?></a></li>68 </ul>69 </div>70 <?php endif; ?>71 </div>72 <div class="widget box gray">73 <h3 class="widget-title"><?php _e( 'API', 'wporg' ); ?></h3>74 <div class="widget-content">75 <?php76 77 if ( has_nav_menu( 'reference-home-api' ) ) :78 wp_nav_menu(79 [80 'theme_location' => 'reference-home-api',81 'menu_class' => 'unordered-list no-bullets',82 ]83 );84 else:85 ?>86 87 <ul class="unordered-list no-bullets">88 <li><a href="https://codex.wordpress.org/Dashboard_Widgets_API"><?php _e( 'Dashboard widgets', 'wporg'); ?></a></li>89 <li><a href="https://codex.wordpress.org/Database_API"><?php _e( 'Database', 'worg' ); ?></a></li>90 <li><a href="https://codex.wordpress.org/HTTP_API"><?php _e( 'HTTP API', 'wporg' ); ?></a></li>91 <li><a href="https://codex.wordpress.org/Filesystem_API"><?php _e( 'Filesystem', 'wporg' ); ?></a></li>92 <li><a href="https://codex.wordpress.org/Global_Variables"><?php _e( 'Global Variables', 'wporg' ); ?></a></li>93 <li><a href="https://codex.wordpress.org/Metadata_API"><?php _e( 'Metadata', 'wporg' ); ?></a></li>94 <li><a href="https://codex.wordpress.org/Options_API"><?php _e( 'Options', 'wporg' ); ?></a></li>95 <li><a href="https://developer.wordpress.org/plugins/"><?php _e( 'Plugins', 'wporg' ); ?></a></li>96 <li><a href="https://codex.wordpress.org/Quicktags_API"><?php _e( 'Quicktags', 'wporg' ); ?></a></li>97 <li><a href="https://developer.wordpress.org/rest-api/"><?php _e( 'REST API', 'wporg' ); ?></a></li>98 <li><a href="https://codex.wordpress.org/Rewrite_API"><?php _e( 'Rewrite', 'wporg' ); ?></a></li>99 <li><a href="https://codex.wordpress.org/Settings_API"><?php _e( 'Settings', 'wporg' ); ?></a></li>100 <li><a href="https://codex.wordpress.org/Shortcode_API"><?php _e( 'Shortcode', 'wporg' ); ?></a></li>101 <li><a href="https://developer.wordpress.org/themes/"><?php _e( 'Theme Modification', 'wporg' ); ?></a></li>102 <li><a href="https://codex.wordpress.org/Transients_API"><?php _e( 'Transients', 'wporg' ); ?></a></li>103 <li><a href="https://codex.wordpress.org/XML-RPC_WordPress_API"><?php _e( 'XML-RPC', 'wporg' ); ?></a></li>104 </ul>105 <?php endif; ?>106 107 </div>108 </div>109 </div><!-- /new-in-guide -->110 111 </div><!-- /reference-landing -->112 113 </main><!-- #main -->114 98 </div><!-- #primary --> 115 99 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/reference/template-params.php
r9823 r12050 17 17 <?php foreach ( $params as $param ) : ?> 18 18 <?php if ( ! empty( $param['variable'] ) ) : ?> 19 <dt><?php echo esc_html( $param['variable'] ); ?></dt> 19 <dt> 20 <code><?php echo esc_html( $param['variable'] ); ?></code> 21 <?php if ( ! empty( $param['types'] ) ) : ?> 22 <span class="type"><?php echo wp_kses_post( $param['types'] ); ?></span> 23 <?php endif; ?> 24 <?php if ( ! empty( $param['required'] ) && 'wp-parser-hook' !== get_post_type() ) : ?> 25 <span class="required"><?php echo esc_html( $param['required'] ); ?></span> 26 <?php endif; ?> 27 </dt> 20 28 <?php endif; ?> 21 29 <dd> 22 <p class="desc"> 23 <?php if ( ! empty( $param['types'] ) ) : ?> 24 <span class="type"><?php printf( __( '(%s)', 'wporg' ), wp_kses_post( $param['types'] ) ); ?></span> 30 <div class="desc"> 31 <?php if ( ! empty( $param['content'] ) ) : ?> 32 <?php if ( $extra = get_param_reference( $param ) ) : ?> 33 <span class="description"><?php echo wp_kses_post( $param['content'] ); ?></span> 34 <details class="extended-description"> 35 <summary> 36 <?php echo esc_html( sprintf( __( 'More Arguments from %s( ... %s )', 'wporg' ), $extra[ 'parent' ], $extra['parent_var'] ) ); ?> 37 </summary> 38 <span class="description"><?php echo wp_kses_post( $extra['content'] ); ?></span> 39 </details> 40 <?php else : ?> 41 <span class="description"><?php echo wp_kses_post( $param['content'] ); ?></span> 42 <?php endif; ?> 25 43 <?php endif; ?> 26 <?php if ( ! empty( $param['required'] ) && 'wp-parser-hook' !== get_post_type() ) : ?> 27 <span class="required"><?php printf( __( '(%s)', 'wporg' ), esc_html( $param['required'] ) ); ?></span> 28 <?php endif; ?> 29 <?php if ( ! empty( $param['content'] ) ) : ?> 30 <span class="description"><?php echo wp_kses_post( $param['content'] ); ?></span> 31 <?php endif; ?> 32 </p> 44 </div> 33 45 <?php if ( ! empty( $param['default'] ) ) : ?> 34 <p class="default"><?php _e( 'Default value:', 'wporg' );?> <?php echo htmlentities( $param['default'] ); ?></p>46 <p class="default"><?php _e( 'Default:', 'wporg' );?> <code><?php echo htmlentities( $param['default'] ); ?></code></p> 35 47 <?php endif; ?> 36 48 </dd> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/reference/template-related.php
r7491 r12050 17 17 $used_by_to_show = 5; 18 18 19 if ( $has_uses ) { 20 $uses_to_show = min( $uses_to_show, split_uses_by_frequent_funcs( $uses->posts ) ); 21 } 22 19 23 if ( $has_uses || $has_used_by ) : 20 24 ?> … … 26 30 <article class="uses"> 27 31 <h3><?php _e( 'Uses', 'wporg' ); ?></h3> 28 <table id="uses-table" >32 <table id="uses-table" data-show="<?php echo esc_attr( $uses_to_show ) ?>"> 29 33 <caption class="screen-reader-text"><?php esc_html_e( 'Uses', 'wporg' ); ?></caption> 30 34 <thead> … … 37 41 <?php while ( $uses->have_posts() ) : $uses->the_post(); ?> 38 42 <tr> 39 <td> 40 <span><?php echo esc_attr( get_source_file() ); ?>:</span> 43 <td class="related-title"> 41 44 <a href="<?php the_permalink(); ?>"><?php the_title(); ?><?php if ( ! in_array( get_post_type(), array( 'wp-parser-class', 'wp-parser-hook' ), true ) ) : ?>()<?php endif; ?></a> 45 <span><?php echo esc_attr( get_source_file() ); ?></span> 42 46 </td> 43 47 <td class="related-desc"> … … 52 56 <a href="#" class="show-more"><?php 53 57 /* translators: %d: remaining 'uses' count */ 54 printf( _n( 'Show % d more use', 'Show %dmore uses', $uses->post_count - $uses_to_show, 'wporg' ),58 printf( _n( 'Show %s more use', 'Show %s more uses', $uses->post_count - $uses_to_show, 'wporg' ), 55 59 number_format_i18n( $uses->post_count - $uses_to_show ) 56 60 ); … … 66 70 <article class="used-by"> 67 71 <h3><?php esc_html_e( 'Used By', 'wporg' ); ?></h3> 68 <table id="used-by-table" >72 <table id="used-by-table" data-show="<?php echo esc_attr( $used_by_to_show ) ?>"> 69 73 <caption class="screen-reader-text"><?php esc_html_e( 'Used By', 'wporg' ); ?></caption> 70 74 <thead> … … 77 81 <?php while ( $used_by->have_posts() ) : $used_by->the_post(); ?> 78 82 <tr> 79 <td> 80 <span><?php echo esc_attr( get_source_file() ); ?>:</span> 83 <td class="related-title"> 81 84 <a href="<?php the_permalink(); ?>"><?php the_title(); ?><?php if ( ! in_array( get_post_type(), array( 'wp-parser-class', 'wp-parser-hook' ), true ) ) : ?>()<?php endif; ?></a> 85 <span><?php echo esc_attr( get_source_file() ); ?></span> 82 86 </td> 83 87 <td class="related-desc"> … … 92 96 <a href="#" class="show-more"><?php 93 97 /* translators: %d: remaining 'used by' count */ 94 printf( _n( 'Show % d more used by', 'Show %dmore used by', $used_by->post_count - $used_by_to_show, 'wporg' ),98 printf( _n( 'Show %s more used by', 'Show %s more used by', $used_by->post_count - $used_by_to_show, 'wporg' ), 95 99 number_format_i18n( $used_by->post_count - $used_by_to_show ) 96 100 ); -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/reference/template-source.php
r11311 r12050 11 11 $source_file = get_source_file(); 12 12 if ( ! empty( $source_file ) ) : 13 $source_code = post_type_has_source_code() ? get_source_code() : ''; 13 14 ?> 14 15 <hr /> … … 16 17 <h2><?php _e( 'Source', 'wporg' ); ?></h2> 17 18 <p> 18 <?php printf( __( 'File: %s', 'wporg' ), 19 '<a href="' . esc_url( get_source_file_archive_link( $source_file ) ) . '">' . esc_html( $source_file ) . '</a>' 20 ); ?> 19 <?php 20 printf( 21 __( 'File: %s.', 'wporg' ), 22 '<code>' . esc_html( $source_file ) . '</code>' 23 ); 24 ?> 25 26 <?php 27 printf( 28 '<a href="%s">%s</a>', 29 esc_url( get_source_file_archive_link( $source_file ) ), 30 __( 'View all references', 'wporg' ) 31 ); 32 ?> 21 33 </p> 22 34 23 <?php if ( post_type_has_source_code() ) : ?> 24 <div class="source-code-container"> 25 <pre class="brush: php; toolbar: false; first-line: <?php echo esc_attr( get_post_meta( get_the_ID(), '_wp-parser_line_num', true ) ); ?>"><?php echo htmlentities( get_source_code() ); ?></pre> 26 </div> 35 <?php if ( ! empty( $source_code ) ) : ?> 36 <?php 37 echo do_blocks( 38 sprintf( 39 '<!-- wp:code {"lineNumbers":true} --><pre class="wp-block-code" data-start="%1$s" aria-label="%2$s"><code lang="php" class="language-php line-numbers">%3$s</code></pre><!-- /wp:code -->', 40 esc_attr( get_post_meta( get_the_ID(), '_wp-parser_line_num', true ) ), 41 __( 'Function source code', 'wporg' ), 42 htmlentities( $source_code ) 43 ) 44 ); 45 ?> 46 27 47 <p class="source-code-links"> 28 <span>29 <a href="#" class="show-complete-source"><?php _e( 'Expand full source code', 'wporg' ); ?></a>30 <a href="#" class="less-complete-source"><?php _e( 'Collapse full source code', 'wporg' ); ?></a>31 </span>32 48 <span><a href="<?php echo get_source_file_link(); ?>"><?php _e( 'View on Trac', 'wporg' ); ?></a></span> 33 49 <span><a href="<?php echo get_github_source_file_link(); ?>"><?php _e( 'View on GitHub', 'wporg' ); ?></a></span> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/scss/admin.scss
r7816 r12050 1 // stylelint-disable selector-id-pattern -- These are generated names. 2 1 3 /* =Admin CSS 2 4 ----------------------------------------------- */ … … 25 27 26 28 /* Explanations */ 27 28 29 .fixed { 29 30 .column-has_explanation { … … 40 41 margin-top: 4px; 41 42 42 &:focus, &:hover { 43 &:focus, 44 &:hover { 43 45 color: #0073aa; 44 46 } … … 49 51 50 52 .screen-reader-text { 53 51 54 @media screen and (max-width: 782px) { 52 55 position: static; … … 59 62 } 60 63 61 & [aria-hidden="true"] { 64 [aria-hidden="true"] { 65 62 66 @media screen and (max-width: 782px) { 63 67 display: none; … … 81 85 padding-left: 0; 82 86 } 87 83 88 &:nth-child(n+2) { 84 89 padding-left: 8px; … … 89 94 90 95 .status { 91 font-weight: bold;96 font-weight: 700; 92 97 93 98 &.pending { 94 color: red;99 color: #f00; 95 100 } 96 101 97 102 &.publish { 98 color: green;103 color: #008000; 99 104 } 100 105 } 106 101 107 .post-type-wp-parser-function, 102 108 .post-type-wp-parser-class, … … 108 114 padding-bottom: 10px; 109 115 } 116 110 117 td { 111 118 padding: 10px; -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/scss/main.scss
r11910 r12050 1 // stylelint-disable no-duplicate-selectors -- duplicates OK when nested. 2 // stylelint-disable max-line-length -- Comments may be longer. 3 // stylelint-disable font-family-no-missing-generic-family-keyword -- dashicons OK. 4 // stylelint-disable function-url-quotes -- Allow quotes in `url("…")`. 5 1 6 @import "reset"; 2 7 @import "global"; 3 8 4 9 .home .devhub-wrap { 5 h1, h2, h3, h4, h5, h6 { 10 h1, 11 h2, 12 h3, 13 h4, 14 h5, 15 h6 { 6 16 font-family: "Open Sans", sans-serif; 7 17 } 8 18 padding-bottom: 0; 19 9 20 #content { 10 21 padding: 0; … … 14 25 .devhub-wrap { 15 26 padding-bottom: 1.5em; 27 16 28 *, 17 *: before,18 *: after {29 *::before, 30 *::after { 19 31 -moz-box-sizing: border-box; 20 32 -webkit-box-sizing: border-box; … … 24 36 /* Override inline style from wporg-markdown plugin. */ 25 37 a.github-edit { 26 padding: 0 .6em 0; 27 } 28 29 #content, #content-area { 30 padding: 0 #{"max( 20px, 2% )"}; 31 32 .toc-heading { 33 clear: left; 34 } 38 padding: 0 0.6em 0; 39 } 40 41 #content, 42 #content-area { 43 padding: 0 12px; // Matches .site-branding padding 35 44 36 45 table { 37 46 border: 1px solid #f0f0f0; 38 @media ( max-width: 991px ) { 39 overflow-x: scroll; 40 display: block; 41 } 47 42 48 th { 43 49 padding: 1em; … … 45 51 background: #f0f0f0; 46 52 } 53 47 54 td { 48 55 padding: 0.8em 1em; … … 51 58 } 52 59 } 60 61 @media ( min-width: 889px ) { 62 #content { 63 padding: 0; 64 } 65 66 #content-area { 67 padding: 0 24px; 68 } 69 } 70 53 71 #content-area, 54 72 .inner-wrap { 55 73 margin: 2rem auto 0; 56 max-width: 60em; 57 } 74 max-width: $devhub-wrap-content-width; 75 } 76 58 77 .page-header { 59 78 margin-top: 1em; … … 89 108 font-weight: 300; 90 109 font-size: 28px; 91 line-height: 1 em;92 text-shadow: #fff 0 px 1px 0px;110 line-height: 1; 111 text-shadow: #fff 0 1px 0; 93 112 font-family: $header-font; 94 113 } 95 114 96 115 h1 { 97 font-size: 28px;98 116 font-size: 3rem; 99 line-height: 32px; 100 line-height: 3.2rem; 117 line-height: 1.067; 101 118 font-weight: 300; 102 119 margin-bottom: 1.5rem; 103 120 } 121 104 122 h2 { 105 font-size: 22px;106 123 font-size: 2.2rem; 107 line-height: 26px; 108 line-height: 2.6rem; 124 line-height: 1.18; 109 125 font-weight: 300; 110 126 } 127 111 128 h3 { 112 font-size: 20px;113 129 font-size: 2rem; 114 line-height: 24px; 115 line-height: 2.4rem; 130 line-height: 1.2; 116 131 font-weight: 300; 117 132 } 133 118 134 h4 { 119 font-size: 18px;120 135 font-size: 1.8rem; 121 line-height: 22px; 122 line-height: 2.2rem; 136 line-height: 1.2; 123 137 border-bottom: none; 124 138 font-weight: 300; 125 139 126 140 .dashicons { 127 font-size: 22px;128 141 font-size: 2.2rem; 129 line-height: 22px; 130 line-height: 2.2rem; 131 height: 22px; 132 width: 22px; 133 height: 2.2rem; 134 width: 2.2rem; 142 line-height: 1; 143 height: 1em; 144 width: 1em; 135 145 } 136 146 } … … 151 161 border-radius: 3px; 152 162 background: #fff; 153 color: rgba(0, 0, 0, .8);163 color: rgba(0, 0, 0, 0.8); 154 164 cursor: pointer; /* Improves usability and consistency of cursor style between image-type 'input' and others */ 155 font-size: 16px;156 165 font-size: 1.6rem; 157 166 line-height: 1.1; 158 167 float: none; 159 168 height: auto; 160 padding: .6em 1.8em;169 padding: 0.6em 1.8em; 161 170 text-decoration: none; 162 171 -webkit-appearance: button; /* Corrects inability to style clickable 'input' types in iOS */ 172 163 173 &:hover { 164 174 border-color: #ccc #bbb #aaa #bbb; 165 175 background: #f0f0f0; 166 176 } 167 &:focus, &:active { 177 178 &:focus, 179 &:active { 168 180 border-color: #aaa #bbb #bbb #bbb; 169 181 background: #f0f0f0; 170 -webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.6), 1px 1px 2px rgba(0,0,0,0.4);171 box-shadow: inset 0 1px 0 rgba(120,200,230,0.6), 1px 1px 2px rgba(0,0,0,0.4);172 } 182 box-shadow: 0 0 3px get-color(blue-40); 183 } 184 173 185 &.shiny-blue { 174 background-color: #21759b; 175 background-image: -webkit-gradient(linear, left top, left bottom, from(#2a95c5), to(#21759b)); 176 background-image: -webkit-linear-gradient(top, #2a95c5, #21759b); 177 background-image: -moz-linear-gradient(top, #2a95c5, #21759b); 178 background-image: -ms-linear-gradient(top, #2a95c5, #21759b); 179 background-image: -o-linear-gradient(top, #2a95c5, #21759b); 180 background-image: linear-gradient(to bottom, #2a95c5, #21759b); 181 border-color: #21759b; 182 border-bottom-color: #1e6a8d; 183 -webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.5); 184 box-shadow: inset 0 1px 0 rgba(120,200,230,0.5); 186 background-color: get-color(blue-50); 187 border-color: get-color(blue-50); 188 border-bottom-color: get-color(blue-70); 185 189 color: #fff; 186 190 text-decoration: none; 187 text-shadow: 0 -1px 0 rgba(0,0,0,0.3); 188 padding: 3px 8px; 189 &:hover { 190 background-color: #278ab7; 191 background-image: -webkit-gradient(linear, left top, left bottom, from(#2e9fd2), to(#21759b)); 192 background-image: -webkit-linear-gradient(top, #2e9fd2, #21759b); 193 background-image: -moz-linear-gradient(top, #2e9fd2, #21759b); 194 background-image: -ms-linear-gradient(top, #2e9fd2, #21759b); 195 background-image: -o-linear-gradient(top, #2e9fd2, #21759b); 196 background-image: linear-gradient(to bottom, #2e9fd2, #21759b); 197 border-color: #1b607f; 198 -webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.6); 199 box-shadow: inset 0 1px 0 rgba(120,200,230,0.6); 191 192 &:hover, 193 &:focus, 194 &:active { 195 background-color: get-color(blue-60); 196 border-color: get-color(blue-80); 200 197 color: #fff; 201 text-shadow: 0 -1px 0 rgba(0,0,0,0.3); 202 } 203 } 198 } 199 200 &:focus, 201 &:active { 202 box-shadow: 0 0 3px 1px get-color(yellow-30); 203 } 204 } 205 204 206 .dashicons { 207 transform: scale(-1, 1); 205 208 vertical-align: text-bottom; 206 209 } … … 210 213 .three-columns a.button { 211 214 max-width: 100%; 212 padding: .6em 1em; 213 font-size: 14px; 215 padding: 0.6em 1em; 214 216 font-size: 1.4rem; 215 217 } 218 216 219 .three-columns .dashicons { 217 220 width: 16px; … … 226 229 padding: 0; /* Addresses excess padding in IE8/9 */ 227 230 } 231 228 232 input[type="search"] { 229 233 -webkit-appearance: textfield; /* Addresses appearance set to searchfield in S5, Chrome */ 230 -webkit-box-sizing: content-box; /* Addresses box sizing set to border-box in S5, Chrome (include -moz to future-proof) */ 231 -moz-box-sizing: content-box; 232 box-sizing: content-box; 233 } 234 input[type="search"]::-webkit-search-decoration { /* Corrects inner padding displayed oddly in S5, Chrome on OSX */ 235 -webkit-appearance: none; 236 } 237 button::-moz-focus-inner, 238 input::-moz-focus-inner { /* Corrects inner padding and border displayed oddly in FF3/4 www.sitepen.com/blog/2008/05/14/the-devils-in-the-details-fixing-dojos-toolbar-buttons/ */ 239 border: 0; 240 padding: 0; 241 } 234 box-sizing: content-box; 235 } 236 237 input[type="search"]::-webkit-search-decoration { 238 -webkit-appearance: none; /* Corrects inner padding displayed oddly in S5, Chrome on OSX */ 239 } 240 242 241 input[type="text"], 243 242 input[type="email"], … … 250 249 border: 1px solid #ccc; 251 250 border-radius: 3px; 251 252 252 &:focus { 253 253 color: #111; 254 254 } 255 255 } 256 256 257 textarea { 257 258 overflow: auto; /* Removes default vertical scrollbar in IE6/7/8/9 */ … … 263 264 } 264 265 265 /* Text meant only for screen readers */266 .screen-reader-text {267 clip: rect(1px, 1px, 1px, 1px);268 position: absolute !important;269 }270 271 .screen-reader-text:hover,272 .screen-reader-text:active,273 .screen-reader-text:focus {274 b ackground-color: #f1f1f1;266 select { 267 appearance: none; 268 background-color: $color-white; 269 background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' width='24' height='24' aria-hidden='true'%3E%3Cpath d='M17.5 11.6 12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z'/%3E%3C/svg%3E%0A"); 270 background-position: right center; 271 background-repeat: no-repeat; 272 background-size: 1.5em 1.5em; 273 padding-right: 2em; 274 color: get-color(gray-70); 275 border: 1px solid get-color(gray-70); 275 276 border-radius: 3px; 276 box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);277 clip: auto !important;278 color: #21759b;279 display: block;280 font-size: 14px;281 font-weight: bold;282 height: auto;283 left: 5px;284 line-height: normal;285 padding: 15px 23px 14px;286 text-decoration: none;287 top: 5px;288 width: auto;289 z-index: 100000; /* Above WP toolbar */290 277 } 291 278 292 279 /* Clearing */ 293 .clear:before, 294 .clear:after, 295 .entry-content:before, 296 .entry-content:after, 297 .comment-content:before, 298 .comment-content:after, 299 .site-content:before, 300 .site-content:after, 301 .site-footer:before, 302 .site-footer:after { 303 content: ''; 280 .clear::before, 281 .clear::after, 282 .entry-content::before, 283 .entry-content::after, 284 .comment-content::before, 285 .comment-content::after, 286 .site-content::before, 287 .site-content::after, 288 .site-footer::before, 289 .site-footer::after, 290 section::after { 291 content: ""; 304 292 display: table; 305 293 } 306 294 307 .clear:after, 308 .entry-content:after, 309 .comment-content:after, 310 .site-content:after, 311 .site-footer:after { 295 .clear::after, 296 .entry-content::after, 297 .comment-content::after, 298 .site-content::after, 299 .site-footer::after, 300 section::after { 312 301 clear: both; 313 302 } … … 315 304 /* =Content 316 305 ----------------------------------------------- */ 306 317 307 .hentry { 318 308 margin: 0; 319 309 } 310 320 311 .byline, 321 312 .updated { 322 313 display: none; 323 314 } 315 324 316 .single .byline, 325 317 .group-blog .byline { 326 318 display: inline; 327 319 } 320 328 321 .page-content, 329 322 .entry-content, … … 331 324 margin: 1.5em 0 0; 332 325 } 326 333 327 .page-links { 334 328 clear: both; … … 342 336 margin: 0; 343 337 } 338 344 339 .tablist li { 345 340 display: inline-block; 346 341 list-style: none; 347 342 } 343 348 344 .tablist a { 349 border-color: none;345 border-color: transparent; 350 346 background-color: transparent; 351 border-color: transparent;352 347 border-image: none; 353 348 border-style: solid solid none; 354 349 border-width: 1px 1px 0; 355 350 display: inline-block; 356 padding: .5em 1em; 357 margin-bottom:-1px; 358 } 351 padding: 0.5em 1em; 352 margin-bottom: -1px; 353 } 354 359 355 .tablist a[aria-selected], 360 356 .tablist a:focus { … … 364 360 color: #333; 365 361 } 362 366 363 .tab-section { 367 364 margin-top: 0; … … 369 366 border: none; 370 367 } 368 371 369 .tab-section[aria-hidden="true"] { 372 370 display: none; 373 371 } 372 374 373 .tab-section:focus { 375 374 background: #eee; … … 388 387 padding: 0; 389 388 } 389 390 390 .wp-caption { 391 391 border: 1px solid #ccc; … … 393 393 max-width: 100%; 394 394 } 395 395 396 .wp-caption img[class*="wp-image-"] { 396 397 display: block; … … 398 399 max-width: 98%; 399 400 } 401 400 402 .wp-caption-text { 401 403 text-align: center; 402 404 } 405 403 406 .wp-caption .wp-caption-text { 404 407 margin: 0.8075em 0; 405 408 } 409 406 410 .site-main .gallery { 407 411 margin-bottom: 1.5em; 408 412 } 413 409 414 .site-main .gallery a img { 410 415 border: none; … … 412 417 max-width: 90%; 413 418 } 419 414 420 .site-main .gallery dd { 415 421 margin: 0; … … 437 443 } 438 444 439 .widget-area .search-section.hide-if-js {440 display: block;441 }442 443 445 /* =Infinite Scroll 444 446 ----------------------------------------------- */ … … 456 458 457 459 458 459 460 /* 460 461 * Header area … … 468 469 font-size: 1.3rem; 469 470 } 471 470 472 .breadcrumb-trail { 471 473 margin-bottom: 2rem; … … 475 477 } 476 478 } 479 477 480 h1.entry-title, 478 481 h1.page-title { 479 482 font-weight: 300; 480 font-size: 37px;481 483 font-size: 3.7rem; 482 484 color: #606060; 483 485 text-align: center; 486 484 487 a { 485 488 text-decoration: none; … … 491 494 h2.entry-title { 492 495 text-align: left; 493 font-size: 30px;494 496 font-size: 3rem; 495 padding: 0 0 24px;496 497 padding: 0 0 2.4rem; 497 498 … … 507 508 508 509 .home-landing .section { 509 padding: 50px 0 10px;510 510 padding: 5rem 0 1rem; 511 margin-top: 60px;512 511 margin-top: 6rem; 513 512 overflow: auto; … … 515 514 .no-bullets { 516 515 li { 517 line-height: 20px; 518 line-height: 2rem; 519 margin-bottom: 12.5px; 516 line-height: 1.5; 520 517 margin-bottom: 1.25rem; 521 518 … … 528 525 529 526 .widget-title { 530 line-height: 60px; 531 line-height: 6rem; 527 line-height: 2.4; 528 cursor: pointer; 529 text-decoration: none; 530 color: inherit; 531 font-weight: inherit; 532 532 } 533 533 … … 542 542 543 543 } 544 544 545 .color.section { 545 546 color: #fff; 546 547 } 548 547 549 .section { 550 548 551 /*background: #0073aa;*/ 549 padding: 30px 0;550 552 padding: 3rem 0; 551 553 552 554 .box { 553 555 text-align: center; 554 555 padding: 0 30px 90px;556 556 padding: 0 3rem 9rem; 557 557 width: 320px; … … 559 559 .widget-description { 560 560 padding: 1em 0 0; 561 margin-bottom: 5px;562 561 margin-bottom: 1rem; 563 562 } 564 563 } 564 565 565 &.search-guide { 566 padding-top: 60px;567 566 padding-top: 6rem; 568 567 margin-top: 0; … … 574 573 575 574 .widget-title { 576 577 font-size: 25px;578 575 font-size: 2.5rem; 579 line-height: 20px;580 line-height: 2rem; 576 line-height: 0.8; 577 581 578 .dashicons { 582 579 color: #222; 583 font-size: 108px;584 580 font-size: 10.8rem; 585 line-height: 84px; 586 line-height: 8.4rem; 587 height: 84px; 588 width: 84px; 581 line-height: 0.778; 589 582 height: 8.4rem; 590 583 width: 8.4rem; 591 display: block;592 584 margin: 0 auto; 593 585 opacity: 0.4; 586 display: flex; 587 align-items: center; 588 flex-direction: column; 594 589 595 590 &.dashicons-rest-api { 596 font-size:90px; 597 font-size:9rem; 591 font-size: 9rem; 598 592 } 599 593 } 600 594 } 595 601 596 .three-columns .widget-title { 597 602 598 @media ( min-width: 43em ) and ( max-width: 915px ) { 603 font-size: 35px;604 599 font-size: 3.5rem; 605 600 } … … 611 606 background: #797878; 612 607 color: #fff; 608 613 609 h2, 614 610 h3, … … 616 612 color: #fff; 617 613 } 614 618 615 .inner-wrap { 619 max-width: 760px;620 616 max-width: 76rem; 621 617 margin: 1.2em auto 0; … … 627 623 text-align: center; 628 624 } 625 629 626 .code-ref-right { 630 627 float: left; … … 644 641 text-align: center; 645 642 } 643 646 644 .code-ref-left .widget-description { 647 645 margin-left: 0; … … 658 656 .widget-title { 659 657 font-weight: 300; 660 font-size: 50px;661 658 font-size: 5rem; 662 line-height: 68px;663 line-height: 6.8rem; 659 line-height: 1.36; 660 664 661 .dashicons { 665 font-size: 68px;666 662 font-size: 6.8rem; 667 line-height: 68px; 668 line-height: 6.8rem; 669 height: 6.8px; 670 width: 6.8px; 663 line-height: 1; 671 664 height: 6.8rem; 672 665 width: 6.8rem; 673 666 } 667 674 668 @media ( min-width: 43em ) and ( max-width: 915px ) { 675 font-size: 35px;676 669 font-size: 3.5rem; 677 670 } 678 671 } 672 679 673 .widget-description { 680 margin-left: 85px;681 674 margin-left: 8.5rem; 682 675 } … … 687 680 background: #f2f2f2; 688 681 color: #606060; 682 689 683 .widget-title { 690 684 color: #606060; … … 692 686 693 687 a { 694 color: #2D96C2; 695 } 696 } 688 color: #2d96c2; 689 } 690 } 691 697 692 a { 698 693 color: #606060; 699 694 text-decoration: none; 700 695 701 &.make-wp-link: after {696 &.make-wp-link::after { 702 697 content: "\f345"; 703 font-family: 'dashicons';698 font-family: dashicons; 704 699 margin-left: 4px; 705 700 vertical-align: middle; … … 709 704 710 705 .section .home-primary-content { 711 max-width: 600px;712 706 max-width: 60rem; 713 707 margin: 0 auto; … … 715 709 716 710 .box { 717 padding: 30px;718 711 padding: 3rem; 719 712 float: left; 720 713 clear: none; 721 714 } 715 722 716 .three-columns .box { 717 723 718 @media ( min-width: 43em ) and ( max-width: 915px ) { 724 padding: 30px 20px;725 719 padding: 3rem 2rem; 726 }727 }728 729 .reference-landing .section.search-section {730 padding-top: 0;731 }732 733 div#inner-search {734 background-color: #666;735 margin-bottom: 1em;736 padding-top: 2px;737 .section.search-section {738 color: #ffffff;739 }740 div#inner-search-icon-container {741 margin: 0 auto;742 max-width: 60em;743 cursor: pointer;744 div#inner-search-icon {745 background-color: #666;746 color: #ffffff;747 text-align: center;748 margin-right: 26px;749 margin-left: 4px;750 float: right;751 padding: 5px;752 -webkit-border-bottom-right-radius: 5px;753 -webkit-border-bottom-left-radius: 5px;754 -moz-border-radius-bottomright: 5px;755 -moz-border-radius-bottomleft: 5px;756 border-bottom-right-radius: 5px;757 border-bottom-left-radius: 5px;758 .dashicons-search {759 height: auto;760 width: auto;761 &:before {762 font-size: 36px;763 line-height: 36px;764 }765 }766 }767 720 } 768 721 } … … 771 724 margin: 5rem 0; 772 725 font-size: 1.5rem; 726 line-height: 1.5; 727 728 select, 773 729 input[type="submit"] { 774 margin-left: .5em; 775 padding: 0.2em 0.5em; 776 line-height: 1; 777 font-size: 1.5rem; 778 } 779 } 780 781 .searchform { 782 overflow: hidden; 783 height: auto; 784 position: relative; 785 input[type="text"] { 786 border-radius: 0; 787 margin: 0 auto; 788 padding: 0.5em; 789 width: 100%; 790 } 791 .button-search { 792 background: transparent; 793 border: none; 794 border-radius: 0; 795 box-shadow: none; 796 color: #32373c; 797 display: block; 798 height: 40px; 799 padding: 0.5rem 1rem; 800 position: absolute; 801 right: 0; 802 top: 0; 803 text-shadow: none; 804 } 805 label { 806 width: 560px; 807 width: 56rem; 808 max-width: 100%; 809 margin-right: 15px; 810 display: inline-block; 811 float: left; 812 .search-field input[type="text"] { 813 width: 100%; 814 } 815 } 816 div { 817 overflow: auto; 818 } 819 .search-post-type { 820 margin-top: 1em; 821 822 label { 823 border-right: 1px solid #ccc; 824 float: none; 825 width: inherit; 826 margin-left: 1em; 827 margin-right: 0; 828 padding-left: 0; 829 padding-right: 1.3em; 830 input { 831 margin-bottom: 6px; 832 padding-left: 0.5em; 833 vertical-align: middle; 834 } 835 } 836 label:last-child { 837 border-right-width: 0; 838 } 839 840 @media ( max-width: 688px ) { 841 span { 842 display: block; 843 } 844 845 label { 846 margin-left: 0; 847 margin-right: 1em; 848 width: 130px; 849 850 &:last-child { 851 margin-right: 0; 852 padding-right: 0; 853 width: initial; 854 } 855 } 856 } 730 margin: 0 0 0 0.5em; 731 padding: 0.333em 1em; 732 font-size: inherit; 733 line-height: inherit; 734 } 735 736 select { 737 padding-right: 2em; 857 738 } 858 739 } 859 740 860 741 .search-results-summary { 861 font-style: italic;862 742 margin-bottom: 1em; 863 } 864 865 .reference-landing .section, .search-section { 866 max-width: 970px; 743 padding: 2rem; 744 background: get-color(gray-2); 745 border-radius: 2px; 746 font-size: 14px; 747 } 748 749 .reference-landing .section { 867 750 max-width: 97rem; 868 751 margin: 0 auto; … … 884 767 margin-bottom: 0; 885 768 } 769 886 770 &.search-guide { 887 771 padding-bottom: 0; 888 772 } 889 &.section.topic-guide, &.section.new-in-guide { 773 774 &.section.topic-guide, 775 &.section.new-in-guide { 890 776 padding-top: 0; 891 777 } … … 896 782 .sidebar .box { 897 783 padding: 0; 898 border: 2px solid #cccccc; 899 background-color: #eeeeee; 784 border: 2px solid #ccc; 785 background-color: #eee; 786 900 787 ul { 901 788 padding: 2em; … … 904 791 905 792 .widget-title { 906 padding: 10px 30px;907 793 padding: 1rem 30px; 908 font-size: 16px;909 794 font-size: 1.6rem; 910 795 } 796 911 797 .widget-content { 912 padding: 16px 30px;913 798 padding: 1.6rem 3rem; 914 799 } … … 924 809 width: 31%; 925 810 margin: 1.15%; 811 926 812 @media ( min-width: 43em ) and ( max-width: 915px ) { 927 813 margin: 1% 0; … … 931 817 .two-columns .box { 932 818 width: 48%; 933 margin: 1% 1% 1% 0; 819 margin-top: 1%; 820 margin-bottom: 1%; 934 821 } 935 822 936 823 .new-in-guide.two-columns .box { 937 width: 43%; 824 margin-left: 1%; 825 938 826 @media ( max-width: 688px ) { 939 827 width: 100%; 940 } 941 } 828 margin-left: 0; 829 } 830 } 831 942 832 .new-in-guide.two-columns .box:first-child { 943 width: 53%; 833 width: 48%; 834 margin-right: 1%; 835 margin-left: 0; 836 944 837 @media ( max-width: 688px ) { 945 838 width: 100%; … … 954 847 padding: 0; 955 848 } 849 956 850 .horizontal-list { 957 851 display: block; … … 960 854 margin: 0; 961 855 padding: 0; 962 text-align: center;963 } 856 } 857 964 858 .horizontal-list li { 965 859 display: inline; 966 860 } 861 967 862 .horizontal-list li a { 968 padding: 0px 40px;969 863 padding: 0 4rem; 970 864 border-left: 1px solid #ccc; 971 865 } 866 972 867 .horizontal-list li:first-child a { 973 868 padding-left: 0; … … 993 888 background: #fff; 994 889 border: 1px solid #d8d8d8; 890 995 891 .widget-title { 996 color: #666 666;892 color: #666; 997 893 background: #d8d8d8; 998 894 text-transform: uppercase; … … 1005 901 padding: 0; 1006 902 margin: 0; 1007 font-size: 13px;1008 903 font-size: 1.3rem; 1009 line-height: 30px; 1010 line-height: 3rem; 904 line-height: 2.3; 1011 905 } 1012 906 … … 1014 908 font-weight: 400; 1015 909 } 910 1016 911 .go { 1017 912 color: #4ca6cf; … … 1022 917 margin: 24px 0; 1023 918 font-size: 20px; 1024 font-weight: normal; 1025 } 1026 } 1027 .wp-parser-class, .wp-parser-function, .wp-parser-hook, .wp-parser-method { 919 font-weight: 400; 920 } 921 } 922 923 .wp-parser-class, 924 .wp-parser-function, 925 .wp-parser-hook, 926 .wp-parser-method { 1028 927 border-bottom: 1px solid #dfdfdf; 1029 928 … … 1032 931 padding-left: 100px; 1033 932 text-indent: -100px; 1034 color: #24831d;1035 font-family: $code-font;1036 933 font-size: 20px; 1037 .hook-func { 1038 color: #888888; 1039 } 1040 .arg-type { 1041 color: #cd2f23; 1042 font-style: italic; 1043 } 1044 .arg-name { 1045 color: #0f55c8; 1046 } 1047 .arg-default { 1048 color: #000000; 1049 } 1050 a:hover { 1051 border-bottom: 1px dotted #21759b; 1052 } 1053 } 934 line-height: 1.6; 935 } 936 1054 937 h2 { 1055 938 font-family: $serif-font; 1056 margin-bottom: .5em; 1057 } 1058 .return-type { 1059 font-style: italic; 1060 } 1061 .parameters { 939 margin-bottom: 0.5em; 940 } 941 942 .toc-header { 943 margin-top: 0 !important; 944 } 945 946 h1, 947 .signature-highlight { 948 color: get-color(green-50); 949 font-family: $code-font; 950 font-weight: 400; 951 952 .hook-func, 953 .keyword { 954 color: get-color(gray-50); 955 } 956 957 .arg-type { 958 color: get-color(red-50); 959 font-style: italic; 960 font-size: 0.9em; 961 } 962 963 .arg-name { 964 color: get-color(blue-60); 965 } 966 967 .arg-default { 968 color: $color-black; 969 } 970 971 a { 972 text-decoration: none; 973 color: inherit; 974 975 &:hover { 976 border-bottom: 1px dotted get-color(blue-50); 977 } 978 } 979 } 980 981 .return .return-type { 982 margin-right: 8px; 983 font-size: 14px; 984 } 985 986 .return-type, 987 .return .type, 988 .parameters .type { 989 color: get-color(red-50); 990 991 a { 992 color: inherit; 993 text-decoration: none; 994 border-bottom: 1px dotted get-color(gray-70); 995 996 &:hover { 997 border-bottom-style: solid; 998 } 999 } 1000 } 1001 1002 .parameters, 1003 .return { 1062 1004 p { 1063 1005 margin-bottom: 0; 1064 1006 } 1007 1008 dt code { 1009 font-weight: 400; 1010 } 1011 1065 1012 dd { 1066 .desc { 1067 .type, .required { 1068 font-style: italic; 1013 margin-bottom: 2em; 1014 1015 ul { 1016 margin-left: 2.5rem; 1017 1018 ul { 1019 margin-bottom: 0.5em; 1069 1020 } 1070 1021 } 1071 .default { 1072 font-style: italic; 1022 1023 code { 1024 background: #efefef; 1025 border-radius: 4px; 1026 padding: 2px 6px; 1073 1027 } 1074 1075 ul { 1076 margin-left: 25px;1077 margin-left: 2.5rem;1078 1079 } 1028 } 1029 1030 dd:last-child { 1031 margin-bottom: 0; 1032 } 1033 1080 1034 .param-hash { 1081 1035 margin-left: 1.2em; 1082 1036 margin-bottom: 0.5em; 1037 1038 .desc { 1039 margin-left: 1.5em; 1040 } 1041 1083 1042 > li { 1084 margin-top: 1em; 1043 margin-top: 1.5em; 1044 1045 > code { 1046 background: transparent; 1047 padding: unset; 1048 } 1085 1049 } 1050 1086 1051 li li { 1087 1052 list-style-type: circle; 1088 1053 } 1054 1089 1055 .param-hash > li { 1090 1056 list-style-type: disc; 1091 1057 } 1092 1058 } 1093 } 1059 1060 .desc { 1061 margin: 1rem 0 0.5rem; 1062 } 1063 1064 .extended-description { 1065 margin: 1.5em 0 1.5em 1.2em; 1066 1067 summary + .description { 1068 display: block; 1069 margin-top: 1em; 1070 } 1071 1072 summary { 1073 color: #21759b; 1074 text-decoration: underline; 1075 } 1076 } 1077 1078 .type, 1079 .required { 1080 margin: 0 4px; 1081 font-weight: 400; 1082 } 1083 1084 .type { 1085 margin-left: 8px; 1086 font-size: 14px; 1087 font-style: 400; 1088 } 1089 1090 .required { 1091 font-size: 12px; 1092 } 1093 } 1094 1094 1095 .learn-more { 1095 1096 background-color: #f1f1f1; … … 1098 1099 padding: 20px; 1099 1100 } 1101 1100 1102 .deprecated, 1101 1103 .private-access { 1102 1104 margin-top: 30px; 1103 1105 padding: 20px; 1106 1104 1107 p { 1105 margin-bottom: 0px; 1106 } 1107 } 1108 margin-bottom: 0; 1109 } 1110 } 1111 1108 1112 .deprecated { 1109 1113 background-color: #fbeaea; 1110 1114 border: 1px solid #dc3232; 1111 1115 } 1116 1112 1117 .deprecated-method { 1113 1118 color: #be2423; 1114 1119 font-style: italic; 1115 1120 } 1121 1116 1122 .private-access { 1117 1123 border: 1px solid #ffb900; 1118 1124 background-color: #fff8e5; 1119 1125 } 1126 1120 1127 .callout { 1121 1128 margin-top: 30px; 1122 1129 } 1123 .toc-jump { 1124 display: inline-block; 1125 float: right; 1126 } 1127 } 1128 1129 .callout:before { 1130 } 1131 1132 .callout::before { 1130 1133 top: 0.4em; 1131 1134 } 1132 1135 1133 &.archive, &.search { 1134 .wp-parser-class, .wp-parser-function, .wp-parser-hook, .wp-parser-method { 1136 &.archive, 1137 &.search { 1138 .wp-parser-class, 1139 .wp-parser-function, 1140 .wp-parser-hook, 1141 .wp-parser-method { 1135 1142 h1 { 1136 1143 font-family: $body-font; 1137 1144 color: #21759b; 1138 font-weight: normal; 1139 } 1145 font-weight: 400; 1146 } 1147 1140 1148 div { 1141 1149 &.sourcefile { 1142 color: #999 999;1150 color: #999; 1143 1151 font-style: italic; 1144 1152 } … … 1148 1156 1149 1157 .single { 1150 .wp-parser-class, .wp-parser-function, .wp-parser-hook, .wp-parser-method { 1158 .wp-parser-class, 1159 .wp-parser-function, 1160 .wp-parser-hook, 1161 .wp-parser-method { 1151 1162 border-bottom-style: none; 1152 1163 } … … 1155 1166 /* = Related 1156 1167 ----------------------------------------------- */ 1168 1157 1169 .related { 1158 .show-more, .hide-more { 1170 .show-more, 1171 .hide-more { 1159 1172 display: none; 1160 1173 } … … 1162 1175 /* Hide the title and toc links (same as .screen-reader-text) 1163 1176 this allows for linking from the toc. */ 1164 h3, .uses .toc-jump, .used-by .toc-jump { 1177 1178 h3, 1179 .uses .toc-jump, 1180 .used-by .toc-jump { 1165 1181 height: 0; 1166 1182 margin-bottom: 0; … … 1169 1185 } 1170 1186 1171 .used-by, .uses { 1187 .used-by, 1188 .uses { 1172 1189 overflow-x: auto; 1173 1190 clear: right; 1174 1191 } 1175 1192 1176 td p 1193 td p { 1177 1194 margin-bottom: 0; 1178 1195 } 1179 1196 1180 th, td { 1197 th, 1198 td { 1181 1199 width: 50%; 1182 1200 } 1183 1201 1202 .used-by, 1203 .uses { 1204 td.related-title span { 1205 display: block; 1206 color: #666; 1207 } 1208 } 1209 1184 1210 @media (max-width: 43em) { 1185 .related-desc, span { 1211 .related-desc, 1212 span { 1186 1213 display: none; 1187 1214 } 1188 1215 } 1189 }1190 1191 .source-content {1192 overflow: auto;1193 1216 } 1194 1217 … … 1196 1219 margin-left: 2em; 1197 1220 margin-top: 1em; 1198 } 1199 1200 .source-code-links span { 1201 border-left: 1px solid #999; 1202 margin-left: 1em; 1203 padding-left: 1em; 1204 } 1205 1206 .source-code-links span:first-child { 1207 display: none; 1208 border-left: 0; 1209 margin-left: 1em; 1210 padding-left: 0; 1221 1222 span { 1223 border-right: 1px solid #999; 1224 margin-right: 1em; 1225 padding-right: 1em; 1226 1227 &:last-of-type { 1228 border-right: none; 1229 } 1230 } 1211 1231 } 1212 1232 … … 1216 1236 } 1217 1237 1218 .show-complete-source, .less-complete-source { 1238 .show-complete-source, 1239 .less-complete-source { 1219 1240 display: none; 1220 1241 } … … 1225 1246 width: 10%; 1226 1247 } 1248 1227 1249 .changelog-desc { 1228 1250 width: 90%; … … 1230 1252 } 1231 1253 1254 1232 1255 .loop-pagination { 1233 text-align: center; 1234 font-size: 18px; 1235 margin-bottom: 20px; 1256 display: flex; 1257 margin: 3rem 0; 1258 list-style: none; 1259 justify-content: center; 1260 align-items: center; 1261 gap: 0.75rem; 1262 1263 .page-numbers { 1264 display: inline-block; 1265 padding: 1rem 1.25rem; 1266 background: $color-white; 1267 border: 1px solid get-color(gray-5); 1268 border-radius: 2px; 1269 line-height: 1; 1270 text-decoration: none; 1271 1272 &:hover, 1273 &:active { 1274 color: $wp4--link-color--hover; 1275 } 1276 1277 &.current { 1278 border: 1px solid get-color(gray-90); 1279 background: get-color(gray-90); 1280 color: $color-white; 1281 } 1282 1283 &.dots { 1284 border: none; 1285 } 1286 } 1236 1287 } 1237 1288 … … 1241 1292 } 1242 1293 1243 // User contributed notes 1244 .single-wp-parser-function, .single-wp-parser-method, .single-wp-parser-hook, .single-wp-parser-class { 1245 1294 /* User contributed notes*/ 1295 .single-wp-parser-function, 1296 .single-wp-parser-method, 1297 .single-wp-parser-hook, 1298 .single-wp-parser-class { 1246 1299 .bad-note .comment-content { 1247 opacity: .6;1300 opacity: 0.6; 1248 1301 } 1249 1302 … … 1255 1308 .comment-edited { 1256 1309 background-color: #fff8e5; 1257 padding: .2em.5em;1258 margin-right: .5em;1310 padding: 0.2em 0.5em; 1311 margin-right: 0.5em; 1259 1312 border-radius: 3px; 1260 1313 border: 1px solid #ffb900; … … 1292 1345 } 1293 1346 1294 / / Feedback1347 /* Feedback*/ 1295 1348 .comment-list li.depth-2 { 1296 1349 border-top: 1px solid #dfdfdf; … … 1299 1352 1300 1353 .comment-content { 1301 padding: .9em 0; 1302 } 1354 padding: 0.9em 0; 1355 } 1356 1303 1357 .comment-content p { 1304 1358 margin-bottom: 0; 1305 font-size: .9em;1359 font-size: 0.9em; 1306 1360 } 1307 1361 } … … 1328 1382 font-size: 1.8rem; 1329 1383 font-weight: 300; 1330 line-height: 2.2rem;1384 line-height: 1.222; 1331 1385 margin-bottom: 1em; 1332 1386 } … … 1357 1411 } 1358 1412 1359 label[for= comment],1413 label[for="comment"], 1360 1414 .comment-form-comment, 1361 1415 .comment-preview { … … 1364 1418 1365 1419 .js & .comment-form-comment { 1366 padding: 0 .7em.7em;1420 padding: 0 0.7em 0.7em; 1367 1421 } 1368 1422 … … 1381 1435 border: 1px solid #eee; 1382 1436 } 1437 1383 1438 .comment-meta { 1384 padding: .5em 1em;1439 padding: 0.5em 1em; 1385 1440 background-color: #f7f7f7; 1386 1441 overflow: auto; … … 1388 1443 1389 1444 .comment-content { 1390 margin-left: 60px;1391 margin-left: 3.75rem;1392 1445 margin-left: 0; 1393 1446 clear: both; 1394 padding: 2rem 1.5rem .5rem;1447 padding: 2rem 1.5rem 0.5rem; 1395 1448 } 1396 1449 1397 1450 .comment-content ol { 1398 1451 list-style: decimal inside; 1399 margin: 0 0 1.5em 0;1400 border-top: none;1401 1452 margin: 0 0 1.5em 1.5em; 1402 1453 padding: 0; 1454 border-top: none; 1403 1455 } 1404 1456 1405 1457 .comment-content ul { 1406 1458 list-style: square inside; 1407 margin: 0 0 1.5em 0;1408 border-top: none;1409 1459 margin: 0 0 1.5em 1.5em; 1410 1460 padding: 0; 1461 border-top: none; 1411 1462 } 1412 1463 … … 1451 1502 } 1452 1503 1453 .comment-form ul, .feedback-form ul { 1504 .comment-form ul, 1505 .feedback-form ul { 1454 1506 margin-left: 1.5em; 1455 1507 } … … 1508 1560 * 1509 1561 */ 1562 1510 1563 #content-area.has-sidebar { 1511 1564 float: none; 1512 1565 margin: 0 auto; 1513 width: 60em;1566 width: $devhub-wrap-content-width; 1514 1567 } 1515 1568 1516 1569 .has-sidebar { 1517 1518 1570 main { 1519 1571 float: right; … … 1521 1573 margin: 0; 1522 1574 clear: none; 1523 padding: 0 12px;1524 1575 padding: 0 1.2rem; 1525 1576 } 1577 1526 1578 .widget-area { 1527 1579 float: left; 1528 1580 overflow: hidden; 1529 1581 width: 27%; 1530 margin-left: -55px;1531 1582 margin: 0; 1532 1583 clear: none; … … 1545 1596 width: 49%; 1546 1597 display: inline-block; 1598 1547 1599 &[rel="prev"] { 1548 1600 text-align: left; 1549 1601 } 1602 1550 1603 &[rel="next"] { 1551 1604 text-align: right; … … 1561 1614 margin-right: 10px; 1562 1615 } 1563 .user-note-voting-up .dashicons, .user-note-voting-down .dashicons { 1616 1617 .user-note-voting-up .dashicons, 1618 .user-note-voting-down .dashicons { 1564 1619 font-size: 30px; 1565 1620 height: 30px; … … 1567 1622 color: #000; 1568 1623 } 1624 1569 1625 .site-main { 1570 .user-note-voting-down, .user-note-voting-up { 1626 .user-note-voting-down, 1627 .user-note-voting-up { 1571 1628 text-decoration: none; 1572 1629 } 1573 1630 } 1631 1574 1632 .user-note-voting-up { 1575 1633 margin-left: -9px; … … 1584 1642 margin-right: -2px; 1585 1643 } 1644 1586 1645 .user-voted.user-note-voting-up .dashicons { 1587 color: green; 1588 } 1646 color: color(green-50); 1647 } 1648 1589 1649 .user-voted.user-note-voting-down .dashicons { 1590 color: red; 1591 } 1650 color: color(red-50); 1651 } 1652 1592 1653 .user-submitted-note .dashicons { 1593 color: grey; 1594 } 1595 1596 .syntaxhighlighter { 1597 /* These are !important due to use of !important in SyntaxHighlighter Evolved plugin. */ 1598 max-width: 100% !important; 1599 width: inherit !important; 1600 padding-bottom: 0.5rem !important; 1601 } 1602 1603 &.archive, &.blog { 1654 color: color(gray-50); 1655 } 1656 1657 &.archive, 1658 &.blog { 1604 1659 .hentry { 1605 1660 padding: 0 0 1.5em 0; … … 1609 1664 } 1610 1665 1666 /** Fix screen-reader-text font size. **/ 1667 a.screen-reader-text:focus, 1668 .screen-reader-text:focus { 1669 font-size: 1.4rem; 1670 } 1671 1611 1672 /** Site Header **/ 1612 1613 1673 .site-header { 1614 1674 background: #0073aa; 1615 1675 float: none; 1616 margin: 0 0 4em;1676 margin: 0; 1617 1677 padding: 18px 0; 1618 1678 width: auto; 1619 margin: 0; 1620 } 1679 } 1680 1621 1681 .site-branding { 1622 height: 32px;1623 1682 box-sizing: border-box; 1624 1683 margin: 0 auto; 1625 1684 max-width: 960px; 1626 padding: 0 10px;1685 padding: 0 24px; 1627 1686 position: relative; 1628 } 1687 1688 &.has-actions { 1689 display: flex; 1690 justify-content: space-between; 1691 align-items: center; 1692 1693 @media screen and (max-width: 500px) { 1694 flex-direction: column; 1695 } 1696 1697 .site-title { 1698 1699 @media screen and (max-width: 500px) { 1700 margin-bottom: 2rem; 1701 } 1702 1703 a { 1704 font-size: 28px; 1705 } 1706 } 1707 } 1708 } 1709 1629 1710 .site-title { 1630 1711 line-height: 1; 1631 1712 margin: 0; 1632 1713 padding: 0; 1633 font-family: 'Open Sans', sans-serif;1714 font-family: "Open Sans", sans-serif; 1634 1715 display: inline-block; 1635 1716 text-align: left; 1636 color: black;1717 color: #000; 1637 1718 1638 1719 a { … … 1656 1737 } 1657 1738 } 1739 1658 1740 .site-header.home { 1659 padding: 28px 20px; 1660 padding: 2.8rem 2.0rem; 1741 padding: 2.8rem 2rem; 1661 1742 text-align: center; 1662 1743 … … 1668 1749 max-width: none; 1669 1750 font-weight: 300; 1670 margin: 36px 0 11.25px;1671 1751 margin: 3.6rem 0 1.125rem; 1672 1752 text-align: center; … … 1675 1755 1676 1756 a { 1677 font-size: 68.6646px;1678 1757 font-size: 6.86646rem; 1679 1758 … … 1686 1765 1687 1766 .site-description { 1688 color: hsla(0, 0%,100%,.8);1767 color: hsla(0, 0%, 100%, 0.8); 1689 1768 font-size: 2.25rem; 1690 1769 font-weight: 300; … … 1715 1794 display: block; 1716 1795 text-decoration: none; 1717 font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", sans-serif;1796 font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; 1718 1797 font-size: 12.8px; 1719 1798 … … 1755 1834 } 1756 1835 } 1836 1757 1837 .main-navigation { 1758 1838 clear: both; … … 1782 1862 -webkit-appearance: none; 1783 1863 } 1784 .toggled .menu-toggle.dashicons:before { 1864 1865 .toggled .menu-toggle.dashicons::before { 1785 1866 content: "\f343"; 1786 1867 } … … 1790 1871 display: none; 1791 1872 } 1873 1792 1874 .main-navigation { 1793 1875 float: right; … … 1824 1906 1825 1907 /** WP editor link button modal **/ 1826 1827 1908 #wp-link-wrap { 1828 1909 height: 210px !important; … … 1843 1924 1844 1925 /** Handbook **/ 1845 1846 1926 aside[id^="handbook"] .widget-title, 1847 1927 aside[id^="nav_menu"] .widget-title { … … 1864 1944 margin-right: 4%; 1865 1945 } 1946 1866 1947 .handbook-header { 1867 line-height: 2 em;1948 line-height: 2; 1868 1949 1869 1950 h1 { … … 1873 1954 1874 1955 .single-handbook { 1875 font-size: 13px;1876 1956 font-size: 1.3rem; 1877 1957 1878 p, ol, ul { 1958 p, 1959 ol, 1960 ul { 1879 1961 line-height: 1.6; 1880 1962 } 1881 1963 1882 1964 .site-main { 1883 p, ol, ul { 1965 p, 1966 ol, 1967 ul { 1884 1968 font-size: 1.05em; 1885 1969 color: #555; … … 1919 2003 1920 2004 /** Table of Contents */ 1921 1922 .site-main .table-of-contents { 1923 float: right; 1924 width: 250px; 1925 border: 1px solid #eee; 1926 margin: 0 0 15px 15px; 1927 z-index: 1; 1928 position: relative; 1929 color: #555d66; 1930 background-color: #fff; 1931 box-shadow: 0 0 8px rgba(0,0,0,0.1); 1932 border-radius: 3px; 1933 1934 @media (min-width: 971px) { 1935 margin: 0 -30px 15px 15px; 1936 } 1937 1938 h2 { 1939 margin: 0; 1940 padding: 0.7rem 1.2rem; 1941 font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, sans-serif; 1942 font-size: 1.3em; 1943 color: #32373c; 1944 text-transform: uppercase; 1945 border-bottom: 1px solid #eee; 1946 margin-bottom: 0; 2005 .site-main { 2006 .table-of-contents { 2007 display: flex; 2008 flex-direction: column; 2009 min-width: 230px; 2010 border: 1px solid #eee; 2011 margin: 30px 0; 2012 z-index: 1; 2013 position: relative; 2014 color: #555d66; 2015 background-color: #fff; 2016 box-shadow: 0 0 8px rgba(0, 0, 0, 0.1); 2017 border-radius: 3px; 2018 2019 .code-reference & { 2020 float: right; 2021 margin-top: 15px; 2022 margin-left: 15px; 2023 } 2024 2025 h2 { 2026 margin: 0; 2027 padding: 0.7rem 1.2rem; 2028 font-family: HelveticaNeue-Light, "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, sans-serif; 2029 font-size: 1.3em; 2030 color: #32373c; 2031 text-transform: uppercase; 2032 border-bottom: 1px solid #eee; 2033 margin-bottom: 0; 2034 } 2035 2036 .items { 2037 overflow-y: scroll; 2038 } 1947 2039 } 1948 2040 } … … 1964 2056 color: #0073aa; 1965 2057 text-decoration: underline; 1966 } ;2058 } 1967 2059 } 1968 2060 … … 1975 2067 } 1976 2068 1977 /* Highlight current heading and adjust scroll position for fixed toolbar */ 1978 .toc-heading:target { 1979 position: initial; 1980 padding-top: 50px; 1981 margin-top: -50px; 1982 } 1983 1984 /* Remove negative margin because there is no jump link before these headlines */ 1985 .entry-content h2.toc-heading:first-of-type:target, 1986 .entry-content h3.toc-heading:first-of-type:target, 1987 h2.toc-heading + h3.toc-heading:target { 1988 margin-top: 0; 1989 } 1990 1991 .toc-heading:target:before { 1992 content: ''; 1993 position: absolute; 1994 left: -10px; 1995 top: 50px; 1996 border-left: 5px solid #0073aa; 1997 height: 50%; 1998 height: calc(100% - 50px); 1999 } 2000 2001 .toc-jump { 2069 .toc-header { 2070 margin-bottom: 1em; 2071 } 2072 2073 .toc-heading { 2002 2074 position: relative; 2003 height: 50px; 2004 } 2005 2006 .toc-jump:after { 2007 content: ''; 2008 display: table; 2009 clear: both; 2010 } 2011 2012 .toc-jump a { 2013 z-index: 1; 2014 } 2015 2016 @media (max-width: 480px) { 2017 .table-of-contents { 2018 display: none; 2019 } 2075 } 2076 2077 .toc-heading a::before { 2078 color: get-color(gray-30); 2079 } 2080 2081 .toc-heading:target a::before { 2082 color: inherit; 2083 } 2084 2085 .toc-heading a:hover::before, 2086 .toc-heading a:active::before, 2087 .toc-heading a:focus::before { 2088 color: get-color(blue-50); 2020 2089 } 2021 2090 2022 2091 /** Menu */ 2023 2024 2092 #secondary aside.widget_wporg_handbook_pages, 2025 2093 #secondary aside.widget_nav_menu { … … 2032 2100 .widget_nav_menu h1 { 2033 2101 font-size: 1.6em; 2034 font-weight: bold;2102 font-weight: 700; 2035 2103 margin-bottom: 0.6em; 2036 2104 } … … 2042 2110 outline: 0; 2043 2111 } 2112 2044 2113 ul { 2045 2114 margin-left: 0; … … 2067 2136 background-color: #fafafa; 2068 2137 border: 0; 2069 border-left: 1px solid rgba(0, 0,0,0.05);2138 border-left: 1px solid rgba(0, 0, 0, 0.05); 2070 2139 border-radius: 0; 2071 2140 box-shadow: none; … … 2081 2150 &.open > div > .dashicons { 2082 2151 transform: rotate(180deg); 2083 border-right: 1px solid rgba(0, 0,0,0.05);2152 border-right: 1px solid rgba(0, 0, 0, 0.05); 2084 2153 border-left: none; 2085 2154 } … … 2102 2171 background-color: #0073aa; 2103 2172 } 2173 2104 2174 &.active { 2105 2175 color: #555; 2106 2176 background-color: #fff; 2107 font-weight: bold;2177 font-weight: 700; 2108 2178 } 2109 2179 } … … 2113 2183 } 2114 2184 } 2115 & > ul > li { 2185 2186 > ul > li { 2116 2187 &.open > div > a { 2117 2188 &:not(:focus) { 2118 2189 color: #0073aa; 2119 2190 } 2191 2120 2192 &:hover { 2121 2193 color: #fff; … … 2124 2196 } 2125 2197 } 2198 2126 2199 .current-menu-item ul, 2127 2200 .current-menu-ancestor ul { 2128 2201 display: block; 2129 2202 } 2203 2130 2204 .current-menu-ancestor:not(.open) .expandable .dashicons:not(:focus), 2131 2205 .current-menu-item > .expandable .dashicons:not(:focus) { … … 2133 2207 color: #0073aa; 2134 2208 } 2209 2135 2210 .current-menu-ancestor .expandable .dashicons:hover, 2136 2211 .current-menu-item .expandable .dashicons:hover { … … 2138 2213 color: #fff !important; 2139 2214 } 2215 2140 2216 .children, 2141 2217 .sub-menu { … … 2153 2229 position: relative; 2154 2230 } 2231 2155 2232 ul { 2156 2233 margin-left: 12px; … … 2171 2248 2172 2249 #content { 2173 max-width: 960px;2250 max-width: $single-handbook-content-width; 2174 2251 margin: 0 auto; 2175 2252 display: flex; 2176 padding -top: 0;2253 padding: 0 #{"max( 20px, 2% )"}; 2177 2254 } 2178 2255 … … 2194 2271 background: #fff; 2195 2272 box-sizing: border-box; 2196 width: 72%;2197 2198 @media (max-width: 876px) {2273 width: $single-handbook-content-primary-width * 100%; 2274 2275 @media (max-width: 876px) { 2199 2276 padding: 4rem 20px; 2200 2277 width: 100%; … … 2210 2287 top: 10px; 2211 2288 } 2289 2212 2290 .make-welcome { 2213 2291 margin: 0 !important; 2214 2292 } 2215 2293 } 2294 2216 2295 /** Handbook **/ 2217 2218 2296 .rest-api-handbook-reference { 2219 2220 2297 .table-of-contents { 2221 2298 float: none; … … 2229 2306 2230 2307 &::after { 2231 content: '; ';2308 content: "; "; 2232 2309 } 2233 2310 2234 2311 &:last-child::after { 2235 content: '';2312 content: ""; 2236 2313 } 2237 2314 } … … 2241 2318 2242 2319 /* Menu toggle */ 2243 2244 2320 #secondary-toggle { 2245 2321 display: none; 2246 2322 } 2323 2247 2324 body.responsive-show { 2248 2325 position: fixed; … … 2253 2330 overflow-y: scroll; 2254 2331 z-index: 500; 2255 2256 .search-section { 2257 margin-top: 32px; 2258 width: 100%; 2259 } 2260 } 2332 } 2333 2261 2334 #secondary-toggle { 2262 2335 height: 32px; … … 2264 2337 width: 100%; 2265 2338 } 2339 2266 2340 #primary-modal { 2267 2341 display: block; 2268 2342 } 2343 2269 2344 #o2-expand-editor { 2270 2345 display: none; 2271 2346 } 2272 2347 } 2348 2273 2349 @media only screen and (max-width: 782px) { 2274 2350 body.responsive-show { … … 2283 2359 } 2284 2360 } 2361 2285 2362 @media (max-width: 876px) { 2286 2363 #secondary { 2287 2364 position: fixed; 2288 2365 z-index: 10; 2289 bottom: 0 px;2366 bottom: 0; 2290 2367 overflow-y: auto; 2291 transition: all .25s ease;2368 transition: all 0.25s ease; 2292 2369 top: 32px; 2293 2370 left: -100%; … … 2308 2385 z-index: 1; 2309 2386 2310 &: before {2311 content: '\f333';2387 &::before { 2388 content: "\f333"; 2312 2389 -webkit-font-smoothing: antialiased; 2313 font: normal 32px/1 'dashicons';2390 font: 400 32px/1 dashicons; 2314 2391 position: relative; 2315 2392 top: 0; 2316 2393 color: #fff; 2317 2394 } 2395 2318 2396 strong { 2319 2397 display: none; 2320 2398 } 2321 2399 } 2400 2322 2401 #page { 2323 2402 overflow-x: hidden; 2324 2403 } 2404 2325 2405 body.responsive-show { 2326 2406 overflow-y: visible; … … 2330 2410 overflow-x: visible; 2331 2411 } 2332 #secondary-toggle:before { 2412 2413 #secondary-toggle::before { 2333 2414 color: #0073aa; 2334 2415 } … … 2346 2427 2347 2428 @media ( max-width: 59.999999em ) { 2348 2349 2429 .devhub-wrap { 2350 2430 max-width: 100%; … … 2355 2435 padding: 0 13px; 2356 2436 } 2437 2357 2438 #content-area, 2358 2439 .inner-wrap { … … 2362 2443 } 2363 2444 2364 &.archive, &.search { 2445 &.archive, 2446 &.search { 2365 2447 .meta { 2366 2448 font-size: 100%; … … 2373 2455 } 2374 2456 } 2375 2457 } 2458 2459 @media (min-width: 90em) { 2460 .site-main .table-of-contents { 2461 position: fixed; 2462 width: 15vw; 2463 2464 .code-reference & { 2465 margin-left: 0; 2466 left: calc( #{ $devhub-wrap-content-width } + ( ( 100vw - #{ $devhub-wrap-content-width } ) / 2 ) ); 2467 top: $devhub-wrap-toc-position-top; 2468 max-height: calc(90vh - #{ $devhub-wrap-toc-position-top }); 2469 } 2470 2471 // Pages with sidebar 2472 .widget-area + & { 2473 left: calc( #{ $single-handbook-content-width } + ( ( 100vw - #{ $single-handbook-content-width } ) / 2 ) ); 2474 top: $single-handbook-toc-position-top; 2475 max-height: calc(90vh - #{ $single-handbook-toc-position-top }); 2476 } 2477 } 2478 } 2479 2480 @media (min-width: 877px) { 2481 // Pages which are not code reference and without a sidebar 2482 .site-main .table-of-contents:not(.code-reference .site-main .table-of-contents):not(.widget-area + .site-main .table-of-contents) { 2483 position: fixed; 2484 width: 15vw; 2485 top: $single-handbook-toc-position-top; 2486 left: calc( 2487 #{ $single-handbook-content-width } * #{ $single-handbook-content-primary-width } 2488 + ( ( 100vw - #{ $single-handbook-content-width } ) / 2 ) 2489 + 15px 2490 ); 2491 max-height: calc(90vh - #{ $single-handbook-toc-position-top }); 2492 } 2376 2493 } 2377 2494 2378 2495 @media ( min-width: 43em ) { 2379 2496 .devhub-wrap { 2380 &.archive, &.search { 2497 &.archive, 2498 &.search { 2381 2499 .meta { 2382 2500 float: right; … … 2390 2508 } 2391 2509 2510 // Matches global header breakpoint 2511 @media ( max-width: 889px ) { 2512 .code-reference .site-main .table-of-contents { 2513 float: none; 2514 margin-left: 0; 2515 width: 100%; 2516 } 2517 } 2518 2392 2519 @media ( max-width: 43em ) { 2393 2394 2520 #content-area.has-sidebar { 2395 2396 2521 main { 2397 2522 float: right; … … 2399 2524 margin: 0 auto; 2400 2525 clear: both; 2401 padding: 0 12px;2402 2526 padding: 0 1.2rem; 2403 2527 } 2528 2404 2529 .widget-area { 2405 2530 float: none; … … 2427 2552 display: block; 2428 2553 } 2554 2429 2555 .reference-landing .section .box, 2430 2556 .sidebar .box { … … 2432 2558 margin-bottom: 1.5em; 2433 2559 } 2560 2434 2561 .home-primary-content .entry-content, 2435 2562 .reference-landing .section { … … 2446 2573 2447 2574 .horizontal-list li:first-child a { 2448 padding: 0 40px;2449 2575 padding: 0 4rem; 2450 2576 } 2451 2577 2452 .reference-landing .searchform { 2453 text-align: center; 2454 } 2455 2456 .reference-landing .searchform input[type="text"], 2457 .reference-landing .searchform input[type="submit"] { 2458 width: 100%; 2459 margin-right: 0; 2460 margin-bottom: 1em; 2461 float: none; 2462 clear: both; 2463 } 2464 2465 .wp-parser-class, .wp-parser-function, .wp-parser-hook, .wp-parser-method { 2578 .wp-parser-class, 2579 .wp-parser-function, 2580 .wp-parser-hook, 2581 .wp-parser-method { 2466 2582 h1 { 2467 2583 padding-left: 45px; … … 2478 2594 @media (max-width: 32em) { 2479 2595