Switch language

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




the_author [ WordPress Function ]

the_author ( $deprecated = '', $deprecated_echo = true )
Parameters:
  • (string) $deprecated Deprecated.
  • (string) $deprecated_echo Deprecated. Use get_the_author(). Echo the string or return it.
Links:
See:
Returns:
Defined at:



Display the name of the author of the current post.

The behavior of this function is based off of old functionality predating get_the_author(). This function is not deprecated, but is designed to echo the value from get_the_author() and as an result of any old theme that might still use the old behavior will also pass the value from get_the_author().

The normal, expected behavior of this function is to echo the author and not return it. However, backwards compatibility has to be maintained.

Source


<?php
function the_author$deprecated ''$deprecated_echo true ) {
    if ( !empty( 
$deprecated ) )
        
_deprecated_argument__FUNCTION__'2.1' );
    if ( 
$deprecated_echo !== true )
        
_deprecated_argument__FUNCTION__'1.5'__('Use <code>get_the_author()</code> instead if you do not want the value echoed.') );
    if ( 
$deprecated_echo )
        echo 
get_the_author();
    return 
get_the_author();
}
?>

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