iaffpro_custom_attribute_tag_tag_names<\/a><\/code> filter to return a random tag name for each image. <\/p>\/**\r\n * Return a random tag name from the tags associated with a post \/ product.\r\n * This modifies the output generated by %tag% custom attributes tag in Image Attributes Pro.\r\n * \r\n * @link https:\/\/imageattributespro.com\/codex\/iaffpro_custom_attribute_tag_tag_names\/\r\n * \r\n * @param $first_tag (string) The first tag available.\r\n * @param $tags (array) Contains the names of all tags associated with given post.\r\n * \r\n * @return (string) A random tag name.\r\n *\/\r\nfunction prefix_iap_add_random_tag_in_custom_attribute_tag_tag( $first_tag, $tags ) {\r\n\r\n $random_key = array_rand( $tags );\r\n\r\n \/\/ Return a random tag.\r\n return $tags[$random_key];\r\n}\r\nadd_filter( 'iaffpro_custom_attribute_tag_tag_names', 'prefix_iap_add_random_tag_in_custom_attribute_tag_tag', 10, 2 );<\/code><\/pre>","protected":false},"excerpt":{"rendered":"When a post \/ product has multiple images, it’s possible for all the images to have the same image attribute. For example, if Image Attributes Pro is configured to use the product title as image attribute, then all images in the product will have the same product title. From a technical stand point, duplicate image […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31],"tags":[],"class_list":["post-3137","post","type-post","status-publish","format-standard","hentry","category-how-to"],"_links":{"self":[{"href":"https:\/\/imageattributespro.com\/wp-json\/wp\/v2\/posts\/3137"}],"collection":[{"href":"https:\/\/imageattributespro.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/imageattributespro.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/imageattributespro.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/imageattributespro.com\/wp-json\/wp\/v2\/comments?post=3137"}],"version-history":[{"count":3,"href":"https:\/\/imageattributespro.com\/wp-json\/wp\/v2\/posts\/3137\/revisions"}],"predecessor-version":[{"id":3140,"href":"https:\/\/imageattributespro.com\/wp-json\/wp\/v2\/posts\/3137\/revisions\/3140"}],"wp:attachment":[{"href":"https:\/\/imageattributespro.com\/wp-json\/wp\/v2\/media?parent=3137"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/imageattributespro.com\/wp-json\/wp\/v2\/categories?post=3137"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/imageattributespro.com\/wp-json\/wp\/v2\/tags?post=3137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}