Last active
September 28, 2017 06:21
-
-
Save haleeben/959d1e57a91b0795d13e3942e86c3a24 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'transition_post_status', 'update_expired_post_meta', 10, 3 ); | |
function update_expired_post_meta( $new_publish_status, $old_publish_status, $post ){ | |
if( 'expired' == $new_publish_status ){ | |
// Change the ACF field value to false | |
update_field( 'field_name', false, $post->ID ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment