pre_user_id
Filters the comment author's user ID before it is set.
The first time this filter is evaluated, user_ID is checked (for back-compat), followed by the standard user_id value.
Использование
add_filter( 'pre_user_id', 'wp_kama_pre_user_id_filter' );
/**
* Function for `pre_user_id` filter-hook.
*
* @param int $user_id The comment author's user ID.
*
* @return int
*/
function wp_kama_pre_user_id_filter( $user_id ){
// filter...
return $user_id;
}
- $user_id(int)
- The comment author's user ID.
Список изменений
| С версии 1.5.0 | Введена. |
Где вызывается хук
pre_user_id
wp-includes/comment.php 2152
$commentdata['user_id'] = apply_filters( 'pre_user_id', $commentdata['user_ID'] );
wp-includes/comment.php 2155
$commentdata['user_id'] = apply_filters( 'pre_user_id', $commentdata['user_id'] );