Link to a admin submenu item using a custom link

If I understand correctly what you are asking, you need the $menu_slug used when adding your menu pages: //add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position ); //add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function ); $your_link_url = admin_url( ‘admin.php?page=”.$menu_slug, “http’ ); OR SPECIFICALLY FOR YOU $your_link_url = admin_url( ‘admin.php?page=nes_vendor_new’, ‘http’ ); You can always verify … Read more

Plugin capabilities

public function myplugin_role_has_cap($capabilities, $cap, $args) { if(!isset($capabilities[‘myplugin_access’])) { unset($capabilities[‘myplugin_delete_item’]); } return $capabilities; }add_filter(‘user_has_cap’, array($this, ‘myplugin_role_has_cap’), 0 , 3); Here is a better answer, that corresponds to my example. Let’s say the plugin, on activation, adds the 2 caps to a role, and that after that for some reasons, the access cap is revoked. Then, even … Read more

Making plugin output customizable

Shortcode with a custom output template: You could try the following shortcode demo: /** * The shortcode [history_timeline] with a custom output template. */ add_shortcode( ‘history_timeline’, function( $atts = array(), $content=”” ) { ob_start(); if ( ” == locate_template( ‘templates/timeline.php’, TRUE ) ) include( plugin_dir_path( __FILE__ ) . ‘templates/timeline.php’ ); $html = ob_get_clean(); return $html; … Read more

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