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 | |
| //BEGIN PROCESS THE FORM - NOTE $attributes global var is a merge of $_GET and $_POST - so the fields submitted in the form :); | |
| if(empty($stripe_errors) && !empty($attributes['stripe_card_form_submitted'])){ | |
| $customer_args = array( | |
| 'card' => $attributes['stripeToken'] | |
| , 'description'=>trim($attributes['customer']['name']) . ';' . trim($attributes['customer']['email']) | |
| , 'email'=>$attributes['customer']['email'] | |
| ); | |
| //create a new customer | |
| //ALWAYS create the customer record in the root application - NOT using the stripe connect access_token |
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 | |
| /* | |
| * Paginate Advanced Custom Field repeater | |
| */ | |
| if( get_query_var('page') ) { | |
| $page = get_query_var( 'page' ); | |
| } else { | |
| $page = 1; | |
| } |
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 | |
| $post = new WP_Query($args); | |
| $counter = 0; | |
| $start_el = '<div class="row">'; | |
| $end_el = '</div><!-- .row -->'; | |
| $item_per_row = 3; | |
| if ( $post->have_posts() ) : | |
| // Opening the first row | |
| echo $start_el; |
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 PhotoSwipe from 'photoswipe'; | |
| import PhotoSwipeUI_Default from 'photoswipe/dist/photoswipe-ui-default'; | |
| export default (selector) => { | |
| const parseThumbnailElements = (element) => { | |
| let items = []; | |
| const thumbs = element.parentNode.querySelectorAll('figure'); |
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 | |
| namespace App\Controllers; | |
| use Sober\Controller\Controller; | |
| use WP_Query; | |
| class App extends Controller | |
| { | |
| // Add all acf fields into the view |
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
| @if($page_builder) | |
| @foreach ($page_builder as $block) | |
| @include('partials/page-builder/'.$block->block_type) | |
| @endforeach | |
| @endif |
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 | |
| namespace App; | |
| /** | |
| * Class NavWalker | |
| * | |
| * Bootstrap 4 walker with cleaner markup for wp_nav_menu() | |
| * For use with Sage >= 8.5 | |
| * |
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
| {{-- inEU() needs to be added with yarn add @segment/in-eu --save --}} | |
| {{-- needs to be imported in common.js -> import inEU from '@segment/in-eu'; --}} | |
| {{-- and needs to be declared as a global in common.js -> window.inEU = inEU(); --}} | |
| <div id="consent-manager"></div> | |
| <script type="text/javascript"> | |
| window.consentManagerConfig = function(exports) { | |
| exports.preferences.onPreferencesSaved(function(prefs) { | |
| // could be used to store consent server side, or send it into an API | |
| }) |
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
| // Init Segment | |
| !function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t){var e=document.createElement("script");e.type="text/javascript";e.async=!0;e.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)};analytics.SNIPPET_VERSION="4.0.0"; | |
| analytics.load("YOUR_WRITE_KEY"); | |
| ana |