This topic contains 2 reply and 2 voices, and was last updated by david 6 years, 1 month ago
Viewing 2 Posts - 1 through 2 (of 2 total)
Author Posts
September 19, 2015 at 5:04 am 72400
david That's not work on last version:
/**
 * Increase the post count once a post is deleted
 * 
 * @param int $post_id
 */
function wpufe_trash_post( $post_id ) {
    // bail out if charging is not enabled
    if ( wpuf_get_option( 'charge_posting', 'wpuf_payment' ) != 'yes' ) {
        return false;
    }
     
    $author_id = get_post_field( 'post_author', $post_id );
    $userdata = get_userdata( $author_id );
 
    $count = ( $userdata->wpuf_sub_pcount ) ? $userdata->wpuf_sub_pcount : 0;
    if ( $count !== 'unlimited' ) {
        $count = intval( $count );
        update_user_meta( $userdata->ID, 'wpuf_sub_pcount', $count + 1 );
    }
}
 
add_action( 'wp_trash_post', 'wpufe_trash_post' );
Thanks. David
September 19, 2015 at 12:22 pm 72428
Nayem Nayem

Hello,

You have posted in the wrong plugin topic. You are talking about WP User Frontend but you have posted in Project manager free.

I will notify our developer team about this. But can you please make sure that you have used the right file to add those codes.

September 19, 2015 at 8:40 pm 72509
david david

Ops, thanks Nayem 🙂

Viewing 2 Posts - 1 through 2 (of 2 total)