This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Send an X-Robots-Tag header early. | |
add_action( 'send_headers', function() { | |
if ( is_admin() ) { | |
return; | |
} | |
// If this is the WooCommerce “Shop” page, send noindex right away | |
// If you need the shop page to be indexable, remove | |
if ( function_exists( 'is_shop' ) && is_shop() ) { | |
header( 'X-Robots-Tag: noindex, nofollow', true ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('pmxi_saved_post', 'wp_programator_automatically_import_wpai_params', 10, 2); | |
/** | |
* @param $post_id | |
* @param $xml | |
*/ | |
function wp_programator_automatically_import_wpai_params($post_id, $xml) | |
{ | |
$product_attributes = array(); | |
$atts = array(); // Initialize the array to avoid undefined variable warnings. |