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
| import { exists } from '@/helpers/utilities'; | |
| export let mixin = ({ node = null, config = {} } = {}) => { | |
| if (!node) return false; | |
| let state = { | |
| node, | |
| config, | |
| }; |
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 this before the closing </body> tag --> | |
| <script type="text/javascript"> | |
| document.addEventListener('DOMContentLoaded', function(){ | |
| let span = document.querySelector('.email span.description'); | |
| if(typeof span == 'undefined' || span == null) return; | |
| let text = span.innerHTML; | |
| let translated = text.replace("Not","Vous n’êtes pas").replace("Click Here","Cliquez-ici"); |
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
| #requires imagemagick - https://imagemagick.org/script/command-line-processing.php | |
| find *.jpg -exec convert {} -shave 1x1 {} \; |
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 setOverflowStyle(bar) { | |
| if (!exists(bar)) return; | |
| let parts = bar.parts; | |
| if (!parts.length) return; | |
| [...parts].map((part) => { | |
| let width = part.dataset.amount / this.total; |
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 passClickToAnotherButton() { | |
| /* HTML be like: | |
| <button class="fake-button" send-click-to=".signature-m-pass"> | |
| Reserve now | |
| </button> | |
| */ | |
| //get all the fake buttons | |
| let buttons = Array.from(document.querySelectorAll('fake-button')); |
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
| <?php | |
| function rmk_get_block_from_post($post_id = null, $block_name =''){ | |
| $all_blocks = parse_blocks(get_the_content('', false, $post_id)); | |
| //handle global blocks | |
| $ref_blocks = array_filter($all_blocks, function($block){ | |
| return isset($block['attrs']['ref']); | |
| }); |
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
| <?php | |
| function filter_representatives_by_taxonomies( $post_type, $which ) { | |
| // Apply this only on a specific post type | |
| if ( 'representatives' !== $post_type ) | |
| return; | |
| // A list of taxonomy slugs to filter by | |
| $taxonomies = array( 'company'); |
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
| wp post delete $(wp post list --post_type='my_post_type' --format=ids) --force |
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
| <!-- Event snippet for Example conversion page --> | |
| <script> | |
| gtag('event', 'conversion', {'send_to': 'AW-CONVERSION_ID/AW-CONVERSION_LABEL', | |
| 'value': 1.0, | |
| 'currency': 'USD' | |
| }); | |
| </script> |
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
| <?php | |
| $go_live_time = new DateTime('2021-7-1 6:00:00', new DateTimeZone('America/New_York')); | |
| $current_time = new DateTime('America/New_York'); | |
| if($current_time < $go_live_time): | |
| return; | |
| endif; |