[wp-hackers] Theme development and hooks.

Mark Jaquith mark.wordpress at txfx.net
Wed Apr 6 00:46:41 GMT 2005


Robert Deaton wrote:

> The validator would be fairly easy to write in most aspects. The 
> hardest part is checking things like the comment form, which isn't 
> there when the index is called, and if we were to check on a comment 
> page, the sidebar may or may not be located there. We could have 
> WordPress write an array of items reqiured to validate to the 
> database, and only write the comment value on a comment page, and have 
> the admin not say anything until the comment form is marked as 
> missing. Then, to save load, we don't update the values every time the 
> page is called, instead only when the values are missing. In the admin 
> panel there could be a button to clear the current validation settings 
> of a theme and have it recheck.

There are only a few things needed.  <?php wp_head(); ?> and <?php 
wp_meta(); ?> and <?php wp_footer(); ?> and
<?php do_action('comment_form', $post->ID); ?> are the essential ones, 
right?  DrDave's Spam Karma 2 already has code that checks the comments 
files for the "comment_form" action, and Firas' one should do that as 
well as the others.  The only other guidelines I can think of are 
general CSS standards that we could try to promote.  Like, surrounding 
posts with <div class="post" id="post-<?php the_ID(); ?>"></div> and 
making entry titles <h2> .  But I'd think that having those 4 hooks 
would be the greatest thing to make plugins work across themes.


More information about the wp-hackers mailing list