* @since 3.0.0 */ namespace Beyondwords\Wordpress\Component\Posts\BulkEdit; use Beyondwords\Wordpress\Core\Core; use Beyondwords\Wordpress\Core\CoreUtils; use Beyondwords\Wordpress\Component\Settings\SettingsUtils; use Beyondwords\Wordpress\Plugin; /** * BulkEdit setup * * @since 4.5.0 */ class Notices { /** * Constructor */ public function init() { add_action('admin_notices', array($this, 'generatedNotice')); add_action('admin_notices', array($this, 'deletedNotice')); add_action('admin_notices', array($this, 'failedNotice')); add_action('admin_notices', array($this, 'errorNotice')); } /** * @since 4.1.0 */ public function generatedNotice() { if (! isset($_GET['beyondwords_bulk_edit_result_nonce'])) { return; } if (! wp_verify_nonce(sanitize_text_field($_GET['beyondwords_bulk_edit_result_nonce']), 'beyondwords_bulk_edit_result')) { // phpcs:ignore Generic.Files.LineLength.TooLong wp_nonce_ays(''); } $count = intval(sanitize_text_field($_GET['beyondwords_bulk_generated'] ?? '')); if ($count) { $message = sprintf( /* translators: %d is replaced with the number of posts processed */ _n( 'Audio was requested for %d post.', 'Audio was requested for %d posts.', $count, 'speechkit' ), $count ); ?>