WordPress 7.0 is out and most of the coverage is about the admin reskin. The part that will change your code is the WordPress 7.0 AI Client. We have spent years hand-rolling integrations for OpenAI, Anthropic and Claude, each one with its own auth, its own error shape and its own reason to break on a Friday. Core now ships a standardized, provider-agnostic PHP API instead.
I have been waiting for this consolidation, as anyone who read why the WordPress AI client ecosystem changes everything already knows. The WordPress 7.0 AI Client is a two-layer architecture rather than a thin wrapper, and the second layer exists to absorb the model-of-the-week churn.
The architecture: SDK and wrapper
The naming convention is where people will trip. WordPress bundles wordpress/php-ai-client, a standalone PHP SDK, and because that SDK is platform-agnostic it uses camelCase and throws exceptions. The WordPress wrapper sitting on top of it, which is the part you write against, follows WP conventions: snake_case and WP_Error objects.
That split is worth having. You can call wp_ai_client_prompt() without a try-catch quietly eating your logs. Credentials also stop being your problem, since the Connectors API holds them. The site owner configures a key once and your plugin never touches it.
Generating text with the WordPress 7.0 AI client
The entry point is a fluent builder. Describe what you want, set your parameters such as temperature or max tokens, and send it. Here it is generating an SEO summary, which is about as close to real plugin code as an example gets:
<?php
/**
* Generate a post summary using the WordPress 7.0 AI Client.
*
* @param int $post_id The post ID.
* @return string|WP_Error The summary or error.
*/
function bbioon_generate_ai_summary( $post_id ) {
$post_content = get_post_field( 'post_content', $post_id );
if ( empty( $post_content ) ) {
return new WP_Error( 'no_content', 'Post has no content to summarize.' );
}
// Initialize the builder via the WordPress 7.0 AI Client entry point
$result = wp_ai_client_prompt( 'Summarize this content in two sentences.' )
->using_system_instruction( 'You are an SEO expert.' )
->using_temperature( 0.5 )
->with_text( $post_content )
->generate_text();
if ( is_wp_error( $result ) ) {
// Log the bottleneck or race condition if needed
error_log( 'AI Generation failed: ' . $result->get_error_message() );
return $result;
}
return wp_kses_post( $result );
}
There is no model named anywhere in that call, and that is deliberate. The client resolves it through the Model Preference system, so a site with Anthropic configured gets Claude and a site on OpenAI gets GPT-4o. For a plugin you hand to strangers, that abstraction is the whole point.
Image generation and multi-modal output
Text is not the only thing it does. The WordPress 7.0 AI Client generates images through generate_image() and hands back a File DTO, which beats wiring up S3 uploads or juggling file system transients yourself.
Feature detection comes before any AI-powered UI. Plenty of sites will have no provider connected at all, and a dead “Generate Image” button is worse than no button, so wrap the UI registration in a support check.
<?php
$builder = wp_ai_client_prompt( 'test' );
if ( $builder->is_supported_for_image_generation() ) {
// Register your block or admin setting here
}
Migrating a legacy integration
If you bundle the standalone php-ai-client library through Composer, stop. Core loads those classes as of WordPress 7.0, and loading them a second time is a fatal error from duplicate class definitions. I have watched it take out dozens of staging sites already.
The exact autoloader workarounds are in the WordPress 7.0 Release merger details, which is what you want if the plugin still has to run on older WP versions. The short version: your vendor/autoload.php call needs a version check wrapped around it.
If this WordPress 7.0 AI client work is eating your dev hours, I do it for a living. I have been wrestling with WordPress since the 4.x days.
Where this leaves plugin devs
The WordPress 7.0 AI Client mostly buys you stability. With the logic in Core you get one hook system (wp_ai_client_prevent_prompt) and one way to handle errors, instead of a different pattern per provider. The official Dev Note and the PHP AI Client repository on GitHub have the rest of the detail. Ship it, but test your feature detection first.