PluginProbe
Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts / 2.2.7
Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts v2.2.7
2.7.7 2.7.6 2.7.5 2.7.4 trunk 1.3 2.0.4 2.0.6 2.1.91 2.2.4 2.2.7 2.2.9 2.3.1 2.3.10 2.4.10 2.4.2 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 2.4.9 2.6.0 2.6.1 2.7.0 All 28 releases
← All changes | includes/class.execute.snippet.php +6 -16 2.2.92.2.7 View file →
@@ -300,15 +300,11 @@
300 300 global $wpdb;
301 301
302 302 $snippets = $wpdb->get_results( "SELECT {$wpdb->posts}.ID, {$wpdb->posts}.post_content
303 303 FROM {$wpdb->posts}
304 - INNER JOIN {$wpdb->postmeta} ON ({$wpdb->posts}.ID = {$wpdb->postmeta}.post_id)
305 - WHERE (( {$wpdb->postmeta}.meta_key = '" . WINP_Plugin::app()->getPrefix() . "snippet_scope'
306 - AND {$wpdb->postmeta}.meta_value = '{$scope}'))
307 - AND {$wpdb->posts}.post_type = '" . WINP_SNIPPETS_POST_TYPE . "'
308 - AND (({$wpdb->posts}.post_status = 'publish'))" );
304 + INNER JOIN {$wpdb->postmeta} ON ( {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id )
305 + WHERE ( ( {$wpdb->postmeta}.meta_key = '" . WINP_Plugin::app()->getPrefix() . "snippet_scope' AND {$wpdb->postmeta}.meta_value = '{$scope}' ) ) AND {$wpdb->posts}.post_type = '" . WINP_SNIPPETS_POST_TYPE . "' AND ( ({$wpdb->posts}.post_status = 'publish') )" );
309 306
310 -
311 307 if ( empty( $snippets ) ) {
312 308 return $content;
313 309 }
314 310
@@ -935,11 +931,8 @@
935 931
936 932 /**
937 933 * A taxonomy of the current page
938 934 *
939 - * @since 2.2.8 The bug is fixed, the condition was not checked
940 - * for tachonomies, only posts.
941 - *
942 935 * @param $operator
943 936 * @param $value
944 937 *
945 938 * @return boolean
@@ -944,16 +937,13 @@
944 937 *
945 938 * @return boolean
946 939 */
947 940 private function location_taxonomy( $operator, $value ) {
948 - $term_id = null;
941 + global $post;
949 942
950 - if ( is_tax() || is_tag() || is_category() ) {
951 - $term_id = get_queried_object()->term_id;
952 -
953 - if ( $term_id ) {
954 - return $this->checkByOperator( $operator, intval( $value ), $term_id );
955 - }
943 + $post_cat = get_the_category( $post->ID );
944 + if ( isset( $post_cat[0] ) ) {
945 + return $this->checkByOperator( $operator, intval( $value ), $post_cat[0]->term_id );
956 946 }
957 947
958 948 return false;
959 949 }