Changeset 1295
- Timestamp:
- 02/23/2015 11:42:33 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wc-post-types/wc-post-types.php
r1292 r1295 1059 1059 1060 1060 /** 1061 * Determine if the current loop is just a single page, or a loop of posts within a page 1062 * 1063 * For example, this helps to target a single wcb_speaker post vs a page containing the [speakers] shortcode, 1064 * which loops through wcb_speaker posts. Using functions like is_single() don't work, because they reference 1065 * the main query instead of the $speakers query. 1066 * 1067 * @param string $post_type 1068 * 1069 * @return bool 1070 */ 1071 protected function is_single_cpt_post( $post_type ) { 1072 global $wp_query; 1073 1074 return isset( $wp_query->query[ $post_type ] ) && $post_type == $wp_query->query['post_type']; 1075 } 1076 1077 /** 1061 1078 * Add the speaker's avatar to their post 1062 1079 * … … 1072 1089 $enabled_site_ids = apply_filters( 'wcpt_speaker_post_avatar_enabled_site_ids', array( 364 ) ); // 2014.sf 1073 1090 1074 if ( 'wcb_speaker' !== $post->post_type) {1091 if ( ! $this->is_single_cpt_post( 'wcb_speaker') ) { 1075 1092 return $content; 1076 1093 } … … 1100 1117 $enabled_site_ids = apply_filters( 'wcpt_session_post_speaker_info_enabled_site_ids', array( 364 ) ); // 2014.sf 1101 1118 1102 if ( 'wcb_session' !== $post->post_type) {1119 if ( ! $this->is_single_cpt_post( 'wcb_session') ) { 1103 1120 return $content; 1104 1121 } … … 1165 1182 $enabled_site_ids = apply_filters( 'wcpt_speaker_post_session_info_enabled_site_ids', array( 364 ) ); // 2014.sf 1166 1183 1167 if ( 'wcb_speaker' !== $post->post_type) {1184 if ( ! $this->is_single_cpt_post( 'wcb_speaker') ) { 1168 1185 return $content; 1169 1186 }
Note: See TracChangeset
for help on using the changeset viewer.