/**
* IKAI Unified Organization Schema
*
* Purpose:
* - Use ONE Organization entity across Indonesian and English pages.
* - Enrich Yoast SEO's native Organization schema.
* - Prevent language-specific Organization IDs.
* - Ensure WebSite, homepage and Article nodes reference the same company.
*
* Canonical Organization ID:
* https://intikeramik.com/#organization
*/
/**
* Return the single canonical Organization ID.
*/
function ikai_schema_organization_id() {
return 'https://intikeramik.com/#organization';
}
/**
* 1. Normalize and enrich Yoast's Organization node.
*/
add_filter( 'wpseo_schema_organization', 'ikai_schema_organization', 20, 2 );
function ikai_schema_organization( $data, $context ) {
$organization_id = ikai_schema_organization_id();
/*
* Corporation is a subtype of Organization.
* Keeping both types maintains broad Organization semantics
* while allowing the tickerSymbol property.
*/
$data['@type'] = array(
'Organization',
'Corporation',
);
/*
* One stable entity ID across the entire multilingual site.
*/
$data['@id'] = $organization_id;
/*
* Corporate identity.
*/
$data['name'] = 'PT Intikeramik Alamasri Industri Tbk';
$data['legalName'] = 'PT Intikeramik Alamasri Industri Tbk';
$data['alternateName'] = 'IKAI';
/*
* Always use the main Indonesian/root corporate URL
* as the Organization URL, including on English pages.
*/
$data['url'] = 'https://intikeramik.com/';
/*
* Schema.org recommends exchange + ticker.
* XIDX is the MIC for Indonesia Stock Exchange.
*/
$data['tickerSymbol'] = 'XIDX IKAI';
/*
* Independent authoritative identity reference.
*/
$data['sameAs'] = array(
'https://www.idx.co.id/id/perusahaan-tercatat/profil-perusahaan-tercatat/IKAI',
);
/*
* IMPORTANT:
* Do not overwrite Yoast's existing logo/image data.
* Yoast already generates the company logo correctly.
*/
return $data;
}
/**
* 2. Make every Yoast WebSite node use the same Organization
* as its publisher.
*
* This is especially important for /en/home/, because otherwise
* multilingual configuration can create a second Organization ID.
*/
add_filter( 'wpseo_schema_website', 'ikai_schema_website_publisher', 20 );
function ikai_schema_website_publisher( $data ) {
$data['publisher'] = array(
'@id' => ikai_schema_organization_id(),
);
return $data;
}
/**
* 3. Make the homepage explicitly about the corporate Organization.
*
* Applies to both:
* https://intikeramik.com/
* https://intikeramik.com/en/home/
*/
add_filter( 'wpseo_schema_webpage', 'ikai_schema_homepage_about', 20 );
function ikai_schema_homepage_about( $data ) {
if ( is_front_page() || is_page( 'home' ) ) {
$data['about'] = array(
'@id' => ikai_schema_organization_id(),
);
}
return $data;
}
/**
* 4. Ensure all Yoast Article schema uses the same corporate publisher.
*
* This prevents Indonesian and English articles from accidentally
* referring to different Organization entity IDs.
*/
add_filter( 'wpseo_schema_article', 'ikai_schema_article_publisher', 20 );
function ikai_schema_article_publisher( $data ) {
$data['publisher'] = array(
'@id' => ikai_schema_organization_id(),
);
return $data;
}