Shop Forums WordPress Plugins Add column to All Users page Reply To: Add column to All Users page

#18874
vinny
Keymaster

Hi Jamie,

The simplest way is to use

get_user_meta( $user_id, 'BbpnnsDigest_force_notification', $single=true);

However, that may break if I ever decide to change how the preference is stored. A better, but more complex option is to load the recipients DAO and load it from there. However, because load_lib() is protected, you’ll have to override it somewhere:


class jamies_digest_override extends BbpnnsDigest {
    public function __construct(){ /* NOOP */ }

    public function load_lib( $name, $params = array(), $force_reload = false ){
        return parent::load_lib( $name, $params, $force_reload );
    }
}

and then replace your get_user_meta line with this:


$obj = new jamies_digest_override();
$rec_dao = $obj->load_lib( 'dal/recipients_dao' );
return $rec_dao->get_user_force_notif_pref(null, $user_id);