You appear to be a bot. Output may be restricted
Description
Given a valid user ID return the required field, which may be from a set such as bw_optionsQ. Which do we use: get_the_author_meta() or get_user_meta() ? A. get_user_meta() is simpler but it won't return the fields from the wp_user table If we're obtaining a field from a set then we must use get_user_meta() otherwise we'll use get_the_author_meta()
Usage
bw_get_user_field( $ID, $field, $set );
Parameters
- $ID
- ( mixed ) required –
- $field
- ( mixed ) required –
- $set
- ( mixed ) optional –
Returns
voidSource
File name: oik/includes/bobbcomp.phpLines:
1 to 11 of 11
function bw_get_user_field( $ID, $field, $set=null ) { if ( $set ) { $option = get_user_meta( $ID, $set, true ); bw_trace2( $option, "option" ); $option = bw_array_get( $option, $field, null ); } else { $option = get_the_author_meta( $field, $ID ); } bw_trace2( $option, "option" ); return( $option ); }View on GitHub View on Trac