• I’m working on a plugin and wanted to add some form elements to the advanced section of the form. To test, I wrote the following plugin. What surprised me was that the section appeared (after clicking the Advanced button) in the top section of the post editor and NOT in the advanced section. Is there a way to get it to be in the advanced section?

    The second question I have is how do I get the post id since it’s not passed in for the edit_form_advanced section (at least according to the codex)?


    <?php
    /*
    Plugin Name: Test
    Plugin URI: https://localhost/
    Description: edit_form_advanced test
    Version: 0.1
    Author: Bill Smith
    Author URI: https://localhost
    */

    add_action('edit_form_advanced', 'mytest_show_form');

    function mytest_show_form()
    {
    ?>
    <fieldset id="mytest">
    <legend>edit_form_advanced test</legend>
    </fieldset>

    <?php
    }
    ?>

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter copperleaf

    (@copperleaf)

    I apologize. I should have proofread better. What I meant to say for the second question was:

    The second question I have is how do I get the post id since it’s not passed in for the edit_form_advanced action (at least according to the codex)?

    Thread Starter copperleaf

    (@copperleaf)

    Is this the proper forum for plugin coding questions?

    Q1. I’m not fluent with the admin hooks, so I’m unsure about your problem.

    Q2. The post id is part of the query string, so one way could be to grab it through $_GET['post'].

    Q3. Any question about WordPress can be asked here, but on coding issues a better response may come up on the hackers list.

    https://lists.automattic.com/mailman/listinfo/hackers

    Thread Starter copperleaf

    (@copperleaf)

    Thanks for the info. I also noticed that there is a global defined in the admin page called $post_ID. However using the ‘get’ is probably a better approach.

    I tried subscribing to the list but have been getting server errors for the last 2 days. I email the admin of the list.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘edit_form_advanced action’ is closed to new replies.