Limit Parent Categories Displayed

This topic contains 3 reply and 2 voices, and was last updated by towhid 9 years, 1 month ago
Viewing 3 Posts - 1 through 3 (of 3 total)
Author Posts
February 17, 2015 at 11:19 am 36913
towhid I am trying to limit categories to certain parent categories on the form but all the parent categories are showing up. There are my settings in form edit: Type: Ajax Selection Type: Child of Selection Terms: 65,178,39 I would expect only 3 parent categories to disply (the IDs as above) but all the parent categories, 8 of them in total, are showing. How can I only show certain parent categories and not others?
February 18, 2015 at 3:17 pm 37001
towhid towhid

Hello Beatrice,

I will first try to reproduce this issue then let you know the result. Hope I will be come back with a right solution very soon.

Thank You 🙂

February 19, 2015 at 12:51 pm 37099
towhid towhid

Hello Beatrice,

I have reproduced this issue and found the bug. I have already forwarded this issue to our developer team. Hope I will be come back to you with a right solution very soon.

Thank You 🙂

February 26, 2015 at 6:34 pm 37745
towhid towhid

Hello Beatrice,

Please open plugins/wp-user-frontend/class/render-form.php and find out below code

$select = wp_dropdown_categories( array(

            'show_option_none' => __( '-- Select --', 'wpuf' ),
            'hierarchical'     => 1,
            'hide_empty'       => 0,
            'orderby'          => isset( $attr['orderby'] ) ? $attr['orderby'] : 'name',
            'order'            => isset( $attr['order'] ) ? $attr['order'] : 'ASC',
            'name'             => $taxonomy . '[]',
            //'id'               => 'cat-ajax',
            'taxonomy'         => $taxonomy,
            'echo'             => 0,
            'title_li'         => '',
            'class'            => 'cat-ajax '. $taxonomy . $class,
            $exclude_type      => $exclude,
            'selected'         => $selected,
            'depth'            => 1,
            'child_of'         => isset( $attr['parent_cat'] ) ? $attr['parent_cat'] : ''
        ) );

and replace with

$select = wp_dropdown_categories( array(

            'show_option_none' => __( '-- Select --', 'wpuf' ),
            'hierarchical'     => 1,
            'hide_empty'       => 0,
            'orderby'          => isset( $attr['orderby'] ) ? $attr['orderby'] : 'name',
            'order'            => isset( $attr['order'] ) ? $attr['order'] : 'ASC',
            'name'             => $taxonomy . '[]',
            //'id'               => 'cat-ajax',
            'taxonomy'         => $taxonomy,
            'echo'             => 0,
            'title_li'         => '',
            'class'            => 'cat-ajax '. $taxonomy . $class,
            $exclude_type      => $exclude,
            'selected'         => $selected,
            'depth'            => 1,
            //'child_of'         => isset( $attr['parent_cat'] ) ? $attr['parent_cat'] : ''
        ) );

Hope it will solve your problem.

Thank You 🙂

Viewing 3 Posts - 1 through 3 (of 3 total)