Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7887129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:29:58+00:00 2026-06-03T05:29:58+00:00

WordPress 3.2.2 What’s the steps to define a custom link in the wordpress admin

  • 0

WordPress 3.2.2

What’s the steps to define a custom link in the wordpress admin such as

http://localhost:8888/wp-admin/admin.php?action=update_posts

so that when this link is accessible by admins, a specific function is executed.

(in the context of a custom wordpress plugin)

EXAMPLE CODE

function my_special_function(){

    echo '<div> Hello World </div>';

}

$page_title = "Hello Page Title";
$menu_title = "Hello Menu Title";
$capability = "import";
$menu_slug = "My Menu Slug";
$function = my_special_function;
add_menu_page($page_title,  $menu_title, $capability, $menu_slug, $function);

So I have this example code. Now what? And what url should I load to see hello world printed on in the html page?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T05:29:59+00:00Added an answer on June 3, 2026 at 5:29 am

    You will probably want to use add_menu_page. That involves two steps. First, you will need to define a function (my_menu_page in the example below) to create the menu.

    // inside plugin file
    function my_menu_page ()
    {
      $page_title = "Hello Page Title";
      $menu_title = "Hello Menu Title";
      $capability = "import";
      $menu_slug = "My Menu Slug";
      $function = my_special_function;
    
      add_menu_page($page_title,  $menu_title, $capability, $menu_slug, $function);
    }
    

    Once you’ve got that, you will need to register it with WP using the add_action function and a hook. For an admin menu, the admin_menu hook is probably appropriate.

    // inside plugin file
    add_action('admin_menu', 'my_menu_page');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My wordpress site has been hacked. Through this program: http://sitecheck.sucuri.net/ (...) i found that
WordPress allows theme designers to place a 404.php file in their theme's directory. This
Wordpress has a filter that automatically add paragraphs to posts. I can remove this
Using wordpress, I am pulling in a custom fields from specific posts to fill
Wordpress 3.0 just came out and it was cited that one can make a
Wordpress' documentation suggests adding the following to functions.php to enable what I want to
Wordpress checks periodically to make sure that the version of Wordpress being used is
WordPress 3.2.1 I'm creating separate page templates, however, there are some page templates that
Wordpress has a spam filtering plugin called Akismet that seems to be able to
in wordpress i have a query where it queries specific posts. <div id=container-> <?php

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.