Skip to content

Instantly share code, notes, and snippets.

View iamcanadian1973's full-sized avatar

Kyle Rumble iamcanadian1973

View GitHub Profile
$.ajax({
url: 'https://__SHOPIFYNAME__.myshopify.com/api/2021-10/graphql.json',
method: 'POST',
headers: {
'X-Shopify-Storefront-Access-Token': '__TOKEN__',
'Content-Type': 'application/graphql',
},
data: `query {
products(first:10){
edges {
$.ajax( {
type: 'GET',
url: 'https://pacific-dream-seafoods.myshopify.com/cart.json?callback=?',
dataType: 'jsonp',
crossDomain: true,
success: function(data) {
var item_count = data['item_count'];
console.log(data);
<?php
if( class_exists( 'Tribe__Events__Filterbar__Filter' ) ) {
class Tribe__Events__Filterbar__Filters__Series extends Tribe__Events__Filterbar__Filter {
public $type = 'select';
public function get_admin_form() {
$title = $this->get_title_field();
$type = $this->get_multichoice_type_field();
<?php
/**
* Change the subdirectory language code from es to mx
*
* @param array $language_codes_map
*
* @return array
*/
function argo_mx_lang( $language_codes_map ) {
@iamcanadian1973
iamcanadian1973 / wpml-filter.php
Created September 17, 2021 16:48
WPML Filter URL's
<?php
function filter_language_code( $content ) {
$new_content = '';
$dom = new DOMDocument();
$dom->encoding = 'utf-8';
libxml_use_internal_errors(true);
$dom->loadHTML( $content );
<section class="container careers-section">
<div class="wrap">
<div class="row column">
<?php
_s_get_template_part('template-parts/careers', 'job-search');
?>
<div class="results-wrapper">
<span class="hide results-count">3 Results Found for: Chugach Alaska Corporation</span>
<?php
/**
* Module - Get Started
*
* @since 1.0
*/
if ( fusion_is_element_enabled( 'icertis_get_started' ) ) {
@iamcanadian1973
iamcanadian1973 / geocode.js
Created May 8, 2020 17:12
GEO Code address
var geocoder = new google.maps.Geocoder();
var address = '90001';
geocoder.geocode({'address': address}, function(results, status) {
if (status === 'OK') {
var latitude = results[0].geometry.location.lat();
var longitude = results[0].geometry.location.lng();
console.log(latitude + ',' + longitude);
} else {
console.log('Geocode was not successful for the following reason: ' + status);
@iamcanadian1973
iamcanadian1973 / wpml.config
Created April 7, 2020 21:55
Flatsome page builder
<wpml-config>
<custom-types>
<custom-type translate="1">blocks</custom-type>
<custom-type translate="1">featured_item</custom-type>
</custom-types>
<taxonomies>
<taxonomy translate="1">block_categories</taxonomy>
<taxonomy translate="1">featured_item_category</taxonomy>
<taxonomy translate="0">featured_item_tag</taxonomy>
</taxonomies>
<?php
add_filter( 'wpfront_notification_bar_message', function( $message ) {
$message = apply_filters( 'wpml_translate_single_string', $message, 'admin_texts_wpfront-notification-bar-options', '[wpfront-notification-bar-options]message', apply_filters( 'wpml_current_language', NULL ) );
return $message;
});
add_filter( 'wpfront_notification_bar_button_text', function( $button_text ) {
$button_text = apply_filters( 'wpml_translate_single_string', $button_text, 'admin_texts_wpfront-notification-bar-options', '[wpfront-notification-bar-options]button_text', apply_filters( 'wpml_current_language', NULL ) );
return $button_text;