M
M
Maksym Davydchuk2017-09-18 21:26:39
WordPress
Maksym Davydchuk, 2017-09-18 21:26:39

Hide/show block by condition (registration time)?

Good day to all. There was a task to remove a block on the Wordpress site for one week only for those who registered on Wednesday after 17:00 . I understand that there is a robot with php dates. Tell me who has come across or knows how to solve (I will be grateful for examples, links).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2017-09-19
@eGenius18

$t = get_userdata(get_current_user_id());
echo $t != 0 ? 'user registered: '.date("d.m.Y",strtotime($t->user_registered)) : 'user not logged in';

and then you will figure out how to use IFs yourself)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question