\n <\/td>\n | <?php<\/span><\/td>\n <\/tr>\n \n <\/td>\n | public<\/span> function<\/span> prepare_items<\/span>() {<\/td>\n <\/tr>\n \n <\/td>\n | \n<\/td>\n <\/tr>\n | \n <\/td>\n | // check if a search was performed.<\/span><\/td>\n <\/tr>\n \n <\/td>\n | \$<\/span>user_search_key<\/span> = isset( \$<\/span>_REQUEST<\/span><\/span>['s'<\/span>] ) ? wp_unslash( trim( \$<\/span>_REQUEST<\/span><\/span>['s'<\/span>] ) ) : ''<\/span>;<\/td>\n <\/tr>\n \n <\/td>\n | <\/td>\n <\/tr>\n | \n <\/td>\n | \$<\/span>this<\/span><\/span>->_column_headers<\/span> = \$<\/span>this<\/span><\/span>->get_column_info<\/span>();<\/td>\n <\/tr>\n \n <\/td>\n | <\/td>\n <\/tr>\n | \n <\/td>\n | // check and process any actions such as bulk actions.<\/span><\/td>\n <\/tr>\n \n <\/td>\n | \$<\/span>this<\/span><\/span>->handle_table_actions<\/span>();<\/td>\n <\/tr>\n \n <\/td>\n | \n<\/td>\n <\/tr>\n | \n <\/td>\n | // fetch the table data<\/span><\/td>\n <\/tr>\n \n <\/td>\n | \$<\/span>table_data<\/span> = \$<\/span>this<\/span><\/span>->fetch_table_data<\/span>();<\/td>\n <\/tr>\n \n <\/td>\n | // filter the data in case of a search<\/span><\/td>\n <\/tr>\n \n <\/td>\n | if<\/span>( \$<\/span>user_search_key<\/span> ) {<\/td>\n <\/tr>\n \n <\/td>\n | \$<\/span>table_data<\/span> = \$<\/span>this<\/span><\/span>->filter_table_data<\/span>( \$<\/span>table_data<\/span>, \$<\/span>user_search_key<\/span> );<\/td>\n <\/tr>\n \n <\/td>\n | } <\/td>\n <\/tr>\n | \n <\/td>\n | // rest of the code<\/span><\/td>\n <\/tr>\n \n <\/td>\n | }<\/td>\n <\/tr>\n | \n <\/td>\n | \n<\/td>\n <\/tr>\n | \n <\/td>\n | // filter the table data based on the search key<\/span><\/td>\n <\/tr>\n \n <\/td>\n | public<\/span> function<\/span> filter_table_data<\/span>( \$<\/span>table_data<\/span>, \$<\/span>search_key<\/span> ) {<\/td>\n <\/tr>\n \n <\/td>\n | \$<\/span>filtered_table_data<\/span> = array_values( array_filter( \$<\/span>table_data<\/span>, function<\/span>( \$<\/span>row<\/span> ) use<\/span>( \$<\/span>search_key<\/span> ) {<\/td>\n <\/tr>\n \n <\/td>\n | foreach<\/span>( \$<\/span>row<\/span> as<\/span> \$<\/span>row_val<\/span> ) {<\/td>\n <\/tr>\n \n <\/td>\n | if<\/span>( stripos( \$<\/span>row_val<\/span>, \$<\/span>search_key<\/span> ) !== false<\/span> ) {<\/td>\n <\/tr>\n \n <\/td>\n | return<\/span> true<\/span>;<\/td>\n <\/tr>\n \n <\/td>\n | } <\/td>\n <\/tr>\n | \n <\/td>\n | } <\/td>\n <\/tr>\n | \n <\/td>\n | } ) );<\/td>\n <\/tr>\n | \n <\/td>\n | \n<\/td>\n <\/tr>\n | \n <\/td>\n | return<\/span> \$<\/span>filtered_table_data<\/span>;<\/td>\n <\/tr>\n \n <\/td>\n | \n<\/td>\n <\/tr>\n | \n <\/td>\n | }<\/td>\n <\/tr>\n <\/table>\n<\/div>\n\n\n <\/div>\n\n <\/div>\n<\/div>\n\n <\/div>\n | | | | | | | | | | | | | | | | | | | | |