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
| {% capture email_title %}Thank you for your purchase! {% endcapture %} | |
| {% capture email_body %} | |
| {% if requires_shipping %} | |
| Hi {{ customer.first_name }}, we're getting your order ready to be shipped. We will notify you when it has been sent. | |
| {% endif %} | |
| {% endcapture %} | |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> |
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 | |
| /** | |
| * Populate ACF select field options with Gravity Forms forms | |
| */ | |
| function acf_populate_gf_forms_ids( $field ) { | |
| if ( class_exists( 'GFFormsModel' ) ) { | |
| $choices = []; | |
| foreach ( \GFFormsModel::get_forms() as $form ) { | |
| $choices[ $form->id ] = $form->title; |
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 | |
| define( 'MINUTE_IN_SECONDS', 60 ); | |
| define( 'HOUR_IN_SECONDS', 60 * MINUTE_IN_SECONDS ); | |
| define( 'DAY_IN_SECONDS', 24 * HOUR_IN_SECONDS ); | |
| define( 'WEEK_IN_SECONDS', 7 * DAY_IN_SECONDS ); | |
| define( 'MONTH_IN_SECONDS', 30 * DAY_IN_SECONDS ); | |
| define( 'YEAR_IN_SECONDS', 365 * DAY_IN_SECONDS ); | |
| // Example usage |
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 below code to Max Mega Menu | Custom Styling | |
| @include desktop { | |
| #{$wrap} #{$menu} li.mega-menu-megamenu > ul.mega-sub-menu { | |
| min-height: auto !important; | |
| overflow: auto; | |
| } | |
| } |
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
| @font-face { | |
| font-family: "Inter var"; | |
| font-weight: 100 900; /* stylelint-disable-line font-weight-notation */ | |
| font-style: normal; | |
| font-display: swap; | |
| src: url('./assets/fonts/inter/Inter-upright-var.woff2') format("woff2"); | |
| } | |
| @font-face { | |
| font-family: "Inter var"; |
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 your_theme_prefix_get_first_cat_object($page_id, $category_metadata) { | |
| if ( empty($page_id) ) { | |
| return new WP_Error('404', __('Missing $page_id parameter', 'your_theme_prefix'), array()); | |
| } | |
| $categories = get_the_category($page_id); | |
| return !empty($categories) ? $categories[0]->{$category_metadata} : null; |
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 CDN Support for ACF fields | |
| */ | |
| function __get_domain_from_url($url = '') { | |
| if( empty($url) ) { | |
| $url = get_site_url(null, '', null); | |
| } | |
| $url_path = parse_url($url); | |
| return $url_path['host']; |
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
| # To clear a whole file content | |
| :1,$d | |
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
| // Inside repositories loop | |
| echo -e "[$SITE_NAME] Git URL: ${GIT_URL}" | |
| // What is this? | |
| // It check if repository exists or not and set remote url correctly. | |
| // If not, sometime it will exit code 1 while running GitLab CI. | |
| # Add git repo | |
| git remote | grep "${SITE_NAME}" &> /dev/null |
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
| #!/bin/bash | |
| set -e | |
| # Script Name: deploy-multidev-pantheon.sh | |
| # Author: khoiprodotcom | |
| # Author URI: https://github.com/khoipro | |
| # ======================================== | |
| # A, What is this script? | |
| # It makes an automation deployment from single Gitlab repository to multiple Pantheon repositories which have the same tag. | |
| # |