base = $base; // Admin Notices. add_action( 'admin_notices', array( $this, 'admin_notices' ) ); } /** * Outputs a notice if the user is editing a Post, which has a meta key indicating * that status(es) were published to the API. * * @since 3.0.0 */ public function admin_notices() { // Check we can get the current screen the user is viewing. $screen = get_current_screen(); if ( ! $screen || ! isset( $screen->parent_base ) ) { return; } // Check we are on a Post based screen (includes Pages + CPTs). if ( $screen->base !== 'post' ) { return; } // Check we are editing a Post, Page or CPT. if ( $screen->parent_base !== 'edit' ) { return; } // Check we have a Post ID. if ( ! isset( $_GET['post'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification return; } $post_id = absint( $_GET['post'] ); // phpcs:ignore WordPress.Security.NonceVerification // Check if this Post has a success or error meta key set by this plugin. $success = get_post_meta( $post_id, '_' . $this->base->plugin->filter_name . '_success', true ); $error = get_post_meta( $post_id, '_' . $this->base->plugin->filter_name . '_error', true ); $errors = get_post_meta( $post_id, '_' . $this->base->plugin->filter_name . '_errors', true ); // Check for success. if ( $success ) { // Show notice and clear meta key, so we don't display this notice again. delete_post_meta( $post_id, '_' . $this->base->plugin->filter_name . '_success' ); ?>
base->plugin->displayName, $this->base->plugin->account ) ); ?>
base->plugin->displayName,
$this->base->plugin->account
)
);
?>
';
}
?>