Open jonathanstegall opened 6 years ago
I have a field that should theoretically allow unlimited posts to be attached to it, but I think adding -1 as the limit attribute gets ignored.
Here's an example when I put a limit of 50.
Code:
$newsletter_top_posts->add_field( array( 'name' => __( 'Top Stories' ), 'desc' => __( 'Search for a post here', ), 'id' => 'top_posts', 'type' => 'post_search_ajax', 'sortable' => true, 'limit' => 50, 'query_args' => array( 'orderby' => 'modified', 'order' => 'DESC', 'date_query' => array( array( 'column' => 'post_modified', 'after' => 2018-07-23 11:45:25, ), ), ), ) );
Screenshot:
Code when I use -1 instead:
$newsletter_top_posts->add_field( array( 'name' => __( 'Top Stories' ), 'desc' => __( 'Search for a post here', ), 'id' => 'top_posts', 'type' => 'post_search_ajax', 'sortable' => true, 'limit' => -1, 'query_args' => array( 'orderby' => 'modified', 'order' => 'DESC', 'date_query' => array( array( 'column' => 'post_modified', 'after' => 2018-07-23 11:45:25, ), ), ), ) );
So it uses the first item and then doesn't let me add any additional ones. Is this a bug, or am I missing how this ought to work?
Just noticed this issue, would be great to get this merged!
I have a field that should theoretically allow unlimited posts to be attached to it, but I think adding -1 as the limit attribute gets ignored.
Here's an example when I put a limit of 50.
Code:
Screenshot:
Code when I use -1 instead:
Screenshot:
So it uses the first item and then doesn't let me add any additional ones. Is this a bug, or am I missing how this ought to work?