| @@ -21,9 +21,8 @@ | ||
| 21 | 21 | public static function init() { |
| 22 | 22 | \add_action( 'admin_menu', array( self::class, 'add_settings_page' ) ); |
| 23 | 23 | |
| 24 | 24 | \add_action( 'load-settings_page_activitypub', array( self::class, 'handle_welcome_query_arg' ) ); |
| 25 | - \add_action( 'load-settings_page_activitypub', array( self::class, 'handle_switch_object_type' ) ); | |
| 26 | 25 | } |
| 27 | 26 | |
| 28 | 27 | /** |
| 29 | 28 | * Load settings page. |
| @@ -286,31 +285,8 @@ | ||
| 286 | 285 | \update_user_meta( \get_current_user_id(), 'activitypub_show_welcome_tab', $welcome_checked ); |
| 287 | 286 | \wp_safe_redirect( \admin_url( 'options-general.php?page=activitypub&tab=settings' ) ); |
| 288 | 287 | exit; |
| 289 | 288 | } |
| 290 | - } | |
| 291 | - | |
| 292 | - /** | |
| 293 | - * Handle switching from legacy template mode to automatic object type. | |
| 294 | - * | |
| 295 | - * @since 8.0.0 | |
| 296 | - */ | |
| 297 | - public static function handle_switch_object_type() { | |
| 298 | - // phpcs:ignore WordPress.Security.NonceVerification.Recommended | |
| 299 | - if ( ! isset( $_GET['activitypub_update_object_type'] ) ) { | |
| 300 | - return; | |
| 301 | - } | |
| 302 | - | |
| 303 | - \check_admin_referer( 'activitypub_switch_object_type' ); | |
| 304 | - | |
| 305 | - if ( ! \current_user_can( 'manage_options' ) ) { | |
| 306 | - return; | |
| 307 | - } | |
| 308 | - | |
| 309 | - \update_option( 'activitypub_object_type', ACTIVITYPUB_DEFAULT_OBJECT_TYPE ); | |
| 310 | - | |
| 311 | - \wp_safe_redirect( \admin_url( 'options-general.php?page=activitypub&tab=settings' ) ); | |
| 312 | - exit; | |
| 313 | 289 | } |
| 314 | 290 | |
| 315 | 291 | /** |
| 316 | 292 | * Returns an array of recommended plugins for ActivityPub. |