<?php 

// CREATE GUTENBERG CUSTOM BLOCKS
require_once get_stylesheet_directory() . '/blocks/register_blocks.php';

add_filter('allowed_block_types', 'allowed_custom_block_types');
function allowed_custom_block_types($allowed_blocks) {
	return array(
        'core/heading',
		'core/paragraph',
		'core/list',
        'core/table',
        'acf/jf-gallery',
	);
}


// DISABLE GUTENBERG COLOR PALETTE
function disable_gutenberg_colors() {
    add_theme_support('editor-color-palette');
	add_theme_support('disable-custom-colors');
}
add_action('after_setup_theme', 'disable_gutenberg_colors');


// // CREATE EMBED VIDEO BLOCK (USING PLYRJS)
// function embedVideoUrl($content) {
//     if (!empty($content)) {
//         parse_str( parse_url( $content, PHP_URL_QUERY ), $my_array_of_vars );
//     }
//     if (!empty($my_array_of_vars["v"])) {
//         $html = "<div class='videoPlayer' data-plyr-provider='youtube' data-plyr-embed-id='" . $my_array_of_vars["v"] . "'></div>";
//     } else {
//         $html = "";
//     }

//     return $html;
// }