Skip to content

Instantly share code, notes, and snippets.

@arunbasillal
Last active April 24, 2023 07:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arunbasillal/8b33e4b3822324a112323d2503afd104 to your computer and use it in GitHub Desktop.
Save arunbasillal/8b33e4b3822324a112323d2503afd104 to your computer and use it in GitHub Desktop.
Custom tag %random_number% for Image Attributes Pro.
/**
* Custom tag %random_number% for Image Attributes Pro.
*
* Generates a random number between 0 and 999.
*
* @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. 0 if the image is not attached to any post.
* @param $args (array) An array containing additional arguments.
*
* @return (integer) A random number between 0 and 999.
*
* @refer https://imageattributespro.com/codex/iaffpro_get_custom_attribute_tag_tagname/
*/
function iaffpro_get_custom_attribute_tag_random_number( $image_id, $parent_post_id, $args = array() ) {
return rand(0, 999);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment