[wp-hackers] Backup Plug-in and WordPress Plug-In System - Was Re:" "

Scott Merrill skippy at skippy.net
Mon Feb 14 14:32:53 GMT 2005


Jonathan Firestone wrote:
> Frankly most WordPress plug-ins aren't really plug-ins. Making
> plug-ins and the main distribution of WordPress as light as possible
> should mean
> 1) being able to put a plug-in into the plug-ins directory, 
> 2) have the application auto-sense the plug in and then let that be it,

One of the challenges is that just making a plugin file available to WP 
does not make that plugin operate as we'd like.  For example, take this 
"bug" I filed a while ago:
    http://mosquito.wordpress.org/view.php?id=84

the_category() is a core WP function, that sorts categories strictly by 
their ID.  If I re-arrange the order of my categories, their IDs won't 
change, so the final output won't be in the order that I had wanted them in.

Matt suggests that this be solved with a plugin.  Fine, I can do that. 
But after making my plugin, I need to actually tell WP to use my 
plugin's new function -- I can't override the core the_category() 
function.  Instead, I need to edit index.php (or sidebar.php, or 
whatever) and replace the the_category() call with a call to my plugin's 
function.

Another example is one that comes up now and again: suppressing all 
posts from a certain category from being included in The Loop on the 
main page.  Simply filtering _after_ the default SQL query executes can 
result in wonkiness: say you have posts_paged set to 5, indicating that 
you want five posts to display.  WP will pull 5 posts from the database. 
  If four of those posts are in the category you want to suppress, your 
page will only show one post!
The best way to do this is to modify the SQL query that collects the 
posts to display.  But again, there's no elegant, hands-off way to 
achieve this.  Even if you write a plugin to do the actual query, you 
need to execute that plugin's function(s) somehow, which requires that 
you edit some file(s).

Some plugins will be usable right out of the box.  But for a great many 
more plugins, the user will need to take some steps to actually make use 
  of them.

-- 
skippy at skippy.net | http://skippy.net/

gpg --keyserver pgp.mit.edu --recv-keys 9CFA4B35
506C F8BB 17AE 8A05 0B49  3544 476A 7DEC 9CFA 4B35


More information about the hackers mailing list