user_can_set_post_date()
Устарела с версии 2.0.0. Больше не поддерживается и может быть удалена. Используйте current_user_can().
Whether user can set new posts' dates.
Хуков нет.
Возвращает
true|false
.
Использование
user_can_set_post_date( $user_id, $blog_id, $category_id );
- $user_id(int) (обязательный)
- -
- $blog_id(int)
- Not Used
По умолчанию: 1 - $category_id(int)
- Not Used
По умолчанию: 'None'
Заметки
- Смотрите: current_user_can()
Список изменений
С версии 1.5.0 | Введена. |
Устарела с 2.0.0 | Use current_user_can() |
Код user_can_set_post_date() user can set post date WP 6.7.1
function user_can_set_post_date($user_id, $blog_id = 1, $category_id = 'None') { _deprecated_function( __FUNCTION__, '2.0.0', 'current_user_can()' ); $author_data = get_userdata($user_id); return (($author_data->user_level > 4) && user_can_create_post($user_id, $blog_id, $category_id)); }