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
/** | |
* Removes trailing hyphen from filename if any. | |
*/ | |
function prefix_iaff_clean_filename_helper( $file ) { | |
// Process only images. | |
$image_extensions = array ( | |
'image/jpeg', 'image/gif', 'image/png', 'image/bmp', 'image/tiff', 'ico' | |
); | |
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
/** | |
* Custom tag %ds_page_title% for Image Attributes Pro that returns title of Page. | |
* | |
* @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) Title of the page to which the image is uploaded to. Post title if page cannot be found. | |
* | |
* @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
/** | |
* 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
/** | |
* Add Image Attributes Pro features to Classified Listing. | |
* | |
* Note: Classified Listing plugin hides gallery images from the WordPress Media Library. However these images are simply hidden | |
* and the Bulk Updater of Image Attributes Pro will be able to discover them. | |
* If you wish to display them in the Media Library, please add this snippet to | |
* your functions.php as well - https://wordpress.org/support/topic/about-adding-gallery-images-to-media-library/#post-16643698 | |
* | |
* @link https://imageattributespro.com | |
* @link https://wordpress.org/plugins/classified-listing/ |
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
/** | |
* 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/ |
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/ |
NewerOlder