I'm attempting to write an easy wordpress plugin to wordpress but i've got a problem. this is actually the wordpress plugin:


function replace_css_php($text)

add_filter('bloginfo', 'replace_css_php', 1, 1)

add_filter('bloginfo_url', 'replace_css_php', 1, 2)

the issues is the fact that other plug ins (not my plug ins), added text towards the header after me. this means that only a few of the text dealing with replace_css_php and not every one of it.

(the function replace_css_php is simply a simple example, not in tangible existence)

any idea?

Thanks

You would like to alter the execution order (priority) of the filter:

add_filter ( 'hook_name', 'your_filter', [priority], [recognized_args] )

The default is 10, and you are setting the priority of both to at least one, so they are being over-ridden by anything else around the page having a lower priority. Set the priority value to something much greater also it should work.

Looks in my experience like you are attempting to filter the stylesheet URL?

By which situation, make use of the appropriate filter stylesheet_uri

function replace_css_php($uri)
{
    return str_replace('.css', '.php', $uri);
}
add_filter('stylesheet_uri', 'replace_css_php');