/** * Internal event called when a link is saved * * @param int $id ID of the post * @internal */ public function _onSave($id) { if (!current_user_can('manage_links')) { return; } parent::_onSave($id); }
/** * Internal event called when a post is saved * * @param int $id ID of the post * @internal */ public function _onSave($id) { // Skip if autosaving if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { return; } // Verify our own nonce, return if failed if (!isset($_POST[$this->name . '-nonce']) || !wp_verify_nonce($_POST[$this->name . '-nonce'], $this->name . '-metabox')) { return; } /* Enforced by this class: ensure we don't try to work with revisions */ if ($post_id = wp_is_post_revision($id)) { $id = $post_id; } parent::_onSave($id); }