| Server IP : 213.186.33.4 / Your IP : 216.73.216.146 Web Server : Apache System : Linux webm005.cluster103.gra.hosting.ovh.net 6.18.39-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Tue Jul 21 12:03:15 CEST 2026 x86_64 User : karinebmkh ( 644538) PHP Version : 8.4.22 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/karinebmkh/www2/wp-content/plugins/wordpress-seo/inc/ |
Upload File : |
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin
*/
/**
* Class to load assets required for structured data blocks.
*/
class WPSEO_Structured_Data_Blocks implements WPSEO_WordPress_Integration {
/**
* @var WPSEO_Admin_Asset_Manager
*/
protected $asset_manager;
/**
* WPSEO_Structured_Data_Blocks constructor.
*/
public function __construct() {
$this->asset_manager = new WPSEO_Admin_Asset_Manager();
}
/**
* Registers hooks for Structured Data Blocks with WordPress.
*/
public function register_hooks() {
add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_block_editor_assets' ) );
add_filter( 'block_categories', array( $this, 'add_block_category' ) );
$block_integrations = array(
new WPSEO_How_To_Block(),
new WPSEO_FAQ_Block(),
);
foreach ( $block_integrations as $block_integration ) {
$block_integration->register_hooks();
}
}
/**
* Enqueue Gutenberg block assets for backend editor.
*/
public function enqueue_block_editor_assets() {
$this->asset_manager->enqueue_script( 'structured-data-blocks' );
$this->asset_manager->enqueue_style( 'structured-data-blocks' );
}
/**
* Adds the structured data blocks category to the Gutenberg categories.
*
* @param array $categories The current categories.
*
* @return array The updated categories.
*/
public function add_block_category( $categories ) {
$categories[] = array(
'slug' => 'yoast-structured-data-blocks',
'title' => sprintf(
/* translators: %1$s expands to Yoast. */
__( '%1$s Structured Data Blocks', 'wordpress-seo' ),
'Yoast'
),
);
return $categories;
}
}