• The File in template/admin/post-carousel.php get all posts in a function:

    $this->form->posts_list( … )

    How can stop this element?, actually comment this line because is to slow get it more than 10,000+ posts by the way sometimes my browser stoped

Viewing 1 replies (of 1 total)
  • Thread Starter jonathan.perez

    (@jonathanperez)

    Another solution can be optimize code:

    File: includes/class-carousel-slider-form.php

    
    $posts = get_posts( array(
       'post_type'      => $post_type,
       'post_status'    => 'publish',
       'posts_per_page' => - 1,
       'fields' => 'ids'
    ) );
    foreach ( $posts as $postID ) {
       $selected = in_array( $postID, $value ) ? ' selected="selected"' : '';
       echo '<option value="' . $postID . '" ' . $selected . '>' . get_the_title($postID) . '</option>';
    
    }
    
    
Viewing 1 replies (of 1 total)
  • The topic ‘Prevent load ALL POSTS on admin page’ is closed to new replies.