Only an admin can add new tags

To restrict non-administrators from adding new tags in the WordPress admin area, you can use a combination of WordPress hooks and capabilities checks. The idea is to disable the ability for users who are not administrators to create new tags while still allowing them to select from existing tags when editing posts. Here’s a custom … Read more

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)