Changeset 7319 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/handbooks.php
- Timestamp:
- 06/19/2018 09:44:33 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/handbooks.php
r5681 r7319 63 63 */ 64 64 public static function add_query_vars( $public_query_vars ) { 65 $public_query_vars['is_handbook'] = false; 66 $public_query_vars['current_handbook'] = false; 67 $public_query_vars['current_handbook_home_url'] = false; 68 $public_query_vars['current_handbook_name'] = ''; 65 $public_query_vars[] = 'current_handbook'; 66 $public_query_vars[] = 'current_handbook_home_url'; 67 $public_query_vars[] = 'current_handbook_name'; 69 68 70 69 return $public_query_vars; … … 77 76 */ 78 77 public static function pre_get_posts( $query ) { 79 $is_handbook = function_exists( 'wporg_is_handbook' ) ? wporg_is_handbook() : false; 80 $query->set( 'is_handbook', $is_handbook ); 81 82 $current_handbook = function_exists( 'wporg_get_current_handbook' ) ? wporg_get_current_handbook() : false; 78 $query->is_handbook = function_exists( 'wporg_is_handbook' ) && wporg_is_handbook(); 79 80 $current_handbook = function_exists( 'wporg_get_current_handbook' ) ? (string) wporg_get_current_handbook() : ''; 83 81 $query->set( 'current_handbook', $current_handbook ); 84 82 85 $current_handbook_home_url = function_exists( 'wporg_get_current_handbook_home_url' ) ? wporg_get_current_handbook_home_url() : false;83 $current_handbook_home_url = function_exists( 'wporg_get_current_handbook_home_url' ) ? (string) wporg_get_current_handbook_home_url() : ''; 86 84 $query->set( 'current_handbook_home_url', $current_handbook_home_url ); 87 85 88 $current_handbook_name = function_exists( 'wporg_get_current_handbook_name' ) ? wporg_get_current_handbook_name() : '';86 $current_handbook_name = function_exists( 'wporg_get_current_handbook_name' ) ? (string) wporg_get_current_handbook_name() : ''; 89 87 $query->set( 'current_handbook_name', $current_handbook_name ); 90 88 }
Note: See TracChangeset
for help on using the changeset viewer.