Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function daz_custom_field_on_publish( $new, $old, $post ) {
- $unixtime = date(strtotime("+1 week"));
- $now = date("m/d/Y",$unixtime);
- if ( $new == 'publish' && $old == 'pending') {
- update_post_meta( $post->ID, '_post_expiration_date', $now );
- }
- }
- add_action( 'transition_post_status', 'daz_custom_field_on_publish', 10, 3 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement