Support » Plugin: Expire Users » expire_users_expired – Hook doesn’t seem to work

  • Resolved phil

    (@philippezumofen)


    The hook above doesn’t work on my site for some reason.

    I have the following code in functions.php-File:

    function my_expire_users_expired( $user ) {
    global $wpdb;
    $zusatztabelle= ‘fruesch_users_zusaetze’;
    $userid = $user->user_id;
    $wpdb->update($zusatztabelle, array(
    “bezahlstatus_mitgliedschaft” => NULL,
    “anzahl_reduzierter_privatunterstuetzungsanfragen” => NULL
    ), array(
    “user_id” => $userid
    ), array( “%s”,”%d”
    ), array(‘%d’));

    $privatanfragetabelle = ‘fruesch_privatunterstuetzungsanfragen’;
    $anmeldungstabelle = ‘fruesch_anmeldungen_gruppenschulungen’;

    $wpdb->update($anmeldungstabelle, array(
    “anzahl_reduzierter_privatunterstuetzungsanfragen” => NULL
    ), array(
    “user_id” => $userid
    ), array( “%s”
    ), array(‘%d’));

    $wpdb->update($privatunterstuetzungsanfragen, array(
    “anzahl_reduzierter_privatunterstuetzungsanfragen” => NULL
    ), array(
    “user_id” => $userid
    ), array( “%s”
    ), array(‘%d’));

    }
    add_action( ‘expire_users_expired’, ‘my_expire_users_expired’ );

    Any idea what’s wrong with the code? It doesn’t give any error in debug.log-File.

    Thank you and best regards
    Phil

Viewing 1 replies (of 1 total)
  • Thread Starter phil

    (@philippezumofen)

    I had it placed inside a different function… Now it’s working perfectly.

Viewing 1 replies (of 1 total)
  • The topic ‘expire_users_expired – Hook doesn’t seem to work’ is closed to new replies.