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 $args = array( | |
'post_type' => 'location', | |
'posts_per_page' => -1, | |
'order' => 'ASC', | |
'orderby' => 'title', | |
'facetwp' => true, | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'advertiser-level', | |
'field' => 'slug', |
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 | |
if(!isset($_GET['a'])) { | |
die('<form action="" method="get"><input type="text" name="a"/><input type="submit"/></form>'); | |
} | |
$url = "https://1fichier.com/?" . urlencode($_GET['a']) . "?auth=1&inline"; | |
stream_context_set_default(array( | |
'http' => array( | |
'method' => 'GET', | |
'header' => 'Authorization: Basic ' . '[BASE64 encoded login credentials. Format: "user:pass" (without quotes)]' |
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
// Change 'download' slug to something else | |
define('EDD_SLUG', 'books'); |
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
/* | |
* Sell Products Individually in WooCommerce | |
*/ | |
add_filter( 'woocommerce_is_sold_individually', 'cj_woocommerce_is_sold_individually', 10, 2 ); | |
function cj_woocommerce_is_sold_individually( $value, $product ) { | |
$isi = get_post_meta( $product->id, '_custom_sell_individually', 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
// Block Non-Admins from Accessing Dashboard | |
function blockusers_init() { | |
if ( is_admin() && ! current_user_can( 'administrator' ) && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) { | |
wp_redirect( home_url() ); | |
exit; | |
} | |
} | |
add_action( 'init', 'blockusers_init' ); |
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
<script> | |
// This example displays an address form, using the autocomplete feature | |
// of the Google Places API to help users fill in the information. | |
// This example requires the Places library. Include the libraries=places | |
// parameter when you first load the API. For example: | |
// <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places"> | |
var placeSearch, autocomplete; | |
var componentForm = { |
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
<script> | |
// This example displays an address form, using the autocomplete feature | |
// of the Google Places API to help users fill in the information. | |
// This example requires the Places library. Include the libraries=places | |
// parameter when you first load the API. For example: | |
// <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places"> | |
var placeSearch, autocomplete; | |
var componentForm = { |
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
/** | |
* Change payment currency base from another field, when specific form is submitted. | |
*/ | |
add_action( 'gform_pre_submission_2', 'change_currency_' ); | |
function change_currency_( $form ) { | |
add_filter( 'gform_currency', function() { return rgpost('input_4'); } ); | |
} |
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
/** | |
* Gravity Wiz // Gravity Forms // Style Number Fields like Total Field | |
* | |
* Use "gf_price" and "gf_total" CSS classes via the "CSS Class Name" setting to style your Number fields like a product | |
* price (red) or total (green). | |
*/ | |
.gform_wrapper .gf_price input[type=text], | |
.gform_wrapper .gf_price input[type=number] { | |
border: 0; | |
font-size: 1.2em; |
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 fields to new vendor form | |
add_action( 'shop_vendor_add_form_fields', 'custom_add_vendor_fields', 2, 1 ); | |
function custom_add_vendor_fields( $taxonomy ) { | |
?> | |
<div class="form-field"> | |
<label for="vendor_website"><?php _e( 'Vendor website' ); ?></label> | |
<input type="text" name="vendor_data[website]" id="vendor_website" class="vendor_fields" /><br/> | |
<span class="description"><?php _e( 'The vendor\'s website.' ); ?></span> | |
</div> | |
<?php |