I am using Download monitor plugin for wordpress.
I want to store the number of hits of file in the custom fields.
For example :
I am using this code for getting number of hits of file uploaded using download monitor plugin
<?php echo do_shortcode('[download id='. get_post_meta($post->ID, 'did', $single = true) .' format=5]'); ?>
The above code can used only in template files such as single.php and other files.
And in the above code, i am getting the download file id in variable $did in custom fields.
But Now i want to store the number of downloads in database using custom fields.
I want this to work in two ways :
Once the user inserts the download id $did in one custom field, the next custom field must store the number of downloads in it for that download id.
If the user inserts the php code in the custom field, when i click on publish post that php code must be executed and the value must be stored in the custom field.
please guide me on this.
regards, Rias
You can use post meta values to do this.
Try to call the update_post_meta() setting a custom value each time an user downloads the file.