lesterchan/wp-sweep

Polylang

Closed this issue · 5 comments

I think language and post_translations are swept out in "Orphaned Term Relationship" while belonging to Polylang.

Maybe Polylang should hook wp_sweep_excluded_taxonomies?

Sorry, I don't really get what you mean by this?

When searching for Orphaned Term Relationship language and post_translations are found to be orphans although Polylang plugin uses them.

Ah I see, Polylang https://wordpress.org/plugins/polylang/ ?

I think better for plugins to hook on it. Unless WP defaults includes it

@lesterchan Is this MU plugin OK?

<?php
/**
 * Plugin Name: Polylang's excluded taxonomies for WP-Sweep
 */

add_filter( 'wp_sweep_excluded_taxonomies', function( $excluded_taxonomies ) {
    $excluded_taxonomies[] = 'language';
    $excluded_taxonomies[] = 'post_translations';
    return $excluded_taxonomies;
} );

Yea looks ok