How to make a secondary Pages Screen

You’ll start with add_menu_page(), to create the actual admin page. From there, it’s really up to you, but I recommend using the WP_Posts_List_Table: nearly everything is built-in and ready to use. There are several comprehensive articles on creating a custom list table; most of them should be sufficient for getting you started.

I want to force secondary rows using WP_List_Table

My recommendation is to structure the array so that your variations become “regular rows”. I would use your implementation of prepare_items for that. Here your array is changed to something like that: $this->items = array( array( ‘id’ => 2, ‘page’ => ‘page2’, ‘url’ => ‘page2’, ‘alt-id’ => null, ‘alt-title’ => null ), array( ‘id’ => … Read more

Is there a way to assign a default Category to a Post when the user creates a new Post?

WordPress presents default category as a setting in Settings -> Writing (though this doesn’t seem to pre-check the checkbox): The new_to_auto-draft action will allow you to do things to a new post before the page loads, and does pre-check the checkbox (tested): add_action( ‘new_to_auto-draft’, static function ( $post ) { $default_category_id = 25; // The … Read more

I accidentally rejected my wordpress admin account!

Didn’t get the context Rejected, I’m suggesting this solution with keeping in my mind that you do not know the email and password of the account you rejected, you can recover your account from CPanel, go to your currently active theme’s functions.php file and use this function to create new admin; //add a new admin … Read more

How to add the “page” post type to Recent Activity widget displayed in admin?

Add page post type to your code (tested): add_filter( ‘dashboard_recent_posts_query_args’, function(array $queryArgs) { $postTypes = get_post_types([ ‘public’ => true, ‘capability_type’ => ‘post’, ]); $postTypes[] = ‘page’; if ( is_array( $postTypes ) ) { $queryArgs[‘post_type’] = $postTypes; } return $queryArgs; }, 15 ); The reason your original code did not include pages is because pages have … Read more