esc_url_raw( rest_url() ), 'nonce' => wp_create_nonce( 'wp_rest' ), 'messages' => array( 'generating' => __( 'Generating audio... Please wait.', 'wpthemoon' ), 'success' => __( 'Podcast generated and inserted successfully!', 'wpthemoon' ), 'error' => __( 'Failed to generate podcast. Please try again.', 'wpthemoon' ), ), ) ); } /** * Classic Editor: 加载后台脚本 */ public function enqueue_admin_assets( $hook ) { if ( 'post.php' !== $hook && 'post-new.php' !== $hook ) { return; } $this->register_podcast_script(); } /** * Gutenberg/Block Editor: 加载后台脚本 */ public function enqueue_block_editor_assets() { $this->register_podcast_script(); } }