flash_notice( esc_html__( 'Invalid post.', 'ai-content-writer' ), 'error' ); // Redirect back to the previous page. wp_safe_redirect( admin_url( 'admin.php?page=ai-content-writer' ) ); exit(); } // Generate images for the prompt. $images = ai_content_writer()->generate_images( wp_strip_all_tags( html_entity_decode( $post->post_title, ENT_QUOTES, get_bloginfo( 'charset' ) ) ) ); // Output has already started on this admin page, so show errors inline instead of redirecting. if ( is_wp_error( $images ) ) { ?>

get_error_message() ); ?>