%s

', sprintf( /* translators: %1$d = seconds, %2$d = batch size */ esc_html__( 'This tool scans your image library in batches of %2$d (pausing %1$d seconds between batches) and regenerates alt text that is missing or merely filename-based, leaving genuine descriptions untouched.', 'ai-auto-alt-text-generator' ), $delay, $batch_size ) ); ?>

' . esc_html( $webhook_url ) . '' ); } else { printf( /* translators: %s = link to the Settings tab */ wp_kses( __( 'Send a POST to your own endpoint whenever alt text or a title is generated. Add a URL under %s.', 'ai-auto-alt-text-generator' ), array( 'a' => array( 'href' => array(), 'data-aatg-tab' => array() ) ) ), '' . esc_html__( 'Settings → Integrations & Webhooks', 'ai-auto-alt-text-generator' ) . '' ); } ?>

ai-auto-alt-text/generate-alt-text

  • aatg_generate_on_upload —
  • aatg_models —
  • aatg_alt_text_prompt / aatg_image_title_prompt —
  • aatg_image_context —
  • aatg_request_payload — (aatg_openai_request_payload )
  • aatg_api_key / aatg_provider_endpoint —
  • aatg_generated_alt_text / aatg_generated_title —
  • aatg_max_image_bytes —
  • aatg_is_low_quality_alt —
  • aatg_webhook_payload —
  • aatg_after_alt_text_generated / aatg_after_title_generated / aatg_after_generation —
admin_url( 'admin-ajax.php' ), 'nonce' => wp_create_nonce( 'aatg_nonce' ), 'delay' => (int) get_option( 'aatg_bulk_delay', 3 ), 'i18n' => array( 'initialising' => __( 'Initialising…', 'ai-auto-alt-text-generator' ), /* translators: 1: images scanned so far, 2: total images, 3: images regenerated */ 'progress' => __( 'Scanned %1$s of %2$s images · regenerated %3$s', 'ai-auto-alt-text-generator' ), /* translators: 1: total images, 2: images regenerated */ 'complete' => __( 'Bulk update complete — scanned %1$s images, regenerated %2$s.', 'ai-auto-alt-text-generator' ), 'error' => __( 'Error:', 'ai-auto-alt-text-generator' ), 'errorLabel' => __( 'Error', 'ai-auto-alt-text-generator' ), 'warning' => __( 'Warning', 'ai-auto-alt-text-generator' ), 'batch' => __( 'Batch', 'ai-auto-alt-text-generator' ), 'unknownError' => __( 'Unknown error.', 'ai-auto-alt-text-generator' ), /* translators: %s: number of log entries */ 'logOne' => __( 'Bulk update log (%s item)', 'ai-auto-alt-text-generator' ), /* translators: %s: number of log entries */ 'logMany' => __( 'Bulk update log (%s items)', 'ai-auto-alt-text-generator' ), ), ) ); } add_action( 'admin_enqueue_scripts', 'aatg_enqueue_dashboard_assets' ); /** * Media → Bulk Alt Text Update (redirects to Tools page via load-hook). */ function aatg_register_media_submenu_redirect() { $hook = add_submenu_page( 'upload.php', __( 'Bulk Alt Text Update', 'ai-auto-alt-text-generator' ), __( 'Bulk Alt Text Update', 'ai-auto-alt-text-generator' ), 'manage_options', // keep as-is for now 'aatg-bulk-update-media', 'aatg_bulk_media_redirect' // still required, but won’t run visibly ); // Redirect as early as possible when this page loads. add_action( "load-{$hook}", function () { wp_safe_redirect( admin_url( 'tools.php?page=aatg-bulk-update' ) ); exit; } ); } add_action( 'admin_menu', 'aatg_register_media_submenu_redirect', 15 ); /** * Fallback (shouldn’t be seen thanks to the load-hook redirect). */ function aatg_bulk_media_redirect() { // In case the load-hook didn’t fire for any reason. wp_safe_redirect( admin_url( 'tools.php?page=aatg-bulk-update' ) ); exit; } function aatg_plugin_action_links( $links ) { $settings_url = admin_url( 'options-general.php?page=aatg-settings' ); $bulk_url = admin_url( 'tools.php?page=aatg-bulk-update' ); array_unshift( $links, sprintf( '%s', esc_url( $bulk_url ), esc_html__( 'Bulk Update', 'ai-auto-alt-text-generator' ) ), sprintf( '%s', esc_url( $settings_url ), esc_html__( 'Settings', 'ai-auto-alt-text-generator' ) ) ); return $links; } add_filter( 'plugin_action_links_' . plugin_basename( AATG_PLUGIN_FILE ), 'aatg_plugin_action_links' );