芝麻web文件管理V1.00
编辑当前文件:/home/mybf1/www/sabun.bf1.my/wp-content/plugins/all-in-one-seo-pack/app/Common/Api/Migration.php
oldOptions; if ( ! $oldOptions ) { return new \WP_REST_Response( [ 'success' => true, 'message' => 'Could not load v3 options.' ], 400 ); } $postTypes = aioseo()->helpers->getPublicPostTypes( true ); $taxonomies = aioseo()->helpers->getPublicTaxonomies( true ); foreach ( $oldOptions as $k => $v ) { if ( ! preg_match( '/^aiosp_([a-zA-Z]*)_title_format$/', $k, $match ) || ! empty( $v ) ) { continue; } $objectName = $match[1]; if ( in_array( $objectName, $postTypes, true ) && aioseo()->options->searchAppearance->dynamic->postTypes->has( $objectName ) ) { aioseo()->options->searchAppearance->dynamic->postTypes->$objectName->title = '#post_title #separator_sa #site_title'; continue; } if ( in_array( $objectName, $taxonomies, true ) && aioseo()->options->searchAppearance->dynamic->taxonomies->has( $objectName ) ) { aioseo()->options->searchAppearance->dynamic->taxonomies->$objectName->title = '#taxonomy_title #separator_sa #site_title'; } } aioseo()->migration->redoMetaMigration(); Models\Notification::deleteNotificationByName( 'v3-migration-title-formats-blank' ); return new \WP_REST_Response( [ 'success' => true, 'message' => 'Title formats have been reset; post/term migration has been scheduled.', 'notifications' => [ 'active' => Models\Notification::getAllActiveNotifications(), 'dismissed' => Models\Notification::getAllDismissedNotifications() ] ], 200 ); } }