Replace 'call_user_func_array'
with name of the function to be called to output the page content.
add_action('admin_menu', 'personalised_menu');
function personalised_menu()
{
add_menu_page( 'Page Title', 'Blog', 'edit_posts', 'menu_slug',
'display_main_page', 'dashicons-welcome-write-blog' );
add_submenu_page( 'menu_slug', 'Add New Page', 'Add New', 'edit_posts','add_new_page',
'display_secondary_page' );
}
function display_main_page() {
echo 'Content of "Page Title"';
}
function display_secondary_page() {
echo 'Content of subpage';
}
Related Posts:
- Error Warning: Declaration of description_walker::start_el after PHP upgrade [duplicate]
- How to store the_title() into a variable to reutrn the value, not just echo it
- Need to get specific data from array
- Create an array from an array
- Warning: array_pop() expects parameter 1 to be array, boolean given
- Check if term object is in array
- get a simple array of all of the term names that exist in all taxonomies
- Populate dropdown with Child Pages based on Parent Page chosen
- foreach loop still echoes array
- Checking array against author id in loop
- Alter required message using comment form api
- meaning of (array)function()
- Illegal string offset in PHP function
- wp_force_remove_style’ not found
- Filtering a function’ output for a new continued function
- How to use array in function to get only value I want
- Error while setting role
- Warning: in_array() null given in PHP function
- Loop over Array and get the distinct ids
- If Array Values Match Another Array’s Values, Then
- Only load certain artists on this page
- How to make sure relative URL works when site is not on root domain?
- Custom functions for string data calculations
- Store custom field’s multiple values in one user meta key
- Fatal error when using array_diff() function inside of wp_update_nav_menu hook?
- Display posts using post ID’s in an array
- Page returning ID from array, how to return the correct values for post in acf wordpress
- Display a post based on its metabox selection
- Showing all post from all post type in admin backstage
- Custom WordPress Function – Adding items from Foreach Loop into an array and Updating Field based on array of IDs (ACF + WooCommerce)
- Warning: Illegal string offset ‘post’ and ‘page’
- Replace block content with an array
- How to set and use global variables? Or why not to use them at all
- Is it possible to disable a function of a parent theme?
- Hide old attachments from wp media library
- PHP – redirect https to http and www to non-www
- Enqueue Javascript Correctly for 3.5
- Add footer.php to WordPress child theme
- Restrict WordPress File Type Uploads by User Type
- Click loads template via ajax
- Sort registered users by post count? (inside admin dashboard)
- How to change a public function inside a class of a plugin?
- Randomise upload filenames (or another solution to hide the original image URL from theft?)
- Function set default image when image not present
- WooCommerce – Reset quantity input field when variation changes
- Query all posts of a custom taxonomy term
- Automatically remove a canceled order in Woocommerce
- Trying to establish connection to External Database
- How to remove the cufon script from Dzonia Lite theme [closed]
- Login/logout in header
- How to put “Read more” link in Custom Excerpt inside p tag?
- Get users that likes the post
- How to abort saving data in save_extra_profile_fields function WordPress?
- Get the date of the className or classID
- My custom get_the_excerpt() can’t get excerpt by ID
- WordPress Options Page Theory Question
- deactivating an active plugin using if page
- How to set the WordPress logo programmatically with PHP
- Function won’t run onclick using Ajax
- Add login hyperlink to secondary navigation menu
- How do I create a numbered list with PHP? [closed]
- Where is this function’s callback getting its arguments from?
- List all blogs, but exclude the main site
- change the default order of posts only for specific categories
- Reading settings in the home page precisely home.php
- Problem with adding custom CSS class to image in ACF Photo Gallery plugin [closed]
- Calling function in loop causes repeat data
- Order a WP_Query by meta value where the value is an array
- How to use functions [closed]
- Splitting the_content() by size?
- Is there a hack for using is_page() within the function.php file?
- Add a select-option to the default widgets
- Updating Metadata with Shortcode
- can’t load .po file in functions.php
- WP-Bakery – Add custom colors to buttons with template colors
- Create shortcode for metabox gallery
- Show all people who commented on all posts by an author
- How can I redefine WordPress wp-content directory programmatically?
- Trim Titles Only On Some Pages
- Custom global variable not working in function
- get_the_author_meta( ‘ID’ ) just return 1
- Enqueue sripts and styles only if function is called
- Site title not showing. Please help me
- Check if post visited first time
- ajaxurl usage for a custom function
- Open/closed function [closed]
- Need to Echo A Url path to show on a wordpress page
- add a value to an external link query in searchform
- How to get category pages to look like a certain archive page?
- How to call a specific value within the functions.php file?
- What is this mark for “? function()” [closed]
- How to combine array info [closed]
- get_body_params() is always empty in POST request
- Warning: Attempt to read property “term_id” on int – Woocommerce
- Warning: filemtime(): stat failed for wp_
- Keep users logged in Without Remember Me
- How to use js variable to php in wordpress functions.php
- a problem in class in class-wp-hook.php
- change title of page dynamically
- Custom plugin doesn’t show in admin menu – when code added, displays an empty page