Plugin – create a page without it appearing in the side menu

Set the parent_slug property to null, example; add_submenu_page( null // -> Set to null – will hide menu link , ‘Page Title’ // -> Page Title , ‘Menu Title’ // -> Title that would otherwise appear in the menu , ‘administrator’ // -> Capability level , ‘menu_handle’ // -> Still accessible via admin.php?page=menu_handle , ‘page_callback’ … Read more

How to Add Custom Taxonomy To Woocommerce Plugin

You have to do: add_action( ‘init’, ‘custom_taxonomy_Item’ ); Because: Use the init action to call this function. Calling it outside of an action can lead to troubles. see codex page register_taxonomy. Besides that : Better be safe than sorry when registering custom taxonomies for custom post types. Use register_taxonomy_for_object_type() right after the function to interconnect … Read more

Prevent network activation of plugin

The answers here are overthought and too complex. Why deactivating the plugin instead of preventing activation? Something as simple as calling die(‘your error message here) upon activation will do the job. function activate($networkwide) { if (is_multisite() && $networkwide) die(‘This plugin can\’t be activated networkwide’); } register_activation_hook(‘your-plugin/index.php’,’activate’); Then when you try to activate in the panel, … Read more

On the WordPress Admin section how do I link to submenu pages created for a plugin?

admin_url() gets you the correct administration page URL (and network_admin_url() to get a network administration page URL) Optionally, you can use add_query_arg() to append arguments to an URL, using an associative array: $page=”edit_record_page”; $rec_id = 1; $record_url = add_query_arg(compact(‘page’, ‘rec_id’), admin_url(‘admin.php’));

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