Is this code malidcous

You can easily check what this PHP code is doing by replacing the eval with an echo and running it. It’s safer to run this not on your production website, I’ve run it here on repl.it: https://repl.it/repls/IrresponsibleBelovedKernel which results in the below being printed: @ini_set(‘error_log’, NULL); @ini_set(‘log_errors’, 0); @ini_set(‘max_execution_time’, 0); @set_time_limit(0); $approvals = False; foreach … Read more

Add HTML Attributes To Anchor Tags In `wp_list_categories()` Function

The default walker used by wp_list_categories() (Walker_Category) has a hook (a filter hook) named category_list_link_attributes which you can use to add custom title and class (as well as other attributes like data-xxx) to the anchor/a tag (<a>) in the HTML list generated via wp_list_categories(). So for example, you can do something like: add_filter( ‘category_list_link_attributes’, ‘my_category_list_link_attributes’, … Read more

add_meta_box (Will display only in specific page admin WordPress)

/* Add meta boxs for particular pages */ function meta_set_particular_page() { $post_id = $_GET[‘post’] ? $_GET[‘post’] : $_POST[‘post_ID’]; $current_page_title = get_the_title($post_id); if ($current_page_title == ‘home’) { add_meta_box(‘Home_page’, ‘Home Name:’, ‘only_home’, ‘page’, ‘side’, ‘core’); } if($current_page_title == ‘about’){ add_meta_box(‘About_page’, ‘About Name:’, ‘only_about’, ‘page’, ‘side’, ‘core’); } } add_action(‘add_meta_boxes’, ‘meta_set_particular_page’); /* Add custom meta box for home … Read more

Sort registered users by post count? (inside admin dashboard)

Try the following code: add_filter(‘manage_users_sortable_columns’, ‘my_user_sortable_columns’); function my_user_sortable_columns($sortable_columns) { $sortable_columns[‘posts’] = ‘post_count’; return $sortable_columns; } Credit to: Add additional user fields and make them sortable in the user screen

how to echo all tables that start with a prefix

You could try changing the output type of get_results() to ARRAY_A or ARRAY_N and see what kind of array they give you. E.g. $tables = $wpdb->get_results(“show tables like ‘pro_hist%'”, ARRAY_A); var_dump($tables); foreach( $tables as $table ) { var_dump($table); } If $table is an array and it has the name as the first value, then get … Read more