PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 28.5
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v28.5
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
← All changes | src/helpers/user-helper.php +14 -0 18.428.5 View file →
@@ -65,8 +65,22 @@
65 65 return \get_current_user_id();
66 66 }
67 67
68 68 /**
69 + * Returns the current users display_name.
70 + *
71 + * @return string
72 + */
73 + public function get_current_user_display_name(): string {
74 + $user = \wp_get_current_user();
75 + if ( $user && $user->display_name ) {
76 + return $user->display_name;
77 + }
78 +
79 + return '';
80 + }
81 +
82 + /**
69 83 * Updates user meta field for a user.
70 84 *
71 85 * Use the $prev_value parameter to differentiate between meta fields with the
72 86 * same key and user ID.