samedi 5 mars 2016

wordpress - to find if a meta_value exists

I'm working on a wordpress site and I have custom field 'mobile' in usermeta table. When a user register, I need to check if mobile number exists.I'm using zm-ajax-login-register plugin which doesnot have a mobile field. I'm successfull in adding field and value to usermeta,but I cant validate. I tried like this,but metadata_exists is not the right code

if ( $user['mobile']!= ''){

            $your_custom_field= metadata_exists( 'user', $user->ID, $user['mobile'] );

            if(your_custom_field($user['mobile'])){
                    $status =$this->_zm_alr_helpers->status('invalid_mobile');
            }


        }



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire