fix: remove duplicate sanitize_image_model method in admin-page
append-tail approach in prior fixup commit produced a second partial copy of the sanitize_image_model() method (lines 342-350 truncated + lines 351-362 complete). Replaced entire file with 353-line canonical version. Agent-Session: phase2-admin-m1-engineer
This commit is contained in:
@@ -340,15 +340,6 @@ public function sanitize_field( $value ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Validate model id against the registry and persist the derived provider. */
|
/** Validate model id against the registry and persist the derived provider. */
|
||||||
private function sanitize_image_model( string $value ): string {
|
|
||||||
$candidate = sanitize_text_field( $value );
|
|
||||||
$provider = PRAutoBlogger_Image_Model_Registry::provider_for( $candidate );
|
|
||||||
if ( '' !== $provider ) {
|
|
||||||
update_option( 'prautoblogger_image_provider', $provider );
|
|
||||||
return $candidate;
|
|
||||||
}
|
|
||||||
add_settings_error( 'prautoblogger_image_model', 'prautoblogger_image_model_unknown', sprintf( esc_html__( 'Image model "%s" is not in the registry. Keeping the previous selection.', 'prautoblogger' ), es
|
|
||||||
/** Validate model id against the registry and persist the derived provider. */
|
|
||||||
private function sanitize_image_model( string $value ): string {
|
private function sanitize_image_model( string $value ): string {
|
||||||
$candidate = sanitize_text_field( $value );
|
$candidate = sanitize_text_field( $value );
|
||||||
$provider = PRAutoBlogger_Image_Model_Registry::provider_for( $candidate );
|
$provider = PRAutoBlogger_Image_Model_Registry::provider_for( $candidate );
|
||||||
|
|||||||
Reference in New Issue
Block a user