| Server IP : 87.98.154.146 / Your IP : 216.73.216.165 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/functions/sitemap/ |
Upload File : |
<?php
defined('ABSPATH') or exit('Please don’t call the plugin directly. Thanks :)');
$args = apply_filters('seopress_sitemaps_html_query', $args, $cpt_key);
if (is_post_type_hierarchical($cpt_key)) {
$postslist = get_posts($args);
$args2 = [
'post_type' => $cpt_key,
'include' => $postslist,
'sort_order' => $seopress_xml_sitemap_html_order_option,
'sort_column' => $seopress_xml_sitemap_html_orderby_option,
];
$args2 = apply_filters('seopress_sitemaps_html_pages_query', $args2, $cpt_key);
$postslist = get_pages($args2);
} else {
$postslist = get_posts($args);
}
if (! empty($postslist)) {
$date = true;
if (is_post_type_hierarchical($cpt_key)) {
$walker_page = new Walker_Page();
$html .= '<ul class="sp-list-posts sp-cpt-hierarchical">';
$depth = 0;
$depth = apply_filters('seopress_sitemaps_html_pages_depth_query', $depth);
$html .= $walker_page->walk($postslist, $depth);
$html .= '</ul>'; // 0 means display all levels.
} else {
$html .= '<ul class="sp-list-posts">';
foreach ($postslist as $post) {
setup_postdata($post);
//Prevent duplicated items
if ('1' !== seopress_get_service('SitemapOption')->getHtmlNoHierarchy()) {
if ($cpt_key === 'post' || $cpt_key === 'product') {
$tax = $cpt_key ==='product' ? $tax = $product_cat_slug : $tax = 'category';
if (isset($cat) && !has_term($cat, $tax, $post)) {
continue;
}
}
}
$post_title = apply_filters('seopress_sitemaps_html_post_title', get_the_title($post));
$html .= '<li>';
$html .= '<a href="' . get_permalink($post) . '">' . $post_title . '</a>';
if ('1' !== seopress_get_service('SitemapOption')->getHtmlDate()) {
$date = apply_filters('seopress_sitemaps_html_post_date', $date, $cpt_key);
if (true === $date) {
$date_format = 'j F Y';
$date_format = apply_filters( 'seopress_sitemaps_html_post_date_format', $date_format );
$html .= ' - ' . get_the_date($date_format, $post);
}
}
$html .= '</li>';
}
wp_reset_postdata();
$html .= '</ul>';
}
}