src/file_load.php
public static function load( $file ) {

		add_filter( 'calderawp_file_locator_allow_extensions', function( $allowed, $context ) {
			if ( self::$context === $context ) {
				$allowed = array( 'html', 'htm' );
			}

			return $allowed;

		}, 10, 2 );


		$file = file_locator::locate( $file, self::$context, true );

		if ( is_string( $file ) ) {
			return array( 'html' => array( 'code' => file_get_contents( $file ) ) );

		}

	}
public static function load( $file ) {

		add_filter( 'calderawp_file_locator_allow_extensions', function( $allowed, $context ) {
			if ( self::$context === $context ) {
				$allowed = array( 'html', 'htm' );
			}

			return $allowed;

		}, 10, 2 );


		$file = file_locator::locate( $file, self::$context, true );

		if ( is_string( $file ) ) {
			return array( 'html' => array( 'code' => file_get_contents( $file ) ) );

		}

	}
public static function load ( $ file ) { add_filter ( 'calderawp_file_locator_allow_extensions' , function ( $ allowed , $ context ) { if ( self :: $ context === $ context ) { $ allowed = array ( 'html' , 'htm' ) ; } return $ allowed ; } , 10 , 2 ) ; $ file = file_locator :: locate ( $ file , self :: $ context , true ) ; if ( is_string ( $ file ) ) { return array ( 'html' => array ( 'code' => file_get_contents ( $ file ) ) ) ; } }
Attempts to load a file and if so, puts its contents in an array as expected by Metaplate

@param string $file File path. Can be relative to current theme or absolute. Must be .html or .htm

@return array|void Returns an array 'html' => file contents if possible.
Attempts to load a file and if so puts its contents in an array as expected by Metaplate