From 4d9c4dac6fc1449f221a0e765a3d66445c709c82 Mon Sep 17 00:00:00 2001 From: Mike Hemberger Date: Thu, 3 Sep 2020 10:14:27 -0400 Subject: [PATCH] Sitemap filters & vbump 1.11.7 --- CHANGES.md | 3 +++ lib/functions/display.php | 52 ++++++++++++++++++++++++--------------- mai-theme-engine.php | 4 +-- 3 files changed, 37 insertions(+), 22 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index a2ec754..29be29e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,8 @@ # Changelog +## 1.11.7 (9/3/20) +* Changed: Added sitemap content type PHP filters. + ## 1.11.6 (8/21/20) * Fixed: Compatibility with WP 5.5, deprecated `wp_make_content_images_responsive()` in favor of `wp_filter_content_tags()` when available. * Changed: Update updater. diff --git a/lib/functions/display.php b/lib/functions/display.php index a958cc1..356689c 100644 --- a/lib/functions/display.php +++ b/lib/functions/display.php @@ -608,26 +608,38 @@ function mai_get_sitemap() { $post_counts = wp_count_posts(); if ( $post_counts->publish > 0 ) { - $sitemap .= sprintf( '<%2$s>%1$s', __( 'Categories:', 'mai-theme-engine' ), $heading ); - $sitemap .= sprintf( '', wp_list_categories( array( - 'number' => $number, - 'sort_column' => 'name', - 'title_li' => '', - 'echo' => false, - ) ) ); - $sitemap .= sprintf( '<%2$s>%1$s', __( 'Authors:', 'mai-theme-engine' ), $heading ); - $sitemap .= sprintf( '', wp_list_authors( array( - 'number' => $number, - 'exclude_admin' => false, - 'optioncount' => true, - 'echo' => false, - ) ) ); - $sitemap .= sprintf( '<%2$s>%1$s', __( 'Monthly:', 'mai-theme-engine' ), $heading ); - $sitemap .= sprintf( '', wp_get_archives( array( - 'number' => $number, - 'type' => 'monthly', - 'echo' => false, - ) ) ); + + if ( apply_filters( 'mai_sitemap_show_categories', true ) ) { + + $sitemap .= sprintf( '<%2$s>%1$s', __( 'Categories:', 'mai-theme-engine' ), $heading ); + $sitemap .= sprintf( '', wp_list_categories( array( + 'number' => $number, + 'sort_column' => 'name', + 'title_li' => '', + 'echo' => false, + ) ) ); + } + + if ( apply_filters( 'mai_sitemap_show_authors', true ) ) { + + $sitemap .= sprintf( '<%2$s>%1$s', __( 'Authors:', 'mai-theme-engine' ), $heading ); + $sitemap .= sprintf( '', wp_list_authors( array( + 'number' => $number, + 'exclude_admin' => false, + 'optioncount' => true, + 'echo' => false, + ) ) ); + } + + if ( apply_filters( 'mai_sitemap_show_monthly', true ) ) { + + $sitemap .= sprintf( '<%2$s>%1$s', __( 'Monthly:', 'mai-theme-engine' ), $heading ); + $sitemap .= sprintf( '', wp_get_archives( array( + 'number' => $number, + 'type' => 'monthly', + 'echo' => false, + ) ) ); + } } return $sitemap; diff --git a/mai-theme-engine.php b/mai-theme-engine.php index 9671673..560aeba 100644 --- a/mai-theme-engine.php +++ b/mai-theme-engine.php @@ -5,7 +5,7 @@ * Plugin URI: https://maitheme.com/ * Description: The Mai Theme Engine plugin * - * Version: 1.11.6 + * Version: 1.11.7 * * GitHub URI: maithemewp/mai-theme-engine * @@ -89,7 +89,7 @@ public function __wakeup() { private function setup_constants() { // Plugin version. - define( 'MAI_THEME_ENGINE_VERSION', '1.11.6' ); + define( 'MAI_THEME_ENGINE_VERSION', '1.11.7' ); // DB version. define( 'MAI_THEME_ENGINE_DB_VERSION', '1600' );