Description
Implements the [bw_user] shortcodeDisplay the selected fields for a user
Usage
$string = oiku_user( $atts, $content, $tag );Parameters
- $atts
- ( array ) optional – shortcode parameters
- $content
- ( string ) optional – Additional data after the other fields
- $tag
- ( string ) optional – shortcode name
Returns
string generated HTMLSource
File name: oik-user/shortcodes/oik-user.phpLines:
1 to 39 of 39
function oiku_user( $atts=null, $content=null, $tag=null ) { //bw_trace2(); $id = bw_default_user( false ); $user_id = bw_array_get( $atts, "user", null ); $user_id = trim( $user_id ); if ( $user_id ) { $user = bw_get_user( $user_id ); } else { $user = bw_get_user( $id ); } if ( $user ) { $atts['user'] = $user->ID; oiku_atts( $atts ); if ( $user_id ) { oiku_fiddle_user_in_global_post( $user->ID ); } //bw_trace2( $user, "user" ); $class = bw_array_get( $atts, "class", null ); if ( $class ) { sdiv( $class ); } oiku_format_fields( $user->ID, $atts ); if ( $content ) { e( bw_do_shortcode( $content )); } if ( $class ) { ediv( $class ); } if ( $user_id ) { oiku_fiddle_user_in_global_post( null ); } } else { bw_trace2( $id, "User not found" ); //e( "User not found: $id " ); } return( bw_ret() ); }View on GitHub
Invoked by
Calls
1 to 8 of 8
- bw_array_get() – Return the array[index] or array->index (for an object) or a default value if not set
- bw_do_shortcode() – Perform nested shortcode expansion
- bw_ret() – Use bw_ret() to return the contents of $bwecho, leaving the global value as NULL
- bw_trace2() – Trace $value to the trace log file if tracing is active
- ediv() – End a div
- oiku_fiddle_user_in_global_post() – Fiddle the author of the global post
- oiku_format_fields() – Format some fields for a user
- sdiv() – Start a div
