Filter the list of post types that the Image Attributes Pro bulk updater should update.
The default value is an empty array and this will update all post types.
/**
* Get a list of post types to update
*
* Default is an empty array and empty array will update all post types.
*
* @since 1.3
*/
$included_post_types = apply_filters( 'iaffpro_included_post_types', array() );
Example Usage
To update image attributes such as title, caption, description and alt text only in WooCommerce products, add the following code to the functions.php
of the active theme.
/**
* Update image attributes in WooCommerce products only.
*
* The post type for a WooCommerce product is 'product'
*
* @author Arun Basil Lal
* @link https://imageattributespro.com/codex/iaffpro_included_post_types/
*/
function prefix_iap_update_products_only( $included_post_types ) {
$included_post_types[] = 'product';
return $included_post_types;
}
add_filter( 'iaffpro_included_post_types', 'prefix_iap_update_products_only' );
Was this article helpful?
Yes, thanks! 👍Not really 👎