{"id":1928,"date":"2021-06-18T01:08:22","date_gmt":"2021-06-17T19:38:22","guid":{"rendered":"https:\/\/imageattributespro.com\/?post_type=codex&p=1928"},"modified":"2022-03-22T10:28:04","modified_gmt":"2022-03-22T04:58:04","slug":"iaffpro_html_image_markup_post_update","status":"publish","type":"codex","link":"https:\/\/imageattributespro.com\/codex\/iaffpro_html_image_markup_post_update\/","title":{"rendered":"iaffpro_html_image_markup_post_update"},"content":{"rendered":"\n
Modify the image HTML markup after the bulk updater has added the necessary attributes. <\/p>\n\n\n\n
\/**\n * Filter the image HTML markup. \n * \n * Useful to add custom image attributes or remove existing attributes.\n * Example: You can add Lazyload attributes or Pinterest attributes) on all images. \n * \n * @param $match[0] (string) The image HTML markup (<img alt=\"\" title=\"\" ...) without \n * the closing '>' after it is updated by Image Attributes Pro.\n * \n * @since 1.4\n *\/\nreturn apply_filters( 'iaffpro_html_image_markup_post_update', $match[0] );<\/code><\/pre>\n\n\n\n$match[0]<\/code> contains the image markup without the closing ‘>’ tag. <\/p>\n\n\n\nFor example:<\/strong><\/p>\n\n\n\n<img title=\"Image Title\" src=\"https:\/\/imageattributespro.com\/wp-content\/uploads\/2021\/05\/custom-filter-and-regex-filter-image-attributes-pro-result.png\" alt=\"Image Alt text\" class=\"wp-image-99\"\/<\/code><\/pre>\n\n\n\nNote<\/strong>: This filter is triggered only when the bulk updater updates the images within the post or product HTML. Be sure to select the appropriate Bulk Updater Behaviour<\/code> in the Bulk Updater Settings<\/code> tab. <\/p>\n\n\n\n