__( 'SEO', 'wpinterface-seo' ), 'description' => __( 'Search engine optimization: titles, descriptions, analysis, redirects and indexing.', 'wpinterface-seo' ), ) ); } /** * Registers the abilities. */ public function register_abilities(): void { if ( ! function_exists( 'wp_register_ability' ) ) { return; } foreach ( ( new SeoAbilities( $this->plugin ) )->definitions() as $name => $args ) { if ( ! is_array( $args ) ) { continue; } $annotations = (array) ( $args['annotations'] ?? array() ); unset( $args['annotations'] ); $args['category'] = self::CATEGORY; $args['meta'] = array( 'annotations' => $annotations, 'public' => true, 'show_in_rest' => true, // MCP Adapter releases before WordPress 7.1 read this flag. 'mcp' => array( 'public' => true ), ); wp_register_ability( (string) $name, $args ); } } }