WordPress Plugin Development tutorial from scratch (Part 3) WordPress Plugin Menus on Activation

In this video session i have explained about:

#WordpressTutorialsPoint
#WordpressLearnersHub
#WordpressCustomizations
#LearnWordpressStepbyStep
#WordpressBySanjay

1. How can we made menus of WordPress Custom Plugin?
===============
Usually, plugin and theme authors need to provide access to a settings (options) screen so users can customize how the plugin or theme is used. The best way to present the user with such a screen is to create an administration menu item that allows the user to access that settings screen from all the Administration Screens.

To add an administration menu, you must do three things: (For content reference https://codex.wordpress.org/Administration_Menus)
===============
a. Create a function that contains the menu-building code
b. Register the above function using the admin_menu action hook. (If you are adding an admin menu for the Network, use network_admin_menu instead).
c. Create the HTML output for the page (screen) displayed when the menu item is clicked

We have use Action hook for admin menu and use a function as ‘add_menu_page’:
===============
add_menu_page( string $page_title, string $menu_title, string $capability, string $menu_slug, callable $function = ”, string $icon_url = ”, int $position = null )

And here is your proper structure of Adding Menus to plugin
===============
/** Step 2 (from text above). */
add_action( ‘admin_menu’, ‘my_plugin_menu’ );

/** Step 1. */
function my_plugin_menu() {
add_options_page( ‘Custom Plugin’, ‘Custom Plugin’, ‘manage_options’, ‘custom-plugin’, ‘custom_plugin_callback_function’ );
}

/** Step 3. */
function custom_plugin_callback_function() {
// include your php file here to show the contents to the user
}

SOCIAL :
===============
Subscribe : https://www.youtube.com/channel/UCB2flCo-gW6RhpVVXySqcMg
FACEBOOK : https://www.facebook.com/onlinewebtutorhub/
TWITTER: https://twitter.com/owthub
BLOG: https://onlinewebtutorhub.blogspot.in/

RECOMMENDATION:
===============
1. Some knowledge of PHP, HTML for this video series
2. How to Install WordPress: https://www.youtube.com/watch?v=MREgql9jmf0
3. add_menu_page() of wordpress: https://developer.wordpress.org/reference/functions/add_menu_page/

Also you can learn WordPress Custom
===============
Theme Development: https://www.youtube.com/watch?v=MREgql9jmf0&list=PLT9miexWCpPV9WxY_QG3qxUGKzw54LboW
Widget Development: https://www.youtube.com/watch?v=ZSbdYG1svV8&list=PLT9miexWCpPUgibUXDZ7JP1j3U-m61U8m

Tags
===============
online web tutor,
profotech solutions,
wordpress plugin development from scratch in hindi,
wordpress plugin development from scratch in easy steps,
wordpress plugin development,
wordpress plugin development in easy steps,
plugin development in wordpress from scratch in hindi,
plugin development in wordpress by online web tutor,
plugin development in wordpress tutorials from scratch in hindi,
plugin theme development tutorials in hindi,
plugin development tutorials in hindi,
owt tuts,
wordpress customizations,
wordpress customisations,

Thanks
Online Web Tutor
Keep learning and Sharing 🙂

-~-~~-~~~-~~-~-
Please watch: “Learn backbone.js tutorial from scratch”

-~-~~-~~~-~~-~-

About admin

Leave a Reply

Your email address will not be published. Required fields are marked *