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
$pods = pods( 'property', get_the_ID()); | |
var_dump($pods->field("contact_forms_shortcode")); |
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
define( 'AMP_QUERY_VAR', apply_filters( 'amp_query_var', 'amp' ) ); | |
add_rewrite_endpoint( AMP_QUERY_VAR, EP_PERMALINK ); | |
add_filter( 'template_include', 'amp_page_template', 99 ); | |
function amp_page_template( $template ) { | |
if( get_query_var( AMP_QUERY_VAR, false ) !== false ) { | |
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 ( is_front_page() && is_home() ) { | |
// Default homepage | |
} elseif ( is_front_page()){ | |
//Static homepage | |
} elseif ( is_home()){ |
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
define( 'AMP_QUERY_VAR', 'amp' ); | |
add_rewrite_endpoint(AMP_QUERY_VAR , EP_PERMALINK | EP_PAGES | EP_ROOT); | |
add_filter( 'template_include', 'amp_page_template',99 ); | |
function amp_page_template( $template ) { | |
if( get_query_var( AMP_QUERY_VAR , false ) !== false ) { |
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
/** | |
* Create Custom Members Price Field for Woocommerce Product | |
* @since 1.0.0 | |
*/ | |
function nb_create_member_price_field() { | |
$args = array( | |
'id' => 'member_price', | |
'label' => __( 'Members Price', 'cfwc' ), | |
'class' => 'nb-custom-field', | |
'desc_tip' => true, |
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 helper functions from global scope | |
const { registerBlockType } = window.wp.blocks; | |
const { __ } = window.wp.i18n; | |
// Use registerBlockType to create a custom block | |
registerBlockType( | |
'example-plugin/example-custom-block', | |
{ | |
// Localize title using wp.i18n.__() | |
title: __( 'Block 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
/* | |
* This is an abbreviated "ES5" script (though it has some ES6 language, just not JSX, or dependencies on npm) | |
* demonstrating how to get the WordPress "Gutenberg" SelectControl to allow dynamic options. | |
* | |
* It probably isn't elegant, but neither am I...I included more context than may be necessary. | |
* | |
* (SelectControl pukes on dynamic options because it completely dies, never to be seen again, if it | |
* is sent an empty options array. This prevents that with a placeholder until your results come back.) | |
*/ |
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
/* | |
NPM Setup | |
npm init | |
npm install -g gulp | |
npm install --save-dev gulp | |
npm install jshint gulp-jshint gulp-sass gulp-concat gulp-uglify gulp-rename --save-dev | |
*/ | |
// Include gulp |
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 | |
/** | |
* Add checkbox field to the checkout | |
**/ | |
add_action('woocommerce_after_order_notes', 'my_custom_checkout_field'); | |
function my_custom_checkout_field( $checkout ) { | |
echo '<div id="my-new-field"><h3>'.__('My Checkbox: ').'</h3>'; |
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 | |
/** | |
* This function assumes that "fedex_is_insured" filter is enabled | |
* in WooCommerce Fedex Plugin. This was manually added by me by altering the Fedex plugin code. | |
* $this->insure_contents = apply_filters( 'fedex_is_insured', $this->insure_contents); | |
*/ | |
function nb_update_insurance_for_fedex(){ | |
$insurance = WC()->session->get( 'nb_insurance' ); | |
if ( "1" == $insurance ) { |