wp/wp-includes/class-wp-error.php
changeset 21 48c4eec2b7e6
parent 19 3d72ae0968f4
--- a/wp/wp-includes/class-wp-error.php	Thu Sep 29 08:06:27 2022 +0200
+++ b/wp/wp-includes/class-wp-error.php	Fri Sep 05 18:40:08 2025 +0200
@@ -15,6 +15,7 @@
  *
  * @since 2.1.0
  */
+#[AllowDynamicProperties]
 class WP_Error {
 	/**
 	 * Stores the list of errors.
@@ -55,7 +56,7 @@
 	 *
 	 * @param string|int $code    Error code.
 	 * @param string     $message Error message.
-	 * @param mixed      $data    Optional. Error data.
+	 * @param mixed      $data    Optional. Error data. Default empty string.
 	 */
 	public function __construct( $code = '', $message = '', $data = '' ) {
 		if ( empty( $code ) ) {
@@ -102,7 +103,8 @@
 	 *
 	 * @since 2.1.0
 	 *
-	 * @param string|int $code Optional. Retrieve messages matching code, if exists.
+	 * @param string|int $code Optional. Error code to retrieve the messages for.
+	 *                         Default empty string.
 	 * @return string[] Error strings on success, or empty array if there are none.
 	 */
 	public function get_error_messages( $code = '' ) {
@@ -131,7 +133,8 @@
 	 *
 	 * @since 2.1.0
 	 *
-	 * @param string|int $code Optional. Error code to retrieve message.
+	 * @param string|int $code Optional. Error code to retrieve the message for.
+	 *                         Default empty string.
 	 * @return string The error message.
 	 */
 	public function get_error_message( $code = '' ) {
@@ -150,7 +153,7 @@
 	 *
 	 * @since 2.1.0
 	 *
-	 * @param string|int $code Optional. Error code.
+	 * @param string|int $code Optional. Error code. Default empty string.
 	 * @return mixed Error data, if it exists.
 	 */
 	public function get_error_data( $code = '' ) {
@@ -184,7 +187,7 @@
 	 *
 	 * @param string|int $code    Error code.
 	 * @param string     $message Error message.
-	 * @param mixed      $data    Optional. Error data.
+	 * @param mixed      $data    Optional. Error data. Default empty string.
 	 */
 	public function add( $code, $message, $data = '' ) {
 		$this->errors[ $code ][] = $message;