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 | |
| /** | |
| * A Hack to generate mock WP Post objects from any arbitrary array | |
| * A possible use case is to render a list of taxonomy terms using Oxygen Builder's repeater element, | |
| * as the repeater allows only WP_Query as a source of data | |
| * | |
| * @author: Gagan S Goraya | |
| * @link: https://gagangoraya.com | |
| * |
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($){ | |
| let offCanvas = '.my-offcanvas'; // Change to your offcanvas selector (class or ID) | |
| /* When item is added to cart */ | |
| $( document.body ).on( 'added_to_cart', function(){ | |
| /* Toggle the classes to open the offcanvas */ | |
| $('html,body').addClass('off-canvas-toggled'); | |
| $(offCanvas).addClass('oxy-off-canvas-toggled'); |
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
| /* I'll put here different examples of dynamic query for Oxygen repeater : | |
| * - Use one of the following repeater_dynamic_query definitions | |
| * in code block just BEFORE the repeater | |
| * - Set the repeater custom query settings : post type, number of posts, order... | |
| * - Add the remove_action in a code block AFTER the repeater | |
| */ | |
| /**************************************************************************************************** | |
| * Display related posts for any CPT with taxonomy: |
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 ExtractTextPlugin = require("extract-text-webpack-plugin"); | |
| const path = require("path"); | |
| const glob = require("glob-all"); | |
| const PurgecssPlugin = require("purgecss-webpack-plugin"); | |
| /** | |
| * Custom PurgeCSS Extractor | |
| * https://github.com/FullHuman/purgecss | |
| * https://github.com/FullHuman/purgecss-webpack-plugin | |
| */ |
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 | |
| $terms = get_terms( 'TAXONOMY' ); | |
| if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){ | |
| foreach ( $terms as $term ) { | |
| echo '<div class="item">'; | |
| $icon = pods_field( 'TAXONOMY', $term->term_id, 'FIELD', true ); | |
| $icon_url = $icon['guid']; | |
| $icon_thumb = pods_image_url ( $icon_url, 'thumbnail', 0, false ) ; | |
| $term_link = get_term_link($term); | |
| echo '<a href="'.$term_link.'">'; |
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
| # --------------------------------------------------------------------------- | |
| # | |
| # Description: This file holds all my BASH configurations and aliases | |
| # | |
| # Sections: | |
| # 1. Environment Configuration | |
| # 2. Make Terminal Better (remapping defaults and adding functionality) | |
| # 3. File and Folder Management | |
| # 4. Searching | |
| # 5. Process Management |
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 | |
| //set up pods::find parameters to limit to 5 items | |
| $param = array( | |
| 'limit' => 5, | |
| ); | |
| //create pods object | |
| $pods = pods('pod_name', $params ); | |
| //check that total values (given limit) returned is greater than zero | |
| if ( $pods->total() > 0 ) { |
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 | |
| LANG=ja_JP.utf8 | |
| pid=$$ | |
| date=`date '+%Y-%m-%d-%H_%M'` | |
| outdir="." | |
| if [ $# -le 1 ]; then |
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
| Snippet: [[SnippetName]] | |
| Chunk: [[$ChunkName]] | |
| System Setting: [[++SettingName]] | |
| TV: [[*fieldName/TvName]] | |
| Link tag: [[~PageId? ¶mName=`value`]] | |
| Placeholder: [[+PlaceholderName]] | |
| <?php |
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
| Regex for matching ALL Japanese common & uncommon Kanji (4e00 – 9fcf) ~ The Big Kahuna! | |
| ([一-龯]) | |
| Regex for matching Hirgana or Katakana | |
| ([ぁ-んァ-ン]) | |
| Regex for matching Non-Hirgana or Non-Katakana | |
| ([^ぁ-んァ-ン]) | |
| Regex for matching Hirgana or Katakana or basic punctuation (、。’) |
NewerOlder