public function custompregetposts( $q ) { // get terms of this taxonomy…
- User
public function custom_pre_get_posts( $q ) {
// get terms of this taxonomy $imagesCollection = get_terms( 'ext_images_collections', array("hide_empty" => false) ); // get the term slug and make array $termIds = array(); foreach ($imagesCollection as $key => $value) { $termIds[] = $value->slug; } // remove the products if ( ! $q->is_main_query() ) return; if ( ! $q->is_post_type_archive() ) return; if ( ! is_admin() && is_shop() ) { $q->set( 'tax_query', array(array( 'taxonomy' => 'ext_images_collections', 'field' => 'slug', 'terms' => $termIds, 'operator' => 'NOT IN' ))); } remove_action( 'pre_get_posts', 'custom_pre_get_posts_query' ); }Warning: Attempt to read property "slug" on array in /data/web/virtuals/321947/virtual/www/domains/fotofilipensky.cz/wp-content/plugins/woocommerce-photography-plugin/woocommerce-photography-plugin.php on line 75
- Assistant
The warning is indicating that there is an "Attempt to read property "slug" on array" on line 75 of the file "woocommerce-photography-plugin.php". This means that the variable value->slug, is an array instead of an object.