Support

Account

Home Forums General Issues Set post publish date by custom field? Reply To: Set post publish date by custom field?

  • @mfgrijs All ACF filters and actions should do some basic checking, yes you can use the same code for multiple post types.

    
    add_action('acf/save_post', 'FUNCTION_NAME');
    function FUNCTION_NAME($post_id) {
      $post_type = get_post_type($post_id);
      if ($post_type != 'tv' && $post_type != 'radio')) {
        // not your post type
        // do not run
        return;
      }
      // .... more code here
    }