admin管理员组

文章数量:1122832

in polylang there is an integration file for yoast named wpseo.php that adds some translated urls to yoast sitemap, I don't want these urls since I'm doing a custom work on translations with my own classes, the filter is this

/**
 * Add filters before the sitemap is evaluated and outputted.
 *
 * @since 2.6
 *
 * @param WP_Query $query Instance of WP_Query being filtered.
 */
public function before_sitemap( $query ) {
    $type = $query->get( 'sitemap' );

    // Add the post post type archives in all languages to the sitemap
    // Add the homepages for all languages to the sitemap when the front page displays posts
    if ( $type && pll_is_translated_post_type( $type ) && ( 'post' !== $type || ! get_option( 'page_on_front' ) ) ) {
        add_filter( "wpseo_sitemap_{$type}_content", array( $this, 'add_post_type_archive' ) );
    }
}

How can I remove this filter though my functions.php file?

本文标签: Remove wpseo filter from polylang plugin