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
}
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.