Posted: March 6, 2015 at 8:46 am
|
This is probably an incredibly stupid question, but I need to change the default number of database entries that are displayed from ’50’ to ‘500’ but I have no idea what file to look in to fix this. Our client wants all of their attendees and events displayed when they view the page. They don’t want to have to keep using pagination to see them and the ‘Retrieve’ function is not the answer for them. Best, |
Hi Andy, Which version number of Event Espresso are you using? |
|
|
Hi! Sorry for omitting that. It’s version 3.1.37.0.P. |
No problem 🙂 The reason the ‘Retrieve’ filter was added was to prevent timeouts when the server is accessing so much information, changing the default from 50 to 500 will very likely cause those timeouts. I highly recommend again doing this and we can not support issue from increasing this default, however the file you need to edit is: \event-espresso\includes\event-management\queries.php On line 19 you’ll find: $max_rows = isset($_REQUEST['max_rows']) & !empty($_REQUEST['max_rows']) ? absint($_REQUEST['max_rows']) : 50; 50 is the default value. You’ll need to make this change on each update to Event Espresso. |
|
|
I just changed the default variable and it didn’t work. Is there something I’m missing? |
That value changes how many rows for the table are called in by the query, if you notice on the bottom left of the table you’ll see the total number now matches the value you input – http://take.ms/XnTTv Is it the pagination that hasn’t changed? We use the dataTables jQuery plugin to display the tables which should store the value you set in the dropdown within the cache, this will be used across the tables until the cache expires, this value – http://take.ms/IUZFF |
|
|
Hey Tony! Yeah, the dataTables jQuery plugin is what needs modified. I need it to pull in ALL records. Not just the first 100 in the database. The default is set at 50 and I need all of them to display. If this is not possible, let me know. Best, |
Hi Andy, That resource file is loaded through the WP dashboard (WP-admin): wp_enqueue_script('dataTables', EVENT_ESPRESSO_PLUGINFULLURL . 'scripts/jquery.dataTables.min.js', array('jquery')); //Events core table script You could dequeue the existing resource and then load one from a custom location such as this: /wp-content/uploads/espresso/js/ The js folder above would need to be created and then you could add a modified copy of the dataTables file there. http://codex.wordpress.org/Function_Reference/wp_dequeue_script — |
|
The support post ‘Change default number of database entries’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.