Edit File by line
/home/barbar84/www/wp-inclu...
File: author-template.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Author Template functions for use in themes.
[2] Fix | Delete
*
[3] Fix | Delete
* These functions must be used within the WordPress Loop.
[4] Fix | Delete
*
[5] Fix | Delete
* @link https://codex.wordpress.org/Author_Templates
[6] Fix | Delete
*
[7] Fix | Delete
* @package WordPress
[8] Fix | Delete
* @subpackage Template
[9] Fix | Delete
*/
[10] Fix | Delete
[11] Fix | Delete
/**
[12] Fix | Delete
* Retrieve the author of the current post.
[13] Fix | Delete
*
[14] Fix | Delete
* @since 1.5.0
[15] Fix | Delete
*
[16] Fix | Delete
* @global WP_User $authordata The current author's data.
[17] Fix | Delete
*
[18] Fix | Delete
* @param string $deprecated Deprecated.
[19] Fix | Delete
* @return string|null The author's display name.
[20] Fix | Delete
*/
[21] Fix | Delete
function get_the_author( $deprecated = '' ) {
[22] Fix | Delete
global $authordata;
[23] Fix | Delete
[24] Fix | Delete
if ( ! empty( $deprecated ) ) {
[25] Fix | Delete
_deprecated_argument( __FUNCTION__, '2.1.0' );
[26] Fix | Delete
}
[27] Fix | Delete
[28] Fix | Delete
/**
[29] Fix | Delete
* Filters the display name of the current post's author.
[30] Fix | Delete
*
[31] Fix | Delete
* @since 2.9.0
[32] Fix | Delete
*
[33] Fix | Delete
* @param string|null $display_name The author's display name.
[34] Fix | Delete
*/
[35] Fix | Delete
return apply_filters( 'the_author', is_object( $authordata ) ? $authordata->display_name : null );
[36] Fix | Delete
}
[37] Fix | Delete
[38] Fix | Delete
/**
[39] Fix | Delete
* Display the name of the author of the current post.
[40] Fix | Delete
*
[41] Fix | Delete
* The behavior of this function is based off of old functionality predating
[42] Fix | Delete
* get_the_author(). This function is not deprecated, but is designed to echo
[43] Fix | Delete
* the value from get_the_author() and as an result of any old theme that might
[44] Fix | Delete
* still use the old behavior will also pass the value from get_the_author().
[45] Fix | Delete
*
[46] Fix | Delete
* The normal, expected behavior of this function is to echo the author and not
[47] Fix | Delete
* return it. However, backward compatibility has to be maintained.
[48] Fix | Delete
*
[49] Fix | Delete
* @since 0.71
[50] Fix | Delete
*
[51] Fix | Delete
* @see get_the_author()
[52] Fix | Delete
* @link https://developer.wordpress.org/reference/functions/the_author/
[53] Fix | Delete
*
[54] Fix | Delete
* @param string $deprecated Deprecated.
[55] Fix | Delete
* @param bool $deprecated_echo Deprecated. Use get_the_author(). Echo the string or return it.
[56] Fix | Delete
* @return string|null The author's display name, from get_the_author().
[57] Fix | Delete
*/
[58] Fix | Delete
function the_author( $deprecated = '', $deprecated_echo = true ) {
[59] Fix | Delete
if ( ! empty( $deprecated ) ) {
[60] Fix | Delete
_deprecated_argument( __FUNCTION__, '2.1.0' );
[61] Fix | Delete
}
[62] Fix | Delete
[63] Fix | Delete
if ( true !== $deprecated_echo ) {
[64] Fix | Delete
_deprecated_argument(
[65] Fix | Delete
__FUNCTION__,
[66] Fix | Delete
'1.5.0',
[67] Fix | Delete
sprintf(
[68] Fix | Delete
/* translators: %s: get_the_author() */
[69] Fix | Delete
__( 'Use %s instead if you do not want the value echoed.' ),
[70] Fix | Delete
'<code>get_the_author()</code>'
[71] Fix | Delete
)
[72] Fix | Delete
);
[73] Fix | Delete
}
[74] Fix | Delete
[75] Fix | Delete
if ( $deprecated_echo ) {
[76] Fix | Delete
echo get_the_author();
[77] Fix | Delete
}
[78] Fix | Delete
[79] Fix | Delete
return get_the_author();
[80] Fix | Delete
}
[81] Fix | Delete
[82] Fix | Delete
/**
[83] Fix | Delete
* Retrieve the author who last edited the current post.
[84] Fix | Delete
*
[85] Fix | Delete
* @since 2.8.0
[86] Fix | Delete
*
[87] Fix | Delete
* @return string|void The author's display name.
[88] Fix | Delete
*/
[89] Fix | Delete
function get_the_modified_author() {
[90] Fix | Delete
$last_id = get_post_meta( get_post()->ID, '_edit_last', true );
[91] Fix | Delete
[92] Fix | Delete
if ( $last_id ) {
[93] Fix | Delete
$last_user = get_userdata( $last_id );
[94] Fix | Delete
[95] Fix | Delete
/**
[96] Fix | Delete
* Filters the display name of the author who last edited the current post.
[97] Fix | Delete
*
[98] Fix | Delete
* @since 2.8.0
[99] Fix | Delete
*
[100] Fix | Delete
* @param string $display_name The author's display name.
[101] Fix | Delete
*/
[102] Fix | Delete
return apply_filters( 'the_modified_author', $last_user->display_name );
[103] Fix | Delete
}
[104] Fix | Delete
}
[105] Fix | Delete
[106] Fix | Delete
/**
[107] Fix | Delete
* Display the name of the author who last edited the current post,
[108] Fix | Delete
* if the author's ID is available.
[109] Fix | Delete
*
[110] Fix | Delete
* @since 2.8.0
[111] Fix | Delete
*
[112] Fix | Delete
* @see get_the_author()
[113] Fix | Delete
*/
[114] Fix | Delete
function the_modified_author() {
[115] Fix | Delete
echo get_the_modified_author();
[116] Fix | Delete
}
[117] Fix | Delete
[118] Fix | Delete
/**
[119] Fix | Delete
* Retrieves the requested data of the author of the current post.
[120] Fix | Delete
*
[121] Fix | Delete
* Valid values for the `$field` parameter include:
[122] Fix | Delete
*
[123] Fix | Delete
* - admin_color
[124] Fix | Delete
* - aim
[125] Fix | Delete
* - comment_shortcuts
[126] Fix | Delete
* - description
[127] Fix | Delete
* - display_name
[128] Fix | Delete
* - first_name
[129] Fix | Delete
* - ID
[130] Fix | Delete
* - jabber
[131] Fix | Delete
* - last_name
[132] Fix | Delete
* - nickname
[133] Fix | Delete
* - plugins_last_view
[134] Fix | Delete
* - plugins_per_page
[135] Fix | Delete
* - rich_editing
[136] Fix | Delete
* - syntax_highlighting
[137] Fix | Delete
* - user_activation_key
[138] Fix | Delete
* - user_description
[139] Fix | Delete
* - user_email
[140] Fix | Delete
* - user_firstname
[141] Fix | Delete
* - user_lastname
[142] Fix | Delete
* - user_level
[143] Fix | Delete
* - user_login
[144] Fix | Delete
* - user_nicename
[145] Fix | Delete
* - user_pass
[146] Fix | Delete
* - user_registered
[147] Fix | Delete
* - user_status
[148] Fix | Delete
* - user_url
[149] Fix | Delete
* - yim
[150] Fix | Delete
*
[151] Fix | Delete
* @since 2.8.0
[152] Fix | Delete
*
[153] Fix | Delete
* @global WP_User $authordata The current author's data.
[154] Fix | Delete
*
[155] Fix | Delete
* @param string $field Optional. The user field to retrieve. Default empty.
[156] Fix | Delete
* @param int|false $user_id Optional. User ID.
[157] Fix | Delete
* @return string The author's field from the current author's DB object, otherwise an empty string.
[158] Fix | Delete
*/
[159] Fix | Delete
function get_the_author_meta( $field = '', $user_id = false ) {
[160] Fix | Delete
$original_user_id = $user_id;
[161] Fix | Delete
[162] Fix | Delete
if ( ! $user_id ) {
[163] Fix | Delete
global $authordata;
[164] Fix | Delete
$user_id = isset( $authordata->ID ) ? $authordata->ID : 0;
[165] Fix | Delete
} else {
[166] Fix | Delete
$authordata = get_userdata( $user_id );
[167] Fix | Delete
}
[168] Fix | Delete
[169] Fix | Delete
if ( in_array( $field, array( 'login', 'pass', 'nicename', 'email', 'url', 'registered', 'activation_key', 'status' ), true ) ) {
[170] Fix | Delete
$field = 'user_' . $field;
[171] Fix | Delete
}
[172] Fix | Delete
[173] Fix | Delete
$value = isset( $authordata->$field ) ? $authordata->$field : '';
[174] Fix | Delete
[175] Fix | Delete
/**
[176] Fix | Delete
* Filters the value of the requested user metadata.
[177] Fix | Delete
*
[178] Fix | Delete
* The filter name is dynamic and depends on the $field parameter of the function.
[179] Fix | Delete
*
[180] Fix | Delete
* @since 2.8.0
[181] Fix | Delete
* @since 4.3.0 The `$original_user_id` parameter was added.
[182] Fix | Delete
*
[183] Fix | Delete
* @param string $value The value of the metadata.
[184] Fix | Delete
* @param int $user_id The user ID for the value.
[185] Fix | Delete
* @param int|false $original_user_id The original user ID, as passed to the function.
[186] Fix | Delete
*/
[187] Fix | Delete
return apply_filters( "get_the_author_{$field}", $value, $user_id, $original_user_id );
[188] Fix | Delete
}
[189] Fix | Delete
[190] Fix | Delete
/**
[191] Fix | Delete
* Outputs the field from the user's DB object. Defaults to current post's author.
[192] Fix | Delete
*
[193] Fix | Delete
* @since 2.8.0
[194] Fix | Delete
*
[195] Fix | Delete
* @param string $field Selects the field of the users record. See get_the_author_meta()
[196] Fix | Delete
* for the list of possible fields.
[197] Fix | Delete
* @param int|false $user_id Optional. User ID.
[198] Fix | Delete
*
[199] Fix | Delete
* @see get_the_author_meta()
[200] Fix | Delete
*/
[201] Fix | Delete
function the_author_meta( $field = '', $user_id = false ) {
[202] Fix | Delete
$author_meta = get_the_author_meta( $field, $user_id );
[203] Fix | Delete
[204] Fix | Delete
/**
[205] Fix | Delete
* The value of the requested user metadata.
[206] Fix | Delete
*
[207] Fix | Delete
* The filter name is dynamic and depends on the $field parameter of the function.
[208] Fix | Delete
*
[209] Fix | Delete
* @since 2.8.0
[210] Fix | Delete
*
[211] Fix | Delete
* @param string $author_meta The value of the metadata.
[212] Fix | Delete
* @param int|false $user_id The user ID.
[213] Fix | Delete
*/
[214] Fix | Delete
echo apply_filters( "the_author_{$field}", $author_meta, $user_id );
[215] Fix | Delete
}
[216] Fix | Delete
[217] Fix | Delete
/**
[218] Fix | Delete
* Retrieve either author's link or author's name.
[219] Fix | Delete
*
[220] Fix | Delete
* If the author has a home page set, return an HTML link, otherwise just return the
[221] Fix | Delete
* author's name.
[222] Fix | Delete
*
[223] Fix | Delete
* @since 3.0.0
[224] Fix | Delete
*
[225] Fix | Delete
* @return string|null An HTML link if the author's url exist in user meta,
[226] Fix | Delete
* else the result of get_the_author().
[227] Fix | Delete
*/
[228] Fix | Delete
function get_the_author_link() {
[229] Fix | Delete
if ( get_the_author_meta( 'url' ) ) {
[230] Fix | Delete
return sprintf(
[231] Fix | Delete
'<a href="%1$s" title="%2$s" rel="author external">%3$s</a>',
[232] Fix | Delete
esc_url( get_the_author_meta( 'url' ) ),
[233] Fix | Delete
/* translators: %s: Author's display name. */
[234] Fix | Delete
esc_attr( sprintf( __( 'Visit %s&#8217;s website' ), get_the_author() ) ),
[235] Fix | Delete
get_the_author()
[236] Fix | Delete
);
[237] Fix | Delete
} else {
[238] Fix | Delete
return get_the_author();
[239] Fix | Delete
}
[240] Fix | Delete
}
[241] Fix | Delete
[242] Fix | Delete
/**
[243] Fix | Delete
* Display either author's link or author's name.
[244] Fix | Delete
*
[245] Fix | Delete
* If the author has a home page set, echo an HTML link, otherwise just echo the
[246] Fix | Delete
* author's name.
[247] Fix | Delete
*
[248] Fix | Delete
* @link https://developer.wordpress.org/reference/functions/the_author_link/
[249] Fix | Delete
*
[250] Fix | Delete
* @since 2.1.0
[251] Fix | Delete
*/
[252] Fix | Delete
function the_author_link() {
[253] Fix | Delete
echo get_the_author_link();
[254] Fix | Delete
}
[255] Fix | Delete
[256] Fix | Delete
/**
[257] Fix | Delete
* Retrieve the number of posts by the author of the current post.
[258] Fix | Delete
*
[259] Fix | Delete
* @since 1.5.0
[260] Fix | Delete
*
[261] Fix | Delete
* @return int The number of posts by the author.
[262] Fix | Delete
*/
[263] Fix | Delete
function get_the_author_posts() {
[264] Fix | Delete
$post = get_post();
[265] Fix | Delete
if ( ! $post ) {
[266] Fix | Delete
return 0;
[267] Fix | Delete
}
[268] Fix | Delete
return count_user_posts( $post->post_author, $post->post_type );
[269] Fix | Delete
}
[270] Fix | Delete
[271] Fix | Delete
/**
[272] Fix | Delete
* Display the number of posts by the author of the current post.
[273] Fix | Delete
*
[274] Fix | Delete
* @link https://developer.wordpress.org/reference/functions/the_author_posts/
[275] Fix | Delete
* @since 0.71
[276] Fix | Delete
*/
[277] Fix | Delete
function the_author_posts() {
[278] Fix | Delete
echo get_the_author_posts();
[279] Fix | Delete
}
[280] Fix | Delete
[281] Fix | Delete
/**
[282] Fix | Delete
* Retrieves an HTML link to the author page of the current post's author.
[283] Fix | Delete
*
[284] Fix | Delete
* Returns an HTML-formatted link using get_author_posts_url().
[285] Fix | Delete
*
[286] Fix | Delete
* @since 4.4.0
[287] Fix | Delete
*
[288] Fix | Delete
* @global WP_User $authordata The current author's data.
[289] Fix | Delete
*
[290] Fix | Delete
* @return string An HTML link to the author page, or an empty string if $authordata isn't defined.
[291] Fix | Delete
*/
[292] Fix | Delete
function get_the_author_posts_link() {
[293] Fix | Delete
global $authordata;
[294] Fix | Delete
if ( ! is_object( $authordata ) ) {
[295] Fix | Delete
return '';
[296] Fix | Delete
}
[297] Fix | Delete
[298] Fix | Delete
$link = sprintf(
[299] Fix | Delete
'<a href="%1$s" title="%2$s" rel="author">%3$s</a>',
[300] Fix | Delete
esc_url( get_author_posts_url( $authordata->ID, $authordata->user_nicename ) ),
[301] Fix | Delete
/* translators: %s: Author's display name. */
[302] Fix | Delete
esc_attr( sprintf( __( 'Posts by %s' ), get_the_author() ) ),
[303] Fix | Delete
get_the_author()
[304] Fix | Delete
);
[305] Fix | Delete
[306] Fix | Delete
/**
[307] Fix | Delete
* Filters the link to the author page of the author of the current post.
[308] Fix | Delete
*
[309] Fix | Delete
* @since 2.9.0
[310] Fix | Delete
*
[311] Fix | Delete
* @param string $link HTML link.
[312] Fix | Delete
*/
[313] Fix | Delete
return apply_filters( 'the_author_posts_link', $link );
[314] Fix | Delete
}
[315] Fix | Delete
[316] Fix | Delete
/**
[317] Fix | Delete
* Displays an HTML link to the author page of the current post's author.
[318] Fix | Delete
*
[319] Fix | Delete
* @since 1.2.0
[320] Fix | Delete
* @since 4.4.0 Converted into a wrapper for get_the_author_posts_link()
[321] Fix | Delete
*
[322] Fix | Delete
* @param string $deprecated Unused.
[323] Fix | Delete
*/
[324] Fix | Delete
function the_author_posts_link( $deprecated = '' ) {
[325] Fix | Delete
if ( ! empty( $deprecated ) ) {
[326] Fix | Delete
_deprecated_argument( __FUNCTION__, '2.1.0' );
[327] Fix | Delete
}
[328] Fix | Delete
echo get_the_author_posts_link();
[329] Fix | Delete
}
[330] Fix | Delete
[331] Fix | Delete
/**
[332] Fix | Delete
* Retrieve the URL to the author page for the user with the ID provided.
[333] Fix | Delete
*
[334] Fix | Delete
* @since 2.1.0
[335] Fix | Delete
*
[336] Fix | Delete
* @global WP_Rewrite $wp_rewrite WordPress rewrite component.
[337] Fix | Delete
*
[338] Fix | Delete
* @param int $author_id Author ID.
[339] Fix | Delete
* @param string $author_nicename Optional. The author's nicename (slug). Default empty.
[340] Fix | Delete
* @return string The URL to the author's page.
[341] Fix | Delete
*/
[342] Fix | Delete
function get_author_posts_url( $author_id, $author_nicename = '' ) {
[343] Fix | Delete
global $wp_rewrite;
[344] Fix | Delete
$auth_ID = (int) $author_id;
[345] Fix | Delete
$link = $wp_rewrite->get_author_permastruct();
[346] Fix | Delete
[347] Fix | Delete
if ( empty( $link ) ) {
[348] Fix | Delete
$file = home_url( '/' );
[349] Fix | Delete
$link = $file . '?author=' . $auth_ID;
[350] Fix | Delete
} else {
[351] Fix | Delete
if ( '' === $author_nicename ) {
[352] Fix | Delete
$user = get_userdata( $author_id );
[353] Fix | Delete
if ( ! empty( $user->user_nicename ) ) {
[354] Fix | Delete
$author_nicename = $user->user_nicename;
[355] Fix | Delete
}
[356] Fix | Delete
}
[357] Fix | Delete
$link = str_replace( '%author%', $author_nicename, $link );
[358] Fix | Delete
$link = home_url( user_trailingslashit( $link ) );
[359] Fix | Delete
}
[360] Fix | Delete
[361] Fix | Delete
/**
[362] Fix | Delete
* Filters the URL to the author's page.
[363] Fix | Delete
*
[364] Fix | Delete
* @since 2.1.0
[365] Fix | Delete
*
[366] Fix | Delete
* @param string $link The URL to the author's page.
[367] Fix | Delete
* @param int $author_id The author's ID.
[368] Fix | Delete
* @param string $author_nicename The author's nice name.
[369] Fix | Delete
*/
[370] Fix | Delete
$link = apply_filters( 'author_link', $link, $author_id, $author_nicename );
[371] Fix | Delete
[372] Fix | Delete
return $link;
[373] Fix | Delete
}
[374] Fix | Delete
[375] Fix | Delete
/**
[376] Fix | Delete
* List all the authors of the site, with several options available.
[377] Fix | Delete
*
[378] Fix | Delete
* @link https://developer.wordpress.org/reference/functions/wp_list_authors/
[379] Fix | Delete
*
[380] Fix | Delete
* @since 1.2.0
[381] Fix | Delete
*
[382] Fix | Delete
* @global wpdb $wpdb WordPress database abstraction object.
[383] Fix | Delete
*
[384] Fix | Delete
* @param string|array $args {
[385] Fix | Delete
* Optional. Array or string of default arguments.
[386] Fix | Delete
*
[387] Fix | Delete
* @type string $orderby How to sort the authors. Accepts 'nicename', 'email', 'url', 'registered',
[388] Fix | Delete
* 'user_nicename', 'user_email', 'user_url', 'user_registered', 'name',
[389] Fix | Delete
* 'display_name', 'post_count', 'ID', 'meta_value', 'user_login'. Default 'name'.
[390] Fix | Delete
* @type string $order Sorting direction for $orderby. Accepts 'ASC', 'DESC'. Default 'ASC'.
[391] Fix | Delete
* @type int $number Maximum authors to return or display. Default empty (all authors).
[392] Fix | Delete
* @type bool $optioncount Show the count in parenthesis next to the author's name. Default false.
[393] Fix | Delete
* @type bool $exclude_admin Whether to exclude the 'admin' account, if it exists. Default true.
[394] Fix | Delete
* @type bool $show_fullname Whether to show the author's full name. Default false.
[395] Fix | Delete
* @type bool $hide_empty Whether to hide any authors with no posts. Default true.
[396] Fix | Delete
* @type string $feed If not empty, show a link to the author's feed and use this text as the alt
[397] Fix | Delete
* parameter of the link. Default empty.
[398] Fix | Delete
* @type string $feed_image If not empty, show a link to the author's feed and use this image URL as
[399] Fix | Delete
* clickable anchor. Default empty.
[400] Fix | Delete
* @type string $feed_type The feed type to link to. Possible values include 'rss2', 'atom'.
[401] Fix | Delete
* Default is the value of get_default_feed().
[402] Fix | Delete
* @type bool $echo Whether to output the result or instead return it. Default true.
[403] Fix | Delete
* @type string $style If 'list', each author is wrapped in an `<li>` element, otherwise the authors
[404] Fix | Delete
* will be separated by commas.
[405] Fix | Delete
* @type bool $html Whether to list the items in HTML form or plaintext. Default true.
[406] Fix | Delete
* @type int[]|string $exclude Array or comma/space-separated list of author IDs to exclude. Default empty.
[407] Fix | Delete
* @type int[]|string $include Array or comma/space-separated list of author IDs to include. Default empty.
[408] Fix | Delete
* }
[409] Fix | Delete
* @return void|string Void if 'echo' argument is true, list of authors if 'echo' is false.
[410] Fix | Delete
*/
[411] Fix | Delete
function wp_list_authors( $args = '' ) {
[412] Fix | Delete
global $wpdb;
[413] Fix | Delete
[414] Fix | Delete
$defaults = array(
[415] Fix | Delete
'orderby' => 'name',
[416] Fix | Delete
'order' => 'ASC',
[417] Fix | Delete
'number' => '',
[418] Fix | Delete
'optioncount' => false,
[419] Fix | Delete
'exclude_admin' => true,
[420] Fix | Delete
'show_fullname' => false,
[421] Fix | Delete
'hide_empty' => true,
[422] Fix | Delete
'feed' => '',
[423] Fix | Delete
'feed_image' => '',
[424] Fix | Delete
'feed_type' => '',
[425] Fix | Delete
'echo' => true,
[426] Fix | Delete
'style' => 'list',
[427] Fix | Delete
'html' => true,
[428] Fix | Delete
'exclude' => '',
[429] Fix | Delete
'include' => '',
[430] Fix | Delete
);
[431] Fix | Delete
[432] Fix | Delete
$args = wp_parse_args( $args, $defaults );
[433] Fix | Delete
[434] Fix | Delete
$return = '';
[435] Fix | Delete
[436] Fix | Delete
$query_args = wp_array_slice_assoc( $args, array( 'orderby', 'order', 'number', 'exclude', 'include' ) );
[437] Fix | Delete
$query_args['fields'] = 'ids';
[438] Fix | Delete
$authors = get_users( $query_args );
[439] Fix | Delete
[440] Fix | Delete
$author_count = array();
[441] Fix | Delete
foreach ( (array) $wpdb->get_results( "SELECT DISTINCT post_author, COUNT(ID) AS count FROM $wpdb->posts WHERE " . get_private_posts_cap_sql( 'post' ) . ' GROUP BY post_author' ) as $row ) {
[442] Fix | Delete
$author_count[ $row->post_author ] = $row->count;
[443] Fix | Delete
}
[444] Fix | Delete
foreach ( $authors as $author_id ) {
[445] Fix | Delete
$posts = isset( $author_count[ $author_id ] ) ? $author_count[ $author_id ] : 0;
[446] Fix | Delete
[447] Fix | Delete
if ( ! $posts && $args['hide_empty'] ) {
[448] Fix | Delete
continue;
[449] Fix | Delete
}
[450] Fix | Delete
[451] Fix | Delete
$author = get_userdata( $author_id );
[452] Fix | Delete
[453] Fix | Delete
if ( $args['exclude_admin'] && 'admin' === $author->display_name ) {
[454] Fix | Delete
continue;
[455] Fix | Delete
}
[456] Fix | Delete
[457] Fix | Delete
if ( $args['show_fullname'] && $author->first_name && $author->last_name ) {
[458] Fix | Delete
$name = "$author->first_name $author->last_name";
[459] Fix | Delete
} else {
[460] Fix | Delete
$name = $author->display_name;
[461] Fix | Delete
}
[462] Fix | Delete
[463] Fix | Delete
if ( ! $args['html'] ) {
[464] Fix | Delete
$return .= $name . ', ';
[465] Fix | Delete
[466] Fix | Delete
continue; // No need to go further to process HTML.
[467] Fix | Delete
}
[468] Fix | Delete
[469] Fix | Delete
if ( 'list' === $args['style'] ) {
[470] Fix | Delete
$return .= '<li>';
[471] Fix | Delete
}
[472] Fix | Delete
[473] Fix | Delete
$link = sprintf(
[474] Fix | Delete
'<a href="%1$s" title="%2$s">%3$s</a>',
[475] Fix | Delete
get_author_posts_url( $author->ID, $author->user_nicename ),
[476] Fix | Delete
/* translators: %s: Author's display name. */
[477] Fix | Delete
esc_attr( sprintf( __( 'Posts by %s' ), $author->display_name ) ),
[478] Fix | Delete
$name
[479] Fix | Delete
);
[480] Fix | Delete
[481] Fix | Delete
if ( ! empty( $args['feed_image'] ) || ! empty( $args['feed'] ) ) {
[482] Fix | Delete
$link .= ' ';
[483] Fix | Delete
if ( empty( $args['feed_image'] ) ) {
[484] Fix | Delete
$link .= '(';
[485] Fix | Delete
}
[486] Fix | Delete
[487] Fix | Delete
$link .= '<a href="' . get_author_feed_link( $author->ID, $args['feed_type'] ) . '"';
[488] Fix | Delete
[489] Fix | Delete
$alt = '';
[490] Fix | Delete
if ( ! empty( $args['feed'] ) ) {
[491] Fix | Delete
$alt = ' alt="' . esc_attr( $args['feed'] ) . '"';
[492] Fix | Delete
$name = $args['feed'];
[493] Fix | Delete
}
[494] Fix | Delete
[495] Fix | Delete
$link .= '>';
[496] Fix | Delete
[497] Fix | Delete
if ( ! empty( $args['feed_image'] ) ) {
[498] Fix | Delete
$link .= '<img src="' . esc_url( $args['feed_image'] ) . '" style="border: none;"' . $alt . ' />';
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function