Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
Logs_List_Table::get_action_query()
Prepare query for actions
Return Return
(string) query
Source Source
File: src/core/admin/class-logs-list-table.php
private function get_action_query() { global $wpdb; $view_exists = Automator_DB::is_view_exists( 'action' ); $search_conditions = ' 1=1 '; if ( automator_filter_has_var( 'search_key' ) && '' !== automator_filter_input( 'search_key' ) ) { $search_key = sanitize_text_field( automator_filter_input( 'search_key' ) ); if ( $view_exists ) { $search_conditions .= " AND ( (recipe_title LIKE '%$search_key%') OR (action_title LIKE '%$search_key%') OR (display_name LIKE '%$search_key%' ) OR (user_email LIKE '%$search_key%' ) OR (error_message LIKE '%$search_key%' ) ) "; } else { $search_conditions .= " AND ( (p.post_title LIKE '%$search_key%') OR (pa.post_title LIKE '%$search_key%') OR (u.display_name LIKE '%$search_key%' ) OR (u.user_email LIKE '%$search_key%' ) OR (a.error_message LIKE '%$search_key%' ) ) "; } } if ( automator_filter_has_var( 'recipe_id' ) && '' !== automator_filter_input( 'recipe_id' ) ) { if ( $view_exists ) { $search_conditions .= " AND automator_recipe_id = '" . absint( automator_filter_input( 'recipe_id' ) ) . "' "; } else { $search_conditions .= " AND a.automator_recipe_id = '" . absint( automator_filter_input( 'recipe_id' ) ) . "' "; } } if ( automator_filter_has_var( 'run_number' ) && '' !== automator_filter_input( 'run_number' ) ) { if ( $view_exists ) { $search_conditions .= " AND recipe_run_number = '" . absint( automator_filter_input( 'run_number' ) ) . "' "; } else { $search_conditions .= " AND r.run_number = '" . absint( automator_filter_input( 'run_number' ) ) . "' "; } } if ( automator_filter_has_var( 'user_id' ) && '' !== automator_filter_input( 'user_id' ) ) { if ( $view_exists ) { $search_conditions .= " AND user_id = '" . absint( automator_filter_input( 'user_id' ) ) . "' "; } else { $search_conditions .= " AND u.ID = '" . absint( automator_filter_input( 'user_id' ) ) . "' "; } } if ( $view_exists ) { return "SELECT * FROM {$wpdb->prefix}uap_action_logs_view WHERE ($search_conditions)"; } else { $sql = Automator_DB::action_log_view_query( false ); return "$sql WHERE ($search_conditions) GROUP BY a.ID"; } }
Expand full source code Collapse full source code View on Github