plugin help -> intercept act_display

0 views
Skip to first unread message

Andrew Rickmann

unread,
Mar 7, 2009, 8:19:54 AM3/7/09
to habar...@googlegroups.com
Hi,

I can't quite figure out how to do this so I am hoping someone can
give me some direction.

I have a plugin that creates a new post type.

I want to intercept the act_display request for posts of that type and
redirect them elsewhere leaving everything else operating normally.

From within the theme it would be easy but I am not sure how to go
about it from within a plugin.

Thanks

Andrew

Arthus Erea

unread,
Mar 7, 2009, 9:38:29 AM3/7/09
to habar...@googlegroups.com
There are many ways to do this. I do it like this:

Create a action_handler_display_{type} function.

Put all your stuff in there, and when its done just exit;

rick c

unread,
Mar 7, 2009, 9:58:43 AM3/7/09
to habari-dev
Andrew,

Take a loog in userthemehandler.php, specifically the act method.
There is a plugin filter, Plugins::filter( 'theme_act' . $action,
$handled, $this->theme). You should be able to use this to call
filter_them_act_display_contenttype( $handled, $theme) in your plugin.
You can see an example in the podcast plugin, where it calls
filter_theme_act_display_podcasts( $handled, $theme). Note that the
plugin also creates a new rewrite rule listing UserThemeHandler as the
actionhandler, which you can see in the code. There are other plugins
which do the same thing, though I can't remember them off hand.

Rick

Andrew Rickmann

unread,
Mar 7, 2009, 11:13:37 AM3/7/09
to habar...@googlegroups.com
Thanks, I think I have it now.

Andrew

Reply all
Reply to author
Forward
0 new messages