This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Load CSS Variables in Editor | |
add_filter('block_editor_settings_all', function($editor_settings) { | |
$style_path = get_stylesheet_directory() . '/style.css'; | |
if (file_exists($style_path)) { | |
$css_style = file_get_contents($style_path); | |
$editor_settings['styles'][] = ['css' => $css_style]; | |
} | |
$customizer_css = wp_get_custom_css_post(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function replace_jet_engine_option_in_content($content) { | |
// Regular expression to detect all occurrences of {{any-slug::any-name}} | |
preg_match_all('/{{(.*?)::(.*?)}}/', $content, $matches); | |
if (!empty($matches) && isset($matches[0])) { | |
foreach ($matches[0] as $index => $match) { | |
// Get the slug and the option name | |
$page_slug = $matches[1][$index]; | |
$option_name = $matches[2][$index]; |