[wp-hackers] Looking for quick input on creating new actionhooks...

David Chait davebytes at comcast.net
Sat May 28 05:46:50 GMT 2005

1. I figured better to use a new action hook that others might start to use and spread, rather than a custom function.
2. Applying filters to the_content doesn't work (needs to be able to insert before the start of the post data, like before the title, and after the body, like after the posted-in -- or 'between' posts, if that's clearer ;) ).  Also breaks if the person uses the_excerpt. ;)
3. I'm not assuming a hook is preexisting in the slightest -- but wouldn't we rather people update their current theme to have the "right hooks" that then support LOTS of plugins rather than adding a custom function call PER plugin?  Again, I thought this a better approach.

And maybe we need to start a different thread about 'verification'.  Like testing that THEMES have references to all 'core actions' they should! ;)

  ----- Original Message ----- 
  From: Robert Deaton 
  To: wp-hackers at lists.automattic.com 
  Sent: Saturday, May 28, 2005 1:21 AM
  Subject: Re: [wp-hackers] Looking for quick input on creating new actionhooks...

  Or, another idea would be applying filters to the_content and adding your content in (provided you don't mind it being inside the post div). I do have to agree with Matt on adding more hooks, we still have the unresolved issue with theme authors not putting the post hooks in, but that's a whole other arguement.

  On 5/27/05, Matt Mullenweg <m at mullenweg.com> wrote:
    David Chait wrote:
    > ...Or something along those lines.  The concept is actions that (in
    > future templates, or added to current ones) would execute inside the
    > post DIV, one right at the start, one right at the end.  I'm working on 
    > plugins that allow you to insert custom content into The Loop without
    > editing the template, and figure why have people call a custom function,
    > when they could just have do_action('wp_post_out_end');   Y'know what I 
    > mean?  Seems like sprinkling new action hook locations is more useful
    > than adding another function call directly because:

    Even with the simple hooks we have already in the templates, lots of
    plugin authors have had to deal with the hooks not being there because a 
    theme doesn't contain them. It's also a slippery slope to go down, in
    theory we could have a hook between every HTML element on the page, but
    that'd be pretty silly.

    A better solution might be...

    Scan the plugin file for function definitions, then scan the templates 
    and warn the user before actually deactivating the plugin that there are
    still function calls in their templates.

    Matt Mullenweg
    http://photomatt.net  | http://wordpress.org
    http://pingomatic.com | http://cnet.com
    wp-hackers mailing list
    wp-hackers at lists.automattic.com

  --Robert Deaton 


  wp-hackers mailing list
  wp-hackers at lists.automattic.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://comox.textdrive.com/pipermail/wp-hackers/attachments/20050528/b8165a01/attachment.html

More information about the wp-hackers mailing list