src/core/class-papi-core-meta-store.php
public function get_value( $id = null, $slug = null, $default = null, $type = 'post' ) {
		if ( ! is_numeric( $id ) && is_string( $id ) ) {
			$type    = empty( $default ) ? $type : $default;
			$default = $slug;
			$slug    = $id;
			$id      = null;
		}

		$slug = strtolower( $slug );

		// Determine if we should use the cache or not.
		$cache = $this->get_property_option( $slug, 'cache', true );

		// Get the raw value from the cache.
		$raw_value = $cache ? papi_cache_get( $slug, $id, $type ) : false;

		// Load raw value if not cached.
		if ( $raw_value === null || $raw_value === false ) {
			$raw_value = $this->load_value( $slug );

			if ( papi_is_empty( $raw_value ) ) {
				return $default;
			}

			if ( $cache ) {
				papi_cache_set( $slug, $id, $raw_value, $type );
			} else {
				papi_cache_delete( $slug, $id, $type );
			}
		}

		if ( papi_is_empty( $raw_value ) ) {
			return $default;
		}

		// Format raw value.
		$value = $this->format_value( $slug, $raw_value );

		return papi_is_empty( $value ) ? $default : $value;
	}
public function get_value( $id = null, $slug = null, $default = null, $type = 'post' ) {
		if ( ! is_numeric( $id ) && is_string( $id ) ) {
			$type    = empty( $default ) ? $type : $default;
			$default = $slug;
			$slug    = $id;
			$id      = null;
		}

		$slug = strtolower( $slug );

		// Determine if we should use the cache or not.
		$cache = $this->get_property_option( $slug, 'cache', true );

		// Get the raw value from the cache.
		$raw_value = $cache ? papi_cache_get( $slug, $id, $type ) : false;

		// Load raw value if not cached.
		if ( $raw_value === null || $raw_value === false ) {
			$raw_value = $this->load_value( $slug );

			if ( papi_is_empty( $raw_value ) ) {
				return $default;
			}

			if ( $cache ) {
				papi_cache_set( $slug, $id, $raw_value, $type );
			} else {
				papi_cache_delete( $slug, $id, $type );
			}
		}

		if ( papi_is_empty( $raw_value ) ) {
			return $default;
		}

		// Format raw value.
		$value = $this->format_value( $slug, $raw_value );

		return papi_is_empty( $value ) ? $default : $value;
	}
Get value.

@param  int    $id
@param  string $slug
@param  mixed  $default
@param  string $type

@return mixed