public static function get( $id, $defaults = array() ) {
		$defaults = wp_parse_args( $defaults, self::$defaults );
		$value    = get_post_meta( $id, self::KEY, true );
		$value    = wp_parse_args( (array) $value, $defaults );

		// Backward-compatibility.
		if ( empty( $value['icon'] ) &&
			! empty( $value['type'] ) &&
			! empty( $value[ "{$value['type']}-icon" ] )
		) {
			$value['icon'] = $value[ "{$value['type']}-icon" ];
		}

		if ( ! empty( $value['width'] ) ) {
			$value['svg_width'] = $value['width'];
		}
		unset( $value['width'] );

		if ( isset( $value['position'] ) &&
			! in_array( $value['position'], array( 'before', 'after' ), true )
		) {
			$value['position'] = $defaults['position'];
		}

		if ( isset( $value['size'] ) && ! isset( $value['font_size'] ) ) {
			$value['font_size'] = $value['size'];
			unset( $value['size'] );
		}

		// The values below will NOT be saved
		if ( ! empty( $value['icon'] ) &&
			in_array( $value['type'], array( 'image', 'svg' ), true )
		) {
			$value['url'] = wp_get_attachment_image_url( $value['icon'], 'thumbnail', false );
		}

		return $value;
	}
public static function get( $id, $defaults = array() ) {
		$defaults = wp_parse_args( $defaults, self::$defaults );
		$value    = get_post_meta( $id, self::KEY, true );
		$value    = wp_parse_args( (array) $value, $defaults );

		// Backward-compatibility.
		if ( empty( $value['icon'] ) &&
			! empty( $value['type'] ) &&
			! empty( $value[ "{$value['type']}-icon" ] )
		) {
			$value['icon'] = $value[ "{$value['type']}-icon" ];
		}

		if ( ! empty( $value['width'] ) ) {
			$value['svg_width'] = $value['width'];
		}
		unset( $value['width'] );

		if ( isset( $value['position'] ) &&
			! in_array( $value['position'], array( 'before', 'after' ), true )
		) {
			$value['position'] = $defaults['position'];
		}

		if ( isset( $value['size'] ) && ! isset( $value['font_size'] ) ) {
			$value['font_size'] = $value['size'];
			unset( $value['size'] );
		}

		// The values below will NOT be saved
		if ( ! empty( $value['icon'] ) &&
			in_array( $value['type'], array( 'image', 'svg' ), true )
		) {
			$value['url'] = wp_get_attachment_image_url( $value['icon'], 'thumbnail', false );
		}

		return $value;
	}
public static function get ( $ id , $ defaults = array ( ) ) { $ defaults = wp_parse_args ( $ defaults , self :: $ defaults ) ; $ value = get_post_meta ( $ id , self :: KEY , true ) ; $ value = wp_parse_args ( ( array ) $ value , $ defaults ) ; // Backward-compatibility. if ( empty ( $ value [ 'icon' ] ) && ! empty ( $ value [ 'type' ] ) && ! empty ( $ value [ "{$value['type']}-icon" ] ) ) { $ value [ 'icon' ] = $ value [ "{$value['type']}-icon" ] ; } if ( ! empty ( $ value [ 'width' ] ) ) { $ value [ 'svg_width' ] = $ value [ 'width' ] ; } unset ( $ value [ 'width' ] ) ; if ( isset ( $ value [ 'position' ] ) && ! in_array ( $ value [ 'position' ] , array ( 'before' , 'after' ) , true ) ) { $ value [ 'position' ] = $ defaults [ 'position' ] ; } if ( isset ( $ value [ 'size' ] ) && ! isset ( $ value [ 'font_size' ] ) ) { $ value [ 'font_size' ] = $ value [ 'size' ] ; unset ( $ value [ 'size' ] ) ; } // The values below will NOT be saved if ( ! empty ( $ value [ 'icon' ] ) && in_array ( $ value [ 'type' ] , array ( 'image' , 'svg' ) , true ) ) { $ value [ 'url' ] = wp_get_attachment_image_url ( $ value [ 'icon' ] , 'thumbnail' , false ) ; } return $ value ; }
Get menu item meta value

@since  0.3.0
@since  0.9.0  Add $defaults parameter.
@param  int    $id       Menu item ID.
@param  array  $defaults Optional. Default value.
@return array
Get menu item meta value