PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / trunk
Yoast SEO – Advanced SEO with real-time guidance and built-in AI vtrunk
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / src / abilities / user-interface / ability-categories-integration.php

ability-categories-integration.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI trunk, at src/abilities/user-interface/ability-categories-integration.php

50 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
4 namespace Yoast\WP\SEO\Abilities\User_Interface;
5
6 use Yoast\WP\SEO\Conditionals\Abilities_API_Conditional;
7 use Yoast\WP\SEO\Integrations\Integration_Interface;
8
9 /**
10 * Integration that registers Yoast SEO ability categories with the WordPress Abilities API.
11 */
12 class Ability_Categories_Integration implements Integration_Interface {
13
14 public const CATEGORY_SLUG = 'yoast-seo';
15
16 /**
17 * Returns the conditionals based on which this loadable should be active.
18 *
19 * @return array<string> The conditionals.
20 */
21 public static function get_conditionals() {
22 return [ Abilities_API_Conditional::class ];
23 }
24
25 /**
26 * Registers hooks with WordPress.
27 *
28 * @return void
29 */
30 public function register_hooks() {
31 \add_action( 'wp_abilities_api_categories_init', [ $this, 'register_categories' ] );
32 }
33
34 /**
35 * Registers the Yoast SEO ability category.
36 *
37 * @return void
38 */
39 public function register_categories() {
40 \wp_register_ability_category(
41 self::CATEGORY_SLUG,
42 [
43 'label' => 'Yoast SEO',
44 /* translators: %s expands to Yoast SEO */
45 'description' => \sprintf( \__( 'Abilities for %s data and operations.', 'wordpress-seo' ), 'Yoast SEO' ),
46 ],
47 );
48 }
49 }
50