Changing Status when expired
-
Open simple-post-expiration.php
Replace Line 84 to end, to this instead:
/** * Filters the post titles * * @access public * @since 1.0 * @return void */ function pw_spe_filter_title( $title = '', $post_id = 0 ) { if( pw_spe_is_expired( $post_id ) ) { // Post is expired so attach the prefix $prefix = get_option( 'pw_spe_prefix', __( 'Expired:', 'pw-spe' ) ); $title = $prefix . ' ' . $title; //Change Post post_status wp_update_post(array( 'ID' => $post_id, 'post_status' => 'draft' )); } return $title; } add_filter( 'the_title', 'pw_spe_filter_title', 100, 2 );
Changes post to Draft when expired
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Changing Status when expired’ is closed to new replies.