wp_create_nonce( 'ajax-nonce' ), 'ajaxurl' => admin_url( 'admin-ajax.php' ), 'showModal' => self::should_show_modal(), ] ); if ( self::should_show_modal() ) { // user modal needs thickbox (and thus jquery). add_thickbox(); // Also needs to output the markup for use in the modal. add_action( 'admin_footer', [ $this, 'render_modal' ] ); } } /** * Renders the opt-in modal markup that thickbox plucks content from to display. * * @return void */ public function render_modal(): void { ?>

', '' ); ?>