??????????????
??????????????
??????????????
??????????????
Warning : Undefined variable $auth in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
Warning : Trying to access array offset on value of type null in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
??????????????
??????????????
??????????????
??????????????
File Manager
✏️ Edit File: /home/mklsvubc/netecfwd.co.uk/wp-content/plugins/siteseo/main/primarycategory.php
⬅ Kembali
<?php
/*
* SITESEO
* https://siteseo.io
* (c) SiteSEO Team
*/
namespace SiteSEO;
if(!defined('ABSPATH')){
die('HACKING ATTEMPT!');
}
class PrimaryCategory{
static function wc_primary_category($none_terms, $terms, $post){
$primary_cat = null;
if(!empty($post)){
$wc_primary_cat = get_post_meta($post->ID, '_siteseo_robots_primary_cat', true);
if(isset($wc_primary_cat) && '' != $wc_primary_cat && 'none' != $wc_primary_cat){
if(null != $post->post_type && 'product' == $post->post_type){
$primary_cat = get_term($wc_primary_cat, 'product_cat');
}
if(!is_wp_error($primary_cat) && null != $primary_cat){
return $primary_cat;
}
} else{
return $none_terms;
}
} else{
return $none_terms;
}
}
static function add_primary_category($none_cate, $cats, $post){
$primary_cat = null;
if(!empty($post)){
$robots_primary_cat = get_post_meta($post->ID, '_siteseo_robots_primary_cat', true);
if(isset($robots_primary_cat) && '' != $robots_primary_cat && 'none' != $robots_primary_cat){
if(null != $post->post_type && 'post' == $post->post_type){
$primary_cat = get_category($robots_primary_cat);
}
if(!is_wp_error($primary_cat) && null != $primary_cat){
return $primary_cat;
}
} else{
return $none_cate;
}
} else{
return $none_cate;
}
}
static function replace_breadcrumb_categories($crumbs, $breadcrumb){
if(!is_product()){
return $crumbs;
}
global $post;
$primary_cat_id = get_post_meta($post->ID, '_siteseo_robots_primary_cat', true);
if(!empty($primary_cat_id) && $primary_cat_id !== 'none'){
$primary_cat = get_term($primary_cat_id, 'product_cat');
if(!empty($primary_cat) && !is_wp_error($primary_cat)){
$new_crumbs = [];
foreach($crumbs as $key => $crumb){
if($key === 0 || (isset($crumb[1]) && strpos($crumb[1], '?post_type=product') !== false)){
$new_crumbs[] = $crumb;
}
}
$ancestors = get_ancestors($primary_cat->term_id, 'product_cat');
$ancestors = array_reverse($ancestors);
foreach($ancestors as $ancestor_id){
$ancestor = get_term($ancestor_id, 'product_cat');
if(!empty($ancestor) && !is_wp_error($ancestor)){
$new_crumbs[] = [
$ancestor->name,
get_term_link($ancestor)
];
}
}
if(!empty($primary_cat) && !is_wp_error($primary_cat)){
$new_crumbs[] = [
$primary_cat->name,
get_term_link($primary_cat)
];
}
if(count($crumbs) > 0){
$new_crumbs[] = $crumbs[count($crumbs) - 1];
}
return $new_crumbs;
}
}
return $crumbs;
}
}
Nama
Tipe
Ukuran
Diubah
Aksi
📁 metaboxes
dir
—
2026-06-20 08:29
📁 settings
dir
—
2026-06-20 08:29
🐘 admin.php
php
23.1 KB
2026-04-08 12:30
🐘 advanced.php
php
6.9 KB
2025-11-17 13:44
🐘 ajax.php
php
21.6 KB
2025-12-25 09:57
🐘 columns.php
php
5.5 KB
2026-03-24 13:54
🐘 generatesitemap.php
php
26.2 KB
2026-06-02 10:13
🐘 googleanalytics.php
php
26 KB
2026-06-02 10:13
🐘 imageseo.php
php
3.1 KB
2026-03-24 13:54
🐘 import.php
php
38 KB
2026-06-02 10:13
🐘 install.php
php
5.7 KB
2025-09-04 11:06
🐘 instantindexing.php
php
8.9 KB
2025-12-16 12:59
🐘 primarycategory.php
php
2.6 KB
2025-08-22 11:17
🐘 socialmetas.php
php
28.6 KB
2026-06-02 10:13
🐘 tableofcontent.php
php
5.3 KB
2025-02-04 10:14
🐘 titlesmetas.php
php
31.8 KB
2026-06-02 10:13