Is there a php function to determine if a user has paid in pay per view

Hi There, is there a function by which I can determine if a user has paid to view something using the Pay Per View plugin?

I would like to be able to hide some text if the user has paid to view.

  • Panos

    Hi Samuel ,

    As Ivan Shulev already said there is no hook which can be used for this.

    What I noticed is that after IPN verification it saves specific metas for user, so I suppose a posible solution would be to hook when this metas are inserted :

    add_action( 'added_user_meta', 'wpmudev_hidethethingyouwant' );
    function wpmudev_hidethethingyouwant( $mid, $object_id, $meta_key, $_meta_value ){
    	if( $meta_key == "ppw_subscribe" || $meta_key == "ppw_days" ){
    		//Do something OR uncomment following line and check you error log to see if this hook works:
    		//error_log('**IF YOU SEE THIS THE "added_user_meta" SEEMS TO BE WORKING**');

    You can paste code above in your functions.php file and add the functionality you need to include.

    You may also try using the "add_user_meta" action hook which is called just before the meta insert.

    Hope this helps!

    Kind regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.