Changeset 773
- Timestamp:
- 07/30/2014 10:08:42 PM (11 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/functions.php
r771 r773 49 49 add_action( 'pre_get_posts', __NAMESPACE__ . '\\pre_get_posts' ); 50 50 add_action( 'template_redirect', __NAMESPACE__ . '\\redirect_single_search_match' ); 51 add_action( 'template_redirect', __NAMESPACE__ . '\\redirect_handbook' ); 51 52 add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\\theme_scripts_styles' ); 52 53 add_filter( 'post_type_link', __NAMESPACE__ . '\\method_permalink', 10, 2 ); … … 63 64 64 65 add_filter( 'breadcrumb_trail_items', __NAMESPACE__ . '\\breadcrumb_trail_items', 10, 2 ); 66 add_filter( 'breadcrumb_trail_items', __NAMESPACE__ . '\\breadcrumb_trail_remove_handbook', 10, 2 ); 65 67 66 68 treat_comments_as_examples(); … … 94 96 // Unset the last element since it shifted up in trail hierarchy 95 97 unset( $items[4] ); 98 99 return $items; 100 } 101 102 /** 103 * Removes the 'Handbook' segment of the breakcrumb, when present. 104 * 105 * There is no handbook page or listing at present. 106 * 107 * @param array $items The breadcrumb trail items 108 * @param array $args Original arg 109 * @return array 110 */ 111 function breadcrumb_trail_remove_handbook( $items, $args ) { 112 if ( false !== strpos( $items[1], '>Handbook</a>' ) ) { 113 array_splice( $items, 1, 1 ); 114 } 96 115 97 116 return $items; … … 474 493 475 494 /** 495 * Redirects a naked handbook request to home. 496 */ 497 function redirect_handbook() { 498 if ( 'handbook' == get_query_var( 'name' ) && ! get_query_var( 'post_type ' ) ) { 499 wp_redirect( home_url() ); 500 exit(); 501 } 502 } 503 504 /** 476 505 * Makes phpDoc @link references clickable. 477 506 * -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php
r771 r773 336 336 */ 337 337 function get_site_section_title() { 338 if ( is_post_type_archive( array( 'plugin-handbook' ) ) ) { 339 return __( 'Plugin Handbook', 'wporg' ); 340 } 341 342 if ( is_post_type_archive( array ( 'theme-handbook' ) ) ) { 343 return __( 'Theme Handbook', 'wporg' ); 344 } 345 338 346 $parts = explode( '/', $_SERVER['REQUEST_URI'] ); 339 347 switch ( $parts[1] ) { 340 348 case 'reference': 341 return 'Code Reference'; 342 case 'theme-handbook': 343 return 'Theme Handbook'; 344 case 'plugin-handbook': 345 return 'Plugin Handbook'; 349 return __( 'Code Reference', 'wporg' ); 346 350 default: 347 return 'Developer Resources';351 return __( 'Developer Resources', 'wporg' ); 348 352 } 349 353 } -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/page-home-landing.php
r554 r773 9 9 10 10 // Temporarily redirect to reference until other section become live, justifying a main landing page. 11 wp_redirect( get_permalink( get_page_by_path( 'reference' ) ) ); 12 exit(); 11 if ( ! is_user_member_of_blog() ) { 12 wp_redirect( get_permalink( get_page_by_path( 'reference' ) ) ); 13 exit(); 14 } 13 15 14 16 get_header(); ?> … … 23 25 <h3 class="widget-title"><div class="dashicons dashicons-welcome-widgets-menus"></div><?php _e( 'Themes', 'wporg' ); ?></h3> 24 26 <p class="widget-description"><?php _e( 'Want to know all there is to know about theming and WordPress?', 'wporg' ); ?></p> 25 <a href=" #" class="themes-go get-started go button"><?php _e( 'Develop Themes ', 'wporg' ); ?><span class="dashicons dashicons-arrow-right-alt2"></span></a>27 <a href="<?php esc_attr_e( get_post_type_archive_link( 'theme-handbook' ) ); ?>" class="themes-go get-started go button"><?php _e( 'Develop Themes ', 'wporg' ); ?><span class="dashicons dashicons-arrow-right-alt2"></span></a> 26 28 </div> 27 29 <div class="widget box box-right transparent"> 28 30 <h3 class="widget-title"><div class="dashicons dashicons-admin-plugins"></div><?php _e( 'Plugins', 'wporg' ); ?></h3> 29 31 <p class="widget-description"><?php _e( 'Ready to dive deep into the world of plugin authoring?', 'wporg' ); ?></p> 30 <a href=" #" class="plugins-go get-started go button"><?php _e( 'Develop Plugins ', 'wporg' ); ?><span class="dashicons dashicons-arrow-right-alt2"></span></a>32 <a href="<?php esc_attr_e( get_post_type_archive_link( 'plugin-handbook' ) ); ?>" class="plugins-go get-started go button"><?php _e( 'Develop Plugins ', 'wporg' ); ?><span class="dashicons dashicons-arrow-right-alt2"></span></a> 31 33 </div> 32 34 </div> … … 47 49 </div><!-- /new-in-guide --> 48 50 49 51 <?php /* 50 52 <main id="main" class="site-main section" role="main"> 51 53 … … 72 74 73 75 </main><!-- #main --> 74 76 */ ?> 75 77 76 78 <div class="search-guide section light-gray clear">
Note: See TracChangeset
for help on using the changeset viewer.