Home Forums Plugin Support WP User Frontend Pro Limit Parent Categories Displayed

This topic is: not resolved

This topic contains 3 replies, has 2 voices, and was last updated by  towhid 4 years, 4 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #36913

    Beatrice
    Member
    Post count: 9

    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?

    #37001

    towhid
    Participant
    Post count: 4505

    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 ๐Ÿ™‚

    #37099

    towhid
    Participant
    Post count: 4505

    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 ๐Ÿ™‚

    #37745

    towhid
    Participant
    Post count: 4505

    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 4 posts - 1 through 4 (of 4 total)

The topic ‘Limit Parent Categories Displayed’ is closed to new replies.