| Server IP : 62.60.133.156 / Your IP : 216.73.217.51 Web Server : LiteSpeed System : Linux linux24.centraldnserver.com 4.18.0-553.141.2.lve.el8.x86_64 #1 SMP Wed Jul 8 16:10:02 UTC 2026 x86_64 User : mimradmin ( 1166) PHP Version : 7.4.33 Disable Function : show_source, system, shell_exec, passthru, exec, popen, proc_open MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/mimradmin/www/wp-content/themes/woodmart/inc/modules/seo-scheme/ |
Upload File : |
<?php
/**
* Breadcrumbs schema.
*
* @package woodmart
*/
namespace XTS\Modules\Seo_Scheme;
use XTS\Singleton;
/**
* Faq schema.
*
* @package woodmart
*/
class Breadcrumbs extends Singleton {
/**
* Breadcrumb schema.
*
* @var array
*/
public array $schema_items = array();
/**
* Init.
*
* @return void
*/
public function init() {
add_filter( 'wp_footer', array( $this, 'output_schema' ) );
}
/**
* Set schema.
*
* @param array $schema Schema.
* @return void
*/
public function set_schema_items( $schema ) {
$this->schema_items = $schema;
}
/**
* Output faq schema.
*
* @return void
*/
public function output_schema() {
if ( $this->schema_items ) {
?>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [<?php echo wp_json_encode( $this->schema_items, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE ); ?>]
}
</script>
<?php
}
}
}
Breadcrumbs::get_instance();