Fix `store-title` endpoint - Pass default value to `get_option` (#50673)
* Pass default value to get_option * Add changefile(s) from automation for the following project(s): woocommerce --------- Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
parent
88e4a6f0e9
commit
3491c6b7dc
|
@ -0,0 +1,4 @@
|
|||
Significance: minor
|
||||
Type: fix
|
||||
|
||||
Fix `store-title` endpoint - Pass default value to `get_option`.
|
|
@ -86,8 +86,8 @@ class StoreTitle extends AIEndpoint {
|
|||
);
|
||||
}
|
||||
|
||||
$store_title = html_entity_decode( get_option( self::STORE_TITLE_OPTION_NAME ) );
|
||||
$previous_ai_generated_title = html_entity_decode( get_option( self::AI_STORE_TITLE_OPTION_NAME ) );
|
||||
$store_title = html_entity_decode( get_option( self::STORE_TITLE_OPTION_NAME, '' ) );
|
||||
$previous_ai_generated_title = html_entity_decode( get_option( self::AI_STORE_TITLE_OPTION_NAME, '' ) );
|
||||
|
||||
if ( strtolower( trim( self::DEFAULT_TITLE ) ) === strtolower( trim( $store_title ) ) || ( ! empty( $store_title ) && $previous_ai_generated_title !== $store_title ) ) {
|
||||
return rest_ensure_response( array( 'ai_content_generated' => false ) );
|
||||
|
|
Loading…
Reference in New Issue