• Resolved AndreSC

    (@andresc)


    when using the ‘posts_request’ hook in a plugin, what is the best way to determine if the function has been called by the front-end or by the manage posts page in admin ?

    Thanx

Viewing 1 replies (of 1 total)
  • Thread Starter AndreSC

    (@andresc)

    I think the solution is if you have say
    add_filter('posts_request','myfunction');

    and you do not want your function to have any effects when posts are listed in e.g. Manage > Posts

    function myfunction() {
    	global $wp_query;
    	if(!$wp_query->is_admin) {
            // do front-end stuff here
Viewing 1 replies (of 1 total)
  • The topic ‘posts_request, admin or front-end’ is closed to new replies.