basename( $file, '.json' ), glob( DIR . 'styles/*.json' ) ), ]; } /** * Gets style variation data from json file. * * @since 1.0.0 * * @param string $style Selected style variation. * * @return array */ function get_style_variation_json( string $style ): array { $dir = apply_filters( 'blockify_styles_dir', DIR . 'styles' ); $json = []; if ( file_exists( $dir . "/$style.json" ) ) { $json = json_decode( file_get_contents( $dir . "/$style.json" ), true ); } return $json; } /** * Return the selected style variation pattern directory. * * @since 1.0.0 * * @return string */ function get_pattern_style(): string { $settings = wp_get_global_settings(); return apply_filters( 'blockify_pattern_style', $settings['custom']['patternStyle'] ?? 'default', $settings ); } /** * Description of expected behavior. * * @since 1.0.0 * * @return string */ function get_pattern_dir(): string { return apply_filters( 'blockify_pattern_dir', DIR . 'patterns/default' ); }