• Hello, I created code but doesnt works

    I want if condition business_yes is Oui, display link none

    Thanks for you help

    here the code

    add_action('wp_head',function(){
    	if( um_is_core_page( 'activity') ){
    		$profile_id = um_profile_id();
    		$business_yes = get_user_meta( $profile_id, 'business_yes', true );
    		if( $business_yes == 'Oui'){ // 
    		
    		?>
    		<style>
    			.link-element-class {
    				display:none;
    			}
    		</style>
    		<?php
    		
    		}
    	}
    });
    • This topic was modified 2 years, 7 months ago by benenoo.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Ultimate Member Support

    (@ultimatemembersupport)

    Hi @benenoo

    What field type is your “business yes”?

    Please try the following code snippet:

    add_action('wp_head',function(){
    	if( um_is_core_page( 'activity') ){
                    um_fetch_user( get_current_user_id() ); 
    		$business_yes = um_user('business_yes');
    		if( $business_yes == 'Oui'){ // 
    		
    		?>
    		<style>
    			.link-element-class {
    				display:none;
    			}
    		</style>
    		<?php
    		
    		}
    	}
    });
    Thread Starter benenoo

    (@benenoo)

    Hello, thanks

    Business_yes is radiobox

    working well with dropdown but not with radiobox

    Thanks for your help
    Michel

    • This reply was modified 2 years, 7 months ago by benenoo.
    Plugin Support Ultimate Member Support

    (@ultimatemembersupport)

    Hi @benenoo

    Sorry for the late response. Please try this one for the radiobox:

    add_action('wp_head',function(){
    	if( um_is_core_page( 'activity') ){
                    um_fetch_user( get_current_user_id() ); 
    		$business_yes = um_user('business_yes');
    		if( in_array('Oui',$business_yes) ){ // 
    		
    		?>
    		<style>
    			.link-element-class {
    				display:none;
    			}
    		</style>
    		<?php
    		
    		}
    	}
    });
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Hide link’ is closed to new replies.