1 ) $skipAndLockStateClass = 'onp-sl-skip-lock-2-state'; } $ruleStateClass = ''; $defaultWay = 'skip-lock'; if ( !empty($options) ) $defaultWay = $options['way']; $skipNumber = 1; if ( !empty($options) && $options['way'] == 'skip-lock' ) { $skipNumber = intval( $options['skip_number'] ); } $cssSelector = ''; if ( !empty($options) && $options['way'] == 'css-selector' ) { $cssSelector = urldecode( $options['css_selector'] ); } $excludePosts = ''; if ( !empty($options) && !empty( $options['exclude_posts'] ) ) { $excludePosts = implode(', ', $options['exclude_posts']); $ruleStateClass .= ' onp-sl-exclude-post-ids-rule-state'; } $excludeCategories = ''; if ( !empty($options) && !empty( $options['exclude_categories'] ) ) { $excludeCategories = implode(', ', $options['exclude_categories']); $ruleStateClass .= ' onp-sl-exclude-categories-ids-rule-state'; } $postTypes = ''; if ( !empty($options) && !empty( $options['post_types'] ) ) { $postTypes = implode(', ', $options['post_types'] ); $ruleStateClass .= ' onp-sl-post-types-rule-state'; } ?>

post_type !== OPANDA_POST_TYPE ) return true; opanda_clear_batch_lock_cache($postId); return true; } add_action('delete_post', 'opanda_clear_bulk_locker_options_on_deletion'); /** * Update global bulk locker options on changing a locker status. * * Deletes bulk locking options on a locker deletion on moving to trash. * And reset options on retoring from the trash. * * @since 3.0.0 * @return void */ function opanda_update_bulk_locker_options_on_changing_status( $new_status, $old_status, $post ) { if ( empty( $post) ) return true; if ( $post->post_type !== OPANDA_POST_TYPE ) return true; if ( $new_status == 'trash' ) { opanda_clear_batch_lock_cache($post->ID); } elseif ( $new_status !== 'trash' ) { opanda_update_batch_lock_cache($post->ID); } } add_action('transition_post_status', 'opanda_update_bulk_locker_options_on_changing_status', 10, 3 );