• Resolved MKTCORP GD

    (@mktcorpgd)


    Hi, I’m just trying to make an automatic process so once I delete a user with its corresponding entry I’d like to change the status to <pending>.
    And if there is documentation to listen more attributes between user profile and its entry would be really nice so information will flow without gaps!
    Is it possible?
    Thanks in advance!

    https://ww.wp.xz.cn/plugins/connections/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Steven

    (@shazahm1hotmailcom)

    @ mktcorpgd

    I’m just trying to make an automatic process so once I delete a user with its corresponding entry I’d like to change the status to <pending>.

    Assuming you are using the Link extension

    You need to add an action to the core WordPress action delete_user. In the callback function of your action.

    In that callback you would get the entry ID the user was linked to like so:

    $entryID = get_user_meta( $user_id, 'connections_entry_id', TRUE );

    After you have the entry ID you can then use $wpdb to run a query to set the status to pending.

    Hope that helps!

    Thread Starter MKTCORP GD

    (@mktcorpgd)

    Yes, I’m working with Link extension.

    This my hook but it doesn’t work.

    function my_delete_user($user_id) {
    	global $wpdb;
    	$entryID = get_user_meta($user_id, 'connections_entry_id', TRUE);
    	$wpdb->update('PREFIX_connections', array('status'=>'pending'), array('ID'=>$entryID));
    }
    add_action('delete_user','my_delete_user');

    Thanks!

    Plugin Author Steven

    (@shazahm1hotmailcom)

    @ mktcorpgd

    Well, the only thing I see offhand is the you have ID and it should be id.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Automatic processes between user profile and its entry’ is closed to new replies.