Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808

Warning: foreach() argument must be of type array|object, string given in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 813

Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
PUM_Abstract_Database::prepare_result( object|array $result )


Description Description


Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808

Warning: foreach() argument must be of type array|object, string given in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 813

Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808

Parameters Parameters

$result

(Required)


Top ↑

Return Return

(object|array)


Top ↑

Source Source

File: classes/Abstract/Database.php

	public function prepare_result( $result ) {
		if ( ! $result || ( ! is_array( $result ) && ! is_object( $result ) ) ) {
			return $result;
		}

		if ( is_object( $result ) ) {
			$vars = get_object_vars( $result );
			foreach ( $vars as $key => $value ) {
				if ( is_string( $value ) ) {
					$result->$key = maybe_unserialize( $value );
				}
			}
		} elseif ( is_array( $result ) ) {
			foreach ( $result as $key => $value ) {
				if ( is_string( $value ) ) {
					$result[ $key ] = maybe_unserialize( $value );
				}
			}
		}

		return $result;
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.