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 8028003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:59:28+00:00 2026-06-04T23:59:28+00:00

I’ve got this problem while developing a WordPress plugin. Here’s the code snippet of

  • 0

I’ve got this problem while developing a WordPress plugin. Here’s the code snippet of the area I’m working with:

add_submenu_page( 'admin_manager',
                  'Add Event',
                  'Add Event',
                  'manage_options',
                  'add_event&action=modify',
                  'add_event_handler' );

As you can see, on my menu slug I want to add the ‘&action=modify’

'add_event&action=modify'

But when I do that, WordPress denies me access and says I don’t have the proper privileges. It works fine without the extra parameters, is there something built into wordpress that doesn’t allow for such things?

Any thoughts or workarounds?

  • 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-04T23:59:30+00:00Added an answer on June 4, 2026 at 11:59 pm

    The slug argument is not intended to take in query parameters. If you’re intending to set up some kind of default action (which, I would also imagine the “action” query is more than likely a reserved keyword used by WordPress itself), why don’t you set up the page to populate as if the parameter were there by default?

    My guess is that you want other parameters in place as well, which you can then use a Form to send data (via POST or GET) to populate your page using those parameters. For instance:

    <!-- SUBMENU PAGE -->
    <form action="" method="GET">
        <label>Select Action: </label>
        <select name="jKern_action">
            <option value="modify">Modify</option>
            <option value="add">Add Event</option>
            <option value="delete">Delete Event</option>
        </select>
    </form>
    <?php
    $action = isset($_GET['jKern_action']) ? $_GET['jKern_action'] : 'modify';
    switch($action)
    {
        case 'add' :
        ?>
            <!-- YOUR EVENT ADDING HTML HERE -->
        <?php
        break;
        case 'delete' :
        ?>
            <!-- DELETE HTML HERE -->
        <?php
        break;
        default :
        ?>
            <!-- DEFAULT MODIFICATION HTML -->
    <?php
    }
    ?>
    

    This isn’t a perfect example, but I’m sure you can gather what has been done here. As mentioned, the slug argument is NOT intended to populate queries, and you should also be naming your GET and POST keys (as well as option and meta keys) something unique to your code so the likelihood of any naming conflicts is minimal.

    Another example of the proper use of submenu navigation without relying on a form to navigate would be something like this:

    <a href="?page=add_event&jKern_action=add">Add Event</a>
    <a href="?page=add_event&jKern_action=modify">Edit Event</a>
    <a href="?page=add_event&jKern_action=delete">Delete Event</a>
    <?php
    ...
    ?>
    

    Your best bet would be to look up some examples of how plugin authors have effectively used the add_submenu_page() function, but mostly, you should play around with it and get used to how the normal WordPress flow works.

    Good luck, and let me know if this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I've got a string that has curly quotes in it. I'd like to replace
this is what i have right now Drawing an RSS feed into the php,
I have a text area in my form which accepts all possible characters from
i got an object with contents of html markup in it, for example: string
Does anyone know how can I replace this 2 symbol below from the string

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.