Results 1 to 7 of 7

Thread: Hook into write post area

  1. #1
    andrea_r's Avatar
    andrea_r is offline WordPress Rockstar
    Join Date
    Jan 2009
    Location
    Eastern Canada
    Posts
    1,325

    Default Hook into write post area

    I have an idea for a plugin, and I have the code needed to display the results I want. Now, i want it to show in the Write Post area. What are the hooks available?

    Either under the box or in the sidebar, not sure which I want yet. :D

  2. #2
    andreasnrb's Avatar
    andreasnrb is offline Kegger
    Join Date
    Jun 2009
    Posts
    595

    Default

    http://codex.wordpress.org/Plugin_API/Action_Reference
    One of these?
    edit_category_form Runs after the add/edit category form is put on the screen (but before the end of the HTML form tag).
    edit_category_form_pre Runs before the edit category form is put on the screen in the admin menus.
    edit_tag_form Runs after the add/edit tag form is put on the screen (but before the end of the HTML form tag).
    edit_tag_form_pre Runs before the edit tag form is put on the screen in the admin menus.
    edit_form_advanced Runs just before the "advanced" section of the post editing form in the admin menus.
    edit_page_form Runs just before the "advanced" section of the page editing form in the admin menus.

  3. #3
    andrea_r's Avatar
    andrea_r is offline WordPress Rockstar
    Join Date
    Jan 2009
    Location
    Eastern Canada
    Posts
    1,325

    Default

    AHA!

    That's what I was looking for and couldn't find. :)

    Thanks.

  4. #4
    andrea_r's Avatar
    andrea_r is offline WordPress Rockstar
    Join Date
    Jan 2009
    Location
    Eastern Canada
    Posts
    1,325

    Default

    Alos, bad links there Andreas. :)

  5. #5
    andrea_r's Avatar
    andrea_r is offline WordPress Rockstar
    Join Date
    Jan 2009
    Location
    Eastern Canada
    Posts
    1,325

    Default

    Oh yeah, dead simple & easy.

    PHP Code:
    function shortcode_finder() {
    echo 
    "Available shortcodes: <br />";
    global 
    $shortcode_tags;
    if( 
    is_array$shortcode_tags ) && !empty( $shortcode_tags ) ) {
        foreach( 
    $shortcode_tags as $k => $v ) {
            echo 
    "<pre>$k</pre>";
        }
    }    
    }
    add_action('edit_form_advanced''shortcode_finder'); 
    I'm thinking of fancying this up a bit then putting it on the repo. Sheesh, I have no plugins listed there, and while I stick to really simple basic ones, I kinda should put them there so the community know about them. :)

    this also needs testing as the orginal code didn't seem to get any shortcodes set by plugins.

  6. #6
    andreasnrb's Avatar
    andreasnrb is offline Kegger
    Join Date
    Jun 2009
    Posts
    595

    Default

    Indeed a simple plugin. Shortcodes really should be linked to some description text wonder if they will add that capability.

    Also I just copied and pasted the text the links came with it and I didn't want to spend time delinking them =).

  7. #7
    mfields's Avatar
    mfields is offline Here For The Peanuts
    Join Date
    Nov 2009
    Location
    Portland, OR
    Posts
    168

    Default

    @andrea_r - Great plugin idea, makes a lot of sense to me :) I just tested it and can verify that it recognized three of my custom shortcodes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •