• Resolved damanic

    (@damanic)


    With the following code I get results when taxonomy images plugin disabled, but not when plugin is enabled.

    If apply_filters( ‘taxonomy-images-get-terms’) is just a wrapper for get_terms() and the exact same arguments are being passed, why does get_terms() return a set of results and ‘taxonomy-images-get-terms’ return an empty array?

    $args = array(
            'orderby'           => 'name',
            'order'             => 'ASC',
            'hide_empty'        => false,
            'fields'            => 'all',
            'parent'            => 0,
            'hierarchical'      => true);
    
        $plugin_args = array(
            'term_args' => $args,
            'taxonomy' => 'service_category',
            'having_images' => false
        );
    
        $plugin = 'taxonomy-images/taxonomy-images.php';
        if(is_plugin_active($plugin)){
    		return apply_filters( 'taxonomy-images-get-terms', '', $plugin_args );
        }
        return get_terms(array('service_category'), $args);

    https://www.ads-software.com/plugins/taxonomy-images/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter damanic

    (@damanic)

    Resolved. New install did not have the taxonomy images enabled for the service_category.

    Thread Starter damanic

    (@damanic)

    updated to fallback

    $args = array(
            'orderby'           => 'name',
            'order'             => 'ASC',
            'hide_empty'        => false,
            'fields'            => 'all',
            'parent'            => 0,
            'hierarchical'      => true);
    
        $plugin_args = array(
            'term_args' => $args,
            'taxonomy' => 'service_category',
            'having_images' => false
        );
    
        $plugin = 'taxonomy-images/taxonomy-images.php';
        if(is_plugin_active($plugin)){
    		$terms = apply_filters( 'taxonomy-images-get-terms', '', $plugin_args );
    		if(!empty($terms)){
    			return $terms;
    		}
        }
        return get_terms(array('service_category'), $args);

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Issue with taxonomy-images-get-terms’ is closed to new replies.