select_all_none Not Working Perfectly

Support General select_all_none Not Working Perfectly

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #17961
    Kiran ModakKiran Modak
    Participant

    Hi,

    Here My Code,

    
    array(
        'id' => $prefix . 'name',
        'name' => esc_html__( 'All Names', 'text-domain' ),
        'type' => 'post',
        'multiple' => true,
        'post_type' => array( 'names' ),             
        'select_all_none' => true, 
        'field_type' => 'select'
    ),
    
    Problem is, there are 16 name in names post type. but only 10 will be selected when i click Select All.
    
    Thanks.
    
    #17993
    Anh TranAnh Tran
    Keymaster

    Hi Kiran,

    The post field loads posts via Ajax, and each call loads 10 posts by default. If you want to load all posts (so the Select All/None button work with all of them), please change the code to:

    array(
        'id' => $prefix . 'name',
        'name' => esc_html__( 'All Names', 'text-domain' ),
        'type' => 'post',
        'multiple' => true,
        'post_type' => array( 'names' ),             
        'select_all_none' => true, 
        'field_type' => 'select',
        'query_args' => ['posts_per_page' => -1'],
        'ajax' => false,
    ),
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.