The-seo-framework: notice (undefined variable) in the_seo_framework_sitemap_exclude_ids filter

Created on 18 Jun 2018  路  3Comments  路  Source: sybrew/the-seo-framework

Hello,
I got these errors when I using the_seo_framework_sitemap_exclude_ids filter.

Notice: Undefined variable: included in /Users/Me/Documents/_www/htdocs_project/wordpress/wp-content/plugins/autodescription/inc/classes/sitemaps.class.php on line 1075

Solution is easy (I think), just add $included variable (with false value) to top of the is_post_included_in_sitemap() method (which is defined in /inc/classes/sitemaps.class.php - at line 1052).

Thank you!! :)

[Type] Bug

All 3 comments

This was reported on WordPress.org earlier. Thanks for reminding me!

Here's a valid and sustainable workaround, it is by prepending a ID of -1 (because false can result to 0):

add_filter( 'the_seo_framework_sitemap_exclude_ids', 'my_sitemap_exclude_ids' );
function my_sitemap_exclude_ids() {
    $ids = array( -1, 1086 );

    return $ids;
}

Oh, thanks for very fast reply and for the valid and sustainable workaround :). Have a nice day.

Whoops... I got myself confused.

The issue I mentioned was resolved in 3.0.6.

The fix for this issue was brought in 6187fdd during sanity checks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ratzrattillo picture ratzrattillo  路  3Comments

epgunn picture epgunn  路  3Comments

ViktorSander picture ViktorSander  路  5Comments

sybrew picture sybrew  路  6Comments

wassim picture wassim  路  5Comments