• marlonsabala

    (@marlonsabala)


    Hi guys,

    trying to make a menu item available to only one user.

    Trued this but didn’t work.

    in_array(’19’, $GLOBALS[‘current_user’]->ID)

    What am I doing wrong?

    Thanks in advance

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author shazdeh

    (@shazdeh)

    Hi!

    You can use get_current_user_id:

    
    get_current_user_id() === 19
    
    Thread Starter marlonsabala

    (@marlonsabala)

    Thanks. I managed to come top with this

    wp_get_current_user()->ID == 20

    Any reason I should you triple “=”?

    Plugin Author shazdeh

    (@shazdeh)

    === is more strict in that it does “type checking” as well. In this case, doesn’t make much difference really.

    Thread Starter marlonsabala

    (@marlonsabala)

    Got you. Great plugin btw, essential for me.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Show to specific user’ is closed to new replies.