• Resolved Sahar

    (@saharusa)


    Adding an image to sub category and after that adding an image to parent category cusses get_terms to return only parent categories on both admin and front end.

    For example,
    Let’s say I have a parent category with ID=2 with 2 sub categories and I try this:

    $taxonomies = array(
    	'category'
    );
    $args = array(
    	'child_of' => 2
    );
    $categories = get_terms($taxonomies, $args);

    I’ll end up with empty array.

    http://ww.wp.xz.cn/plugins/categories-images/

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

    (@saharusa)

    Seems like you need to clean the terms cache

    Calling this once do the job, but it isn’t working from within the plugins code

    $taxnomy_name = 'category';
    clean_term_cache ( _get_term_hierarchy($taxnomy_name), $taxnomy_name);
    Plugin Author Zahlan

    (@elzahlan)

    Sorry for the late reply, let me check that and reply back to you.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Can't get child terms’ is closed to new replies.