Changeset 785 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php
- Timestamp:
- 08/12/2014 06:37:14 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php
r781 r785 331 331 332 332 /** 333 * Get site section from url path 333 * Get site section root URL based on URL path. 334 * 335 * @return string 336 */ 337 function get_site_section_url() { 338 $parts = explode( '/', $_SERVER['REQUEST_URI'] ); 339 switch ( $parts[1] ) { 340 case 'reference': 341 case 'plugin': 342 case 'theme': 343 return home_url( '/' . $parts[1] . '/' ); 344 default: 345 return home_url( '/' ); 346 } 347 } 348 349 /** 350 * Get site section title based on URL path. 334 351 * 335 352 * @return string 336 353 */ 337 354 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 346 355 $parts = explode( '/', $_SERVER['REQUEST_URI'] ); 347 356 switch ( $parts[1] ) { 348 357 case 'reference': 349 358 return __( 'Code Reference', 'wporg' ); 359 case 'plugin': 360 return __( 'Plugin Handbook', 'wporg' ); 361 case 'theme': 362 return __( 'Theme Handbook', 'wporg' ); 350 363 default: 351 364 return __( 'Developer Resources', 'wporg' );
Note: See TracChangeset
for help on using the changeset viewer.