This file contains hidden or 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
| const TIME_SENSOR = hmSensor.createSensor(hmSensor.id.TIME) | |
| let getDateLocal = function () { | |
| let utc = TIME_SENSOR.utc | |
| let d2 = new Date(); | |
| let offsetHour = 0 | |
| if (TIME_SENSOR.day < d2.getDate() || TIME_SENSOR.hour < d2.getHours()) { | |
| offsetHour = TIME_SENSOR.hour - (d2.getHours() + (d2.getDate() - TIME_SENSOR.day) * 24) |
This file contains hidden or 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
| add_action( 'after_setup_theme', 'enable_kit_manager', 20 ); | |
| function enable_kit_manager() { | |
| $kit_manager_control = The7_Elementor_Compatibility::instance()->kit_manager_control; | |
| remove_action( 'elementor/init', [ $kit_manager_control, 'disable_elementor_kit_manager'] , 1 ); | |
| } | |
| add_action( 'elementor/editor/footer', 'the7_elementor_editor_custom_html' ); | |
| function the7_elementor_editor_custom_html(){ |
This file contains hidden or 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 dt_add_CPT_to_microsite_metabox() { | |
| global $DT_META_BOXES; | |
| if ( $DT_META_BOXES ) { | |
| foreach($DT_META_BOXES as $id => $metabox) { | |
| if ( isset( $metabox['id'] ) && ( $metabox['id'] == 'dt_page_box-microsite' ) ) { | |
| $DT_META_BOXES[$id]['only_on']['template'][] = 'template-microsite2.php'; | |
| //template-microsite2.php is the copy of the microsite template |
This file contains hidden or 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
| add_action( 'presscore_before_post_content', function() { | |
| global $post; | |
| if ( get_post_type() !== 'dt_team' ) { | |
| return; | |
| } | |
| echo '<div class="post-thumbnail">'; | |
| $img_args = array( | |
| 'img_id' => get_post_thumbnail_id(), |
This file contains hidden or 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
| add_filter( 'the7-popup-share-buttons-title', function( $texts ) { | |
| $texts['download'] = __( 'Download image', 'the7mk2' ); | |
| return $texts; | |
| } ); |
This file contains hidden or 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
| add_filter( 'dt_of_get_option', 'dt_get_options_rewrite', 10, 2 ); | |
| function dt_get_options_rewrite($saved_options, $name) { | |
| if ($name !== 'general-post_type_portfolio_slug') return $saved_options; | |
| if (!function_exists('pll_current_language')) return $saved_options; | |
| $lang = pll_current_language('slug'); | |
| switch ($lang){ | |
| case "en": | |
| $saved_options[$name] = 'englishslug'; | |
| break; |
This file contains hidden or 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
| <script> | |
| function modalAutoPlayVideo(modalWrapper){ | |
| "use strict"; | |
| var $youtubeframe = modalWrapper.find(".ult_modal-body iframe"); | |
| if ($youtubeframe.length){ | |
| var videosrc = $youtubeframe.attr('videosrc'); | |
| if (videosrc == null) | |
| { | |
| var videosrc = $youtubeframe.attr('src'); |
This file contains hidden or 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
| add_filter( 'the7_archive_page_template_id', function( $page_id ) { | |
| if ( ! $page_id ) { | |
| if (is_post_type_archive('tribe_events')) //"tribe_events" - it is cuttom post type | |
| $page_id = 9999; //replace to template page id | |
| } | |
| return $page_id; | |
| } ); |
This file contains hidden or 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 dt_add_CPT_to_microsite_metabox() { | |
| global $DT_META_BOXES; | |
| if ( $DT_META_BOXES ) { | |
| foreach($DT_META_BOXES as $id => $metabox) { | |
| if ( isset( $metabox['id'] ) && ( $metabox['id'] == 'dt_page_box-microsite' ) || ( $metabox['id'] == 'dt_page_box-microsite_logo' ) ) { | |
| $DT_META_BOXES[$id]['pages'][] = 'my_custom_postytype'; | |
| break; | |
| } |
This file contains hidden or 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
| //Remove All Meta Generators | |
| function remove_meta_generators($html) { | |
| $pattern = '/<meta name(.*)=(.*)"generator"(.*)>/i'; | |
| $html = preg_replace($pattern, '', $html); | |
| return $html; | |
| } | |
| function clean_meta_generators($html) { | |
| ob_start('remove_meta_generators'); | |
| } | |
| add_action('get_header', 'clean_meta_generators', 100); |
NewerOlder