add_action( 'init', function() { global $WCFMmp, $wpseo_sitemaps; remove_action( 'init', [ $WCFMmp->wcfmmp_store_seo, 'register_sitemap' ] ); if ( is_a( $wpseo_sitemaps, 'WPSEO_Sitemaps' ) ) { $wpseo_sitemaps->register_sitemap( 'wcfmmp-stores', 'wcfm_sitemap_output' ); } }, 9 ); //Generate output for wcfmmp_sellers sitemap function wcfm_sitemap_output() { global $WCFM, $wpseo_sitemaps; $timezone = new WPSEO_Date_Helper(); $seller_q = new WP_User_Query( array( 'role' => 'wcfm_vendor', ) ); $sellers = $seller_q->get_results(); ob_start(); ?> wcfm_vendor_support->wcfm_get_products_by_vendor( $seller->ID, 'publish', array( 'posts_per_page' => 1 ) ); if( !empty( $products ) ) { foreach( $products as $product ) { $last_modified = $product->post_modified; ?> ID )) ?> format( $last_modified )); ?> ID ); $last_modified = $userdata->user_registered; ?> ID )) ?> format( $last_modified )); ?> set_sitemap( $sitemap ); }