/** * Save the popup data to database. * * Intentionally no nonce-check: We want to validate the popup-positions * every time a popup is modified, regardless from where the change was * initiated. * * @since 4.6.0 * @param int $post_id Post ID that was saved/created * @param WP_Post $post Post object that was saved/created * @param bool $update True means the post was updated (not created) */ public static function post_check_order($post_id, $post, $update) { $popup = IncPopupDatabase::get($post_id); // Autosave is not processed. if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { return; } // This save event is for a different post type... ?? if ($popup->id != $post_id) { return; } // User does not have permissions for this. if (!current_user_can(IncPopupPosttype::$perms)) { return; } IncPopupDatabase::refresh_order(); }