-2
if ( $new_status != 'publish' || $old_status == 'publish' || $post->post_type != 'movies', 'tvshows', 'episodes')
    return;

i want to have multiple option to trigger the script,

$post->post_type != 'movies', 'tvshows', 'episodes'

this for example or even this

$post->post_type != 'movies, tvshows, episodes'

none of these are working, anyone can help me how to fix this ?

Gerard de Visser
  • 7,590
  • 9
  • 50
  • 58

1 Answers1

1

You can use extra pair of parentheses for this in combination with or-operator:

if ($new_status != 'publish' || $old_status == 'publish' || $post->post_type != ('movies' || 'tvshows' || 'episodes'))
    return;
Gerard de Visser
  • 7,590
  • 9
  • 50
  • 58