• Is it possible to use in_category() or an equivalent in post.php

    I have a function(x) I want to execute in post.php only if the post is in a specific category.

    Thanks!

    John

Viewing 4 replies - 1 through 4 (of 4 total)
  • post.php? Where?

    Thread Starter johndalton80

    (@johndalton80)

    wp-admin/post.php.

    Thread Starter johndalton80

    (@johndalton80)

    Basically I have a function(x) which I want to execute every time a post is created and is a certain category.

    So i’ve place it in wp-admin/post.php, maybe there is an easier way to do this?

    Thanks ??

    I’m not sure that in_category() will work within wp-admin. As far as I know, it’s designed to work with the Loop’s query – which obviously doesn’t apply here.

    What does your function do? Should it only be triggered when a post is published or also when a post is saved as a draft?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Using in_category() or an equivalent in post.php?’ is closed to new replies.