{"id":2585,"date":"2022-03-22T12:26:24","date_gmt":"2022-03-22T06:56:24","guid":{"rendered":"https:\/\/imageattributespro.com\/?post_type=codex&p=2585"},"modified":"2022-03-22T14:31:29","modified_gmt":"2022-03-22T09:01:29","slug":"iaff_custom_attribute_tags","status":"publish","type":"codex","link":"https:\/\/imageattributespro.com\/codex\/iaff_custom_attribute_tags\/","title":{"rendered":"iaff_custom_attribute_tags"},"content":{"rendered":"

Filter the custom attribute tags of Image Attributes Pro. This filter can be used to add or remove custom attribute tags. <\/p>

\"Default
Default list of tags available to generate a custom image attribute. <\/figcaption><\/figure><\/div>

New tags can be added using this filter and it’s functionality can be defined using the iaffpro_get_custom_attribute_tag_{%tagname%}()<\/a><\/code> function. <\/p>

\/**\n * Filter the custom attribute tags. \n\n * \n * Used by Image Attributes Pro to add custom tags like %yoastfocuskw% \n * and %rankmathfocuskw% dynamically. \n * \n * @since 3.1\n * \n * @param $available_tags (array) Array containing all custom attribute tags.\n *\/\nreturn apply_filters( 'iaff_custom_attribute_tags', $available_tags );<\/code><\/pre>

Example Usage<\/h2>

Image Attributes Pro version 3.0 and above uses this filter to add the attribute tag for Yoast Focus Keyword<\/a> when Yoast plugin is installed and active. <\/p>

\/**\n * Add custom attribute tag %yoastfocuskw%\n * \n * @since 3.0\n * \n * @param $available_tags (array) Array containing all custom attribute tags.\n * \n * @return $available_tags (array) Array with yoastfocuskw added to the custom attribute tags. \n *\/\nfunction iaffpro_add_custom_attribute_tag_yoastfocuskw( $available_tags ) {\n\n\t$available_tags[ 'yoastfocuskw' ] = __( 'Yoast Focus Keyword', 'auto-image-attributes-pro' );\n\n\treturn $available_tags;\n\n}\nadd_filter( 'iaff_custom_attribute_tags', 'iaffpro_add_custom_attribute_tag_yoastfocuskw' );<\/code><\/pre>","protected":false},"excerpt":{"rendered":"

Filter the custom attribute tags of Image Attributes Pro. This filter can be used to add or remove custom attribute tags. <\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","format":"standard","meta":{"footnotes":""},"tags":[],"codex-type":[27],"class_list":["post-2585","codex","type-codex","status-publish","format-standard","hentry","codex-type-filters"],"_links":{"self":[{"href":"https:\/\/imageattributespro.com\/wp-json\/wp\/v2\/codex\/2585"}],"collection":[{"href":"https:\/\/imageattributespro.com\/wp-json\/wp\/v2\/codex"}],"about":[{"href":"https:\/\/imageattributespro.com\/wp-json\/wp\/v2\/types\/codex"}],"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=2585"}],"version-history":[{"count":5,"href":"https:\/\/imageattributespro.com\/wp-json\/wp\/v2\/codex\/2585\/revisions"}],"predecessor-version":[{"id":2611,"href":"https:\/\/imageattributespro.com\/wp-json\/wp\/v2\/codex\/2585\/revisions\/2611"}],"wp:attachment":[{"href":"https:\/\/imageattributespro.com\/wp-json\/wp\/v2\/media?parent=2585"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/imageattributespro.com\/wp-json\/wp\/v2\/tags?post=2585"},{"taxonomy":"codex-type","embeddable":true,"href":"https:\/\/imageattributespro.com\/wp-json\/wp\/v2\/codex-type?post=2585"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}