page_slug, array( $this, 'render_page' ) ); } /** * Enqueue scripts * * @param string $hook Current admin page hook. */ public function enqueue_scripts( $hook ) { if ( strpos( $hook, $this->page_slug ) === false ) { return; } // Styles wp_enqueue_style( 'aitm-regenerate', AITM_PLUGIN_URL . 'assets/dist/regenerate.css', array(), AITM_VERSION ); // Scripts wp_enqueue_script( 'aitm-regenerate', AITM_PLUGIN_URL . 'assets/dist/regenerate.js', array( 'jquery' ), AITM_VERSION, true ); // Localization wp_localize_script( 'aitm-regenerate', 'aitmRegenerateData', array( 'ajaxUrl' => admin_url( 'admin-ajax.php' ), 'nonce' => wp_create_nonce( 'aitm_nonce' ), 'strings' => array( 'error' => __( 'Error', 'ai-thumbnails-maker' ), 'completed' => __( 'Regeneration completed!', 'ai-thumbnails-maker' ), 'stopped' => __( 'Regeneration stopped.', 'ai-thumbnails-maker' ), ), ) ); } /** * Render page */ public function render_page() { if ( ! current_user_can( 'manage_options' ) ) { return; } ?>
Settings → Media or switching themes.', 'ai-thumbnails-maker' ), array( 'a' => array( 'href' => array(), ), ) ), esc_url( admin_url( 'options-media.php' ) ) ); ?>
-