Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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 $bulk True when called from Bulk Updater. False by default.
*
* @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, $bulk = false ) {
return rand(0, 999);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment