| @@ -211,8 +211,9 @@ | ||
| 211 | 211 | /** |
| 212 | 212 | * Gets the post data for the smart link. |
| 213 | 213 | * |
| 214 | 214 | * @since 3.16.0 |
| 215 | + * @since 3.24.3 Uses the display name of the source post's author. | |
| 215 | 216 | * |
| 216 | 217 | * @return SmartLinkPostData The post data. |
| 217 | 218 | */ |
| 218 | 219 | private function get_post_data(): array { |
| @@ -267,14 +268,8 @@ | ||
| 267 | 268 | ); |
| 268 | 269 | $paragraph = $error_paragraph; |
| 269 | 270 | } |
| 270 | 271 | |
| 271 | - $author_name = get_the_author(); | |
| 272 | - if ( '' === $author_name ) { | |
| 273 | - // If the author name is empty, use the author login name. | |
| 274 | - $author_name = get_the_author_meta( 'user_login', intval( $post->post_author ) ); | |
| 275 | - } | |
| 276 | - | |
| 277 | 272 | $post_type = get_post_type_object( $post->post_type ); |
| 278 | 273 | if ( null === $post_type ) { |
| 279 | 274 | return $empty_post_data; |
| 280 | 275 | } |
| @@ -298,9 +293,9 @@ | ||
| 298 | 293 | 'parsely_canonical_url' => Parsely::get_canonical_url_from_post( $post ), |
| 299 | 294 | 'edit_link' => get_edit_post_link( $post, 'html' ) !== null ? get_edit_post_link( $post, 'html' ) : '', |
| 300 | 295 | 'is_first_paragraph' => $paragraph['is_first_paragraph'], |
| 301 | 296 | 'is_last_paragraph' => $paragraph['is_last_paragraph'], |
| 302 | - 'author' => $author_name, | |
| 297 | + 'author' => get_the_author_meta( 'display_name', (int) $post->post_author ), | |
| 303 | 298 | 'date' => (string) ( get_the_date( '', $post ) !== false ? get_the_date( '', $post ) : '' ), |
| 304 | 299 | 'image' => get_the_post_thumbnail_url( $post, 'medium' ) !== false ? get_the_post_thumbnail_url( $post, 'medium' ) : '', |
| 305 | 300 | ); |
| 306 | 301 | |
| @@ -1114,9 +1109,9 @@ | ||
| 1114 | 1109 | // Get all posts of type parsely_smart_link that have the destination taxonomy set to the post_id |
| 1115 | 1110 | // and the smart_link_status set to pending. |
| 1116 | 1111 | $args = array( |
| 1117 | 1112 | 'post_type' => 'parsely_smart_link', |
| 1118 | - 'posts_per_page' => -1, | |
| 1113 | + 'posts_per_page' => -1, // phpcs:ignore WordPressVIPMinimum.Performance.NoPaging.posts_per_page_posts_per_page | |
| 1119 | 1114 | 'fields' => 'ids', |
| 1120 | 1115 | // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_tax_query |
| 1121 | 1116 | 'tax_query' => array( |
| 1122 | 1117 | 'relation' => 'AND', |