Here we are talking about Adding a menu item in wordpress admin panel to add manual functionality for your themes and plugins etc. Let's do it You need a Wordpress Function called add_action which get 2 parameter.
add_action Parameters Explanations:
We write function signal_adder(){
==>now our add_action will complete after this function
we are telling wordpress in next line add_posts_page it means our menu item will be in posts section just copy the code and paste in theme functions.php file and you will see there is a menu called Add Signal.
add_posts_page parameter Explanations
Beginners always feel very ambiguous while making admin menu just write i will comment and solve your problem as already i am beginner not an expert but the problems i tackle i write here. Just follow the path and you will be lead by me. Hope you will like this tutorial then you going to share and comment your review thanks for reading.
add_action Parameters Explanations:
- First parameter is what do you want to add so we write admin menu.
- Second parameter is that we will tell wordpress add action that my other explanation will be in signal_adder function
We write function signal_adder(){
==>now our add_action will complete after this function
we are telling wordpress in next line add_posts_page it means our menu item will be in posts section just copy the code and paste in theme functions.php file and you will see there is a menu called Add Signal.
add_posts_page parameter Explanations
- First parameter will be the Menu Title
- Second parameter will be the Page Title
- Third parameter will be manage our page options (Fixed just write as it is)
- fourth parameter will be your choice because in our admin panel url will be yourhost.com/wp-admin/edit.php?page=signali
- Fifth parameter will be a function in which our other things lie like what will be the page matter or texts etc.
add_action('admin_menu','signal_adder');
function signal_adder(){
add_posts_page('Add Signal','Add Signal','manage_options','signali','signal_adder_text');
}
function signal_adder_text(){
echo "Hurrah i make a custom admin menu";
}
function signal_adder(){
add_posts_page('Add Signal','Add Signal','manage_options','signali','signal_adder_text');
}
function signal_adder_text(){
echo "Hurrah i make a custom admin menu";
}
Beginners always feel very ambiguous while making admin menu just write i will comment and solve your problem as already i am beginner not an expert but the problems i tackle i write here. Just follow the path and you will be lead by me. Hope you will like this tutorial then you going to share and comment your review thanks for reading.