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 | |
/** | |
* WC Ajax Product Filter by Category | |
*/ | |
if (!class_exists('WCAPF_Tag_Filter_Widget')) { | |
class WCAPF_Tag_Filter_Widget extends WP_Widget { | |
/** | |
* Register widget with WordPress. | |
*/ | |
function __construct() { |
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_filter('rest_prepare_post','add_featured_to_post_rest', 10, 3); | |
function add_featured_to_post_rest($data, $post, $request) { | |
$_data = $data->data; | |
$thumbnail_id = get_post_thumbnail_id($post->ID); | |
$thumbnail = wp_get_attachment_image_src( $thumbnail_id, 'thumbnail'); | |
$thumbnailMedium = wp_get_attachment_image_src( $thumbnail_id, 'medium'); | |
$thumbnailLarge = wp_get_attachment_image_src( $thumbnail_id, 'large'); | |
$thumbnailFull = wp_get_attachment_image_src( $thumbnail_id, 'full'); |
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 | |
/* | |
Change cancellation to set expiration date for next payment instead of cancelling immediately. | |
Assumes orders are generated for each payment (i.e. your webhooks/etc are setup correctly). | |
Since 2015-09-21 and PMPro v1.8.5.6 contains code to look up next payment dates via Stripe and PayPal Express APIs. | |
*/ | |
//before cancelling, save the next_payment_timestamp to a global for later use. (Requires PMPro 1.8.5.6 or higher.) |
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 toggle(id) { | |
var e = document.getElementById(id); | |
if( e.style.display == 'block' || getComputedStyle(e, null).display == 'block') | |
e.style.display = 'none'; | |
else | |
e.style.display = 'block'; | |
} |
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
// get all instances of a form on the post | |
const matches = document.querySelectorAll(".gform_wrapper form") | |
// we are using vue.js here with the slug of the current post in state | |
const slug = store.state.currentPost.slug | |
// loop through each form on the post | |
matches.forEach(function(match) { | |
// get the value of the id of the form | |
let gformID = match.getAttribute("id") | |
// get only the form number off the gravity form using regex | |
let isolatedID = /([1-9][0-9]*)/.exec(gformID) |
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
dig +short myip.opendns.com @resolver1.opendns.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
import Bowser from "bowser" | |
const bowser = Bowser.parse(window.navigator.userAgent) | |
document.addEventListener("DOMContentLoaded", function(){ | |
document.body.classList.add(`browser-${bowser.browser.name.toLowerCase()}`) | |
document.body.classList.add(`os-${bowser.os.name.toLowerCase()}`) | |
document.body.classList.add(`platform-${bowser.platform.type.toLowerCase()}`) | |
}); |
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 | |
// Manually create entries and send notifications with Gravity Forms | |
$form_id = 10; | |
// add entry | |
$entry = array( | |
"form_id" => $form_id, | |
"1" => "Entry for field ID 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
# ----------------------------------------------------------------- | |
# .gitignore for WordPress | |
# Bare Minimum Git | |
# http://ironco.de/bare-minimum-git/ | |
# ver 20150227 | |
# | |
# This file is tailored for a WordPress project | |
# using the default directory structure | |
# | |
# This file specifies intentionally untracked files to ignore |
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
# This is a basic workflow to help you get started with Actions | |
name: Deploy Production | |
# Controls when the action will run. | |
on: | |
# Triggers the workflow on push or pull request events but only for the master branch | |
push: | |
branches: [ master ] |