| Server IP : 87.98.154.146 / Your IP : 216.73.216.50 Web Server : Apache System : Linux webm004.cluster126.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : ohklomafyi ( 52085) PHP Version : 7.4.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/ohklomafyi/www/wp-content/plugins/wp-seopress/inc/admin/page-builders/gutenberg/ |
Upload File : |
<?php
defined('ABSPATH') or exit('Please don’t call the plugin directly. Thanks :)');
global $wp_version;
$hook_name = version_compare( $wp_version, '5.8' ) >= 0 ? 'block_categories_all' : 'block_categories';
add_filter( $hook_name, 'seopress_register_block_categories' );
/**
* Declares a new category
*
* @param array $categories Existing categories
* @return array $categories
*/
function seopress_register_block_categories( $categories ) {
return array_merge(
$categories,[
[
'slug' => 'wpseopress',
'title' => __( 'SEO', 'wp-seopress' ),
],
]
);
}
/**
* Register blocks
*/
add_action( 'init', 'seopress_register_blocks', 10 );
function seopress_register_blocks() {
require_once __DIR__ . '/blocks/faq/block.php';
require_once __DIR__ . '/blocks/sitemap/block.php';
// FAQ Block
register_block_type( SEOPRESS_PATH_PUBLIC . '/editor/blocks/faq', [
'render_callback' => 'seopress_block_faq_render_frontend',
'attributes' => array(
'faqs' => array(
'type' => 'array',
'default' => array(),
'items' => array(
'type' => 'object',
),
),
'listStyle' => array(
'type' => 'string',
'default' => 'none'
),
'titleWrapper' => array(
'type' => 'string',
'default' => 'p'
),
'imageSize' => array(
'type' => 'string',
'default' => 'thumbnail'
),
'showFAQScheme' => array(
'type' => 'boolean',
'default' => false
),
'showAccordion' => array(
'type' => 'boolean',
'default' => false
),
'isProActive' => array(
'type' => 'boolean',
'default' => is_plugin_active( 'wp-seopress-pro/seopress-pro.php' )
),
),
]);
wp_set_script_translations( 'wpseopress/faq', 'wp-seopress' );
// Sitemap Block
register_block_type( SEOPRESS_PATH_PUBLIC . '/editor/blocks/sitemap', [
'render_callback' => 'seopress_sitemap_block',
'attributes' => [
'postTypes' => [
'type' => 'array',
'default' => []
],
'isSiteMapEnabled' => [
'type' => 'boolean',
'default' => ( '1' == seopress_get_toggle_option( 'xml-sitemap' ) ) && ( '1' === seopress_get_service('SitemapOption')->getHtmlEnable() )
],
'optionsPageUrl' => [
'type' => 'string',
'default' => add_query_arg( 'page', 'seopress-xml-sitemap', admin_url( 'admin.php' ) )
],
'fontSize' => [ 'type' => 'string' ],
'backgroundColor' => [ 'type' => 'string' ],
'style' => [ 'type' => 'object' ],
'textColor' => [ 'type' => 'string' ],
'gradient' => [ 'type' => 'string' ],
'className' => [ 'type' => 'string' ],
]
]);
wp_set_script_translations( 'wpseopress/sitemap', 'wp-seopress' );
}