Add a "filter" to the plugin.. (Source Code Provided)

3 views
Skip to first unread message

Bill Rawlinson

unread,
May 19, 2009, 4:46:15 PM5/19/09
to flickrRSS
I use this plugin and needed to be able to embed a flickr feed into a
post/page so I needed some filter capabilities; thus I added the
following code to the plugin:


function flickrRSSWebRegExFilter($text){
return preg_replace_callback("'\[!--flickrRSS:(.*)--\]'",
"flickrRSSWebFilter", $text);
}


function flickrRSSWebFilter($args){
$args = explode(".",$args[1]);

$a = array();
foreach($args as $arg){
$arg = explode(":=",$arg);
$a[$arg[0]] = $arg[1];
}
$args = $a;



get_flickrRSS($args);

}


if (function_exists('add_filter')){
add_filter('the_content', 'flickrRSSWebRegExFilter');
}


Then you use it like so:

[!--
flickrRSS:type:=public.tags:=huntington,wv,building.do_cache:=false--]

As you can see you just separate each argument with a period. I used
that delimiter over a comma since you might want a comma delimited
list of tags..

eightface

unread,
May 21, 2009, 2:12:39 PM5/21/09
to flickrRSS
I likely won't add this to the plugin, at least not as a documented
feature. We'll see though.

With your format, I wonder if it's possible to grab the tags from the
post itself. So it would end up like an automatic image kind of thing.
Reply all
Reply to author
Forward
0 new messages