Noptin_Automation_Rules_Table::prepare_query()
Prepares the display query
Source Source
File: includes/automation-rules/class-noptin-automation-rules-table.php
public function prepare_query() { global $wpdb; $table = noptin()->automation_rules->get_table(); $paged = empty( $_GET['paged'] ) ? 1 : (int) $_GET['paged']; $offset = ( $paged - 1 ) * 10; $this->items = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $table ORDER BY created_at DESC LIMIT %d,10", $offset ) ); $this->total = $wpdb->get_var( "SELECT COUNT(`id`) FROM $table" ); }
Expand full source code Collapse full source code View on GitHub