Add menu option to “New Post” menu in admin bar

Use new-content : function make_parent_node($wp_admin_bar) { $args = array( ‘id’ => ‘test1234’, // id of the existing child node (New > Post) ‘title’ => ‘test’, // alter the title of existing node ‘parent’ => ‘new-content’, // set parent to false to make it a top level (parent) node ‘href’ => admin_url(‘admin.php?page=enter_timesheet’) ); $wp_admin_bar->add_node($args); } it … Read more

Able to edit custom post, but unable to create new custom post when within submenu. What capability is missing?

I couldn’t find an answer to this question with User Roles Editor, but I have worked around this problem by showing different admin panels for different users. When Plugin Admin logs in, the custom post type is not put under a menu, so they can create new custom posts. When the Administrator logs in, the … Read more

Add_menu_page not displaying the menu in class based plugin

There’s a spelling error on the $capability parameter: $cabability = ‘manage_options’; Here’s the working code for the sake of completeness: class Cosmo_Games { public function __construct() { add_action(‘admin_menu’, array($this, ‘create_plugin_settings_page’)); } public function create_plugin_settings_page() { $page_title=”Game Settings”; $menu_title=”Games Plugin”; $capability = ‘manage_options’; $slug = ‘cg_settings’; $callback = array($this, ‘plugin_settings_page_content’); $icon = ‘dashicons-admin-plugins’; $position = 100; … Read more

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