This file contains 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
<?php | |
// Load WordPress. | |
require( 'wp-load.php' ); | |
// Run the Bulk Updater | |
prefix_iap_run_bulk_updater(); | |
/** | |
* Run Image Attributes Pro Bulk Updater Programmatically | |
* |
This file contains 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
// EXIF data extracted using exif_read_data() PHP function from https://github.com/ianare/exif-samples/blob/master/jpg/Canon_40D.jpg | |
Array ( | |
[FileDateTime] => 0 | |
[FileSize] => 7958 | |
[FileType] => 2 | |
[MimeType] => image/jpeg | |
[SectionsFound] => ANY_TAG, IFD0, THUMBNAIL, EXIF, GPS, INTEROP | |
[COMPUTED] => Array | |
( |
This file contains 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
/** | |
* Custom tag %image_alt_text% for Image Attributes Pro. | |
* | |
* @param $image_id The ID of the image that is being updated. | |
* @param $parent_post_id The post to which the image is attached (uploaded) to. | |
* @param $args (array) An array containing additional arguments. | |
* | |
* @return (string) Image alt text from Media Library. | |
*/ | |
function iaffpro_get_custom_attribute_tag_image_alt_text( $image_id, $parent_post_id, $args = array() ) { |
This file contains 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
/** | |
* Update image attributes when alt text is updated. | |
* | |
* Runs when image alt text is updated using update_post_meta and | |
* calls iaffpro_auto_image_attributes_pro() function to update image attributes. | |
* | |
* Settings from "Bulk Updater Settings" tab are used to update the attributes. | |
* | |
* @param int $meta_id ID of metadata entry to update. | |
* @param int $object_id Image ID. |
This file contains 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
/** | |
* Custom tag %random_number% for Image Attributes Pro. | |
* | |
* Generates a random number between 0 and 999. | |
* | |
* @param $image_id The ID of the image that is being updated. | |
* @param $parent_post_id The post to which the image is attached (uploaded) to. 0 if the image is not attached to any post. | |
* @param $args (array) An array containing additional arguments. | |
* | |
* @return (integer) A random number between 0 and 999. |
This file contains 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 hyphens between words for Image Title in Image Attributes Pro | |
* | |
* @param $attributes (array) Associative array of image attributes. | |
* | |
* @author Arun Basil Lal | |
* @link https://imageattributespro.com/codex/iaffpro_image_attributes/ | |
*/ | |
function prefix_iap_add_hyphens_to_image_title( $attributes ) { | |
This file contains 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
/** | |
* Custom tag %product_description% for Image Attributes Pro | |
* | |
* @param $image_id The ID of the image that is being updated. | |
* @param $parent_post_id The post to which the image is attached (uploaded) to. | |
* @param $args (array) An array containing additional arguments. | |
* | |
* @return string WordPress post content. WooCommerce product long description is saved as post content. | |
* | |
* @refer https://imageattributespro.com/codex/iaffpro_get_custom_attribute_tag_tagname/ |
This file contains 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
/** | |
* Custom tag %post_slug% for Image Attributes Pro | |
* | |
* @param $image_id The ID of the image that is being updated. | |
* @param $parent_post_id The post to which the image is attached (uploaded) to. | |
* @param $args (array) An array containing additional arguments. | |
* | |
* @return string Slug of the post where the image is uploaded to. | |
* | |
* @refer https://imageattributespro.com/codex/iaffpro_get_custom_attribute_tag_tagname/ |
This file contains 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
/** | |
* Custom tag %image_id% for Image Attributes Pro | |
* | |
* @param $image_id (integer) The ID of the image that is being updated. | |
* @param $parent_post_id (integer) The post to which the image is attached (uploaded) to. | |
* @param $args (array) An array containing additional arguments. | |
* | |
* @return (string) ID of the image. | |
* | |
* @refer https://imageattributespro.com/codex/iaffpro_get_custom_attribute_tag_tagname/ |
OlderNewer