Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




get_the_author_meta [ WordPress Function ]

get_the_author_meta ( $field = '', $user_id = false )
Parameters:
  • (string) $field selects the field of the users record.
  • (int) $user_id Optional. User ID.
Uses:
  • $authordata
Links:
Returns:
  • (string) The author's field from the current author's DB object.
Defined at:



Retrieve the requested data of the author of the current post.

Source


<?php
function get_the_author_meta$field ''$user_id false ) {
    if ( ! 
$user_id ) {
        global 
$authordata;
        
$user_id = isset( $authordata->ID ) ? $authordata->ID 0;
    } else {
        
$authordata get_userdata$user_id );
    }

    if ( 
in_array$field, array( 'login''pass''nicename''email''url''registered''activation_key''status' ) ) )
        
$field 'user_' $field;

    
$value = isset( $authordata->$field ) ? $authordata->$field '';

    return 
apply_filters'get_the_author_' $field$value$user_id );
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics