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 %pr_yoastmetadesc% for Image Attributes Pro that returns Yoast Meta Description. | |
* | |
* @link https://yoast.com/developer-blog/yoast-seo-14-0-using-yoast-seo-surfaces/ | |
* | |
* @param $image_id (integer) The ID of the image that is being updated. | |
* @param $parent_post_id (integer) Post to which the image is attached (uploaded) to. | |
* @param $args (array) An array containing additional arguments. | |
* | |
* @return (string) Yoast Meta Description. |
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 in WordPress Pages only. | |
* | |
* The post type for a WordPress page is 'page'. | |
* | |
* @author Arun Basil Lal | |
* @link https://imageattributespro.com/codex/iaffpro_included_post_types/ | |
*/ | |
function prefix_iap_update_pages_only( $included_post_types ) { | |
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
/** | |
* Load translation files for Image Attributes Pro | |
*/ | |
function iaff_load_plugin_textdomain() { | |
load_plugin_textdomain( 'auto-image-attributes-from-filename-with-bulk-updater', false, '/auto-image-attributes-from-filename-with-bulk-updater/languages/' ); | |
} | |
add_action( 'plugins_loaded', 'iaff_load_plugin_textdomain' ); |
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
/** | |
* 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
/** | |
* 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 ) { | |
NewerOlder