[wp-hackers] proposal for per-post filters in WP

Jamie Talbot wphackers at jamietalbot.com
Tue Oct 19 14:28:34 UTC 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

| b) A dropdown of available text filters in the post interface (single or
| multi-selection, or a text field, or a list of checkboxes like
categories use).

I think checkboxes would work best here.  Nice and simple, on or off for
each one.  There might not be room for it, but it would be nice if you
could squeeze a *short* description of a filter's job in as well.

| c) Filters would be applied to the content and title (and excerpt?) before
| storing them into post_content_filtered and post_title_filtered (title
filter
| may not be so necessary, but would still cut down on some processing
time when
| displaying a set of posts).

Would it make sense to have a parsable line in the plugin's header that
defined post/title/both?

| d) In the future: an admin page to specify options for available text
filters.
| Since most plugins would not have a lot of options, WordPress could just
| aggregate their options in a single options page.

My XHTML validator plugin uses about 9 checkboxes as it stands:
www.jamietalbot.com/wp-hacks/xvalid/menu.png so this might be a bit
difficult.  But using the recently added "add submenu" functionality,
you could create a master "Filters" section and have each plugin appear
as a sub of that?  All of the wpautop and other defaults could live
here, and it would again make things nice and easy for a user.  It
depends how important a role you think filters will play I guess.

| When displaying posts, WP would always pick post_content_filtered and
| post_filters, and check that it wouldn't apply twice the same text
filter (once
| when posting with per-post filter, once when displaying with
apply_filter) to
| the content.

Could you have a way of defining a filter as one-time or dynamic?  Some
plugins work at publish / edit time only, and thus you wouldn't need the
plugin installed at a later date.  A dynamic one (for example does
something to do with the current date) would be stored in the db, but a
one-timer wouldn't need to be...

| I'm requesting some feedback on these ideas...

In general, I think the ideas I've put up above imply a general
separation of a "post filter plugin" and a "miscellaneous plugin".  Not
sure if that's exactly the way to go, but having a well-defined method
of creating, installing and using post filters definitely seems like a
good idea.

Cheers,

Jamie.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBdSSSrovxfShShFARAhQsAJ9NjmnmTE8CP7t+v2aDpHM1g8xIQwCeNGGr
qdMfIJAGRsk7PVagw2PvUB4=
=2SdE
-----END PGP SIGNATURE-----




More information about the hackers mailing list