• Resolved mercuryfenix

    (@mercuryfenix)


    I’m looking through other plugins to help understand how to use actions but some of them I can’t find in the codex.

    In Twitter Tools, the following actions are used and I think I might need to use them in the same way but there is no documentation of them. The actions are draft_post, publish_post, save_post. I can assume what they do but it’d be nice to see something from the codex.

    // This is how he uses them in the plugin for Twitter Tools
    add_action('draft_post', 'aktt_store_post_options', 1, 2);
    add_action('publish_post', 'aktt_store_post_options', 1, 2);
    add_action('save_post', 'aktt_store_post_options', 1, 2);
Viewing 9 replies - 1 through 9 (of 9 total)
  • Two of those are right here. You can also look here. Not all actions/filters are documented though. Its possible for plugins to add actions and filters as well.

    Thread Starter mercuryfenix

    (@mercuryfenix)

    I tried that site. They aren’t listed.

    publish_post and save_post (also the related edit_post) are listed in the codex which I linked to. save_post is listed at adambrown.info.

    I confess that I can’t explain draft_posts. I can’t find it in either 2.7 or 2.7.1 and I grep’ed some old directories too that probably date back to 2.5 or so. Maybe a plugin added it. Maybe its a devel hook or a very old one. Maybe I’m an idiot and can’t drive grep. I’m not sure.

    Sorry. I take that back. I think I can explain draft_post. I’m betting that it can be explained by this variable-function-name function: ${new_status}_$post->post_type

    Look closer.
    publish_post is there and explains it has been renamed
    save_post is there

    draft_post is not there, but then again, can’t see the string ‘draft_post’ in any core file.

    Good explanation apljdi.

    There are still 6+ references add_action(‘publish_post’ actions still in the source code and no do_action(‘publish_post’ are those add_action’s going to be adjusted to the new rename?

    scratch that, 1 add_action(‘publish_post left in wp-includes/default-filters.php

    add_action(‘publish_post’, ‘_publish_post_hook’, 5, 1);

    the other 5 i found were in plugins that still use publish_post and amazingly enough were updated post 2.7.1 with publish_post still

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Actions: can’t find them all in the codex’ is closed to new replies.