Skip to content

Instantly share code, notes, and snippets.

View santanup789's full-sized avatar

Santanu Patra santanup789

  • Webskitters
  • India
View GitHub Profile
@mariovalney
mariovalney / woo-enable-reviews-bulk-edit.php
Created August 7, 2017 19:55
WooCommerce Enable Reviews - Bulk Edit
<?php
/**
*
* Plugin Name: WooCommerce Enable Reviews - Bulk Edit
* Description: Allow enable reviews by bulk edit into WooCommerce
* Version: 1.0.0
* Author: Mário Valney
* Author URI: http://mariovalney.com
* Text Domain: woo-enable-reviews-bulk-edit
*
@phillipwilhelm
phillipwilhelm / gist:048191a6411f9093d8f4879d9e991def
Created September 4, 2017 17:57
Gravity Forms - API Email Validation for FIELD
// Email validation by third-party API
// The following example shows how you can send the value of an Email type field to a third-party API to determine if the email is valid. In this example we are using the QuickEmailVerification API.
add_filter( 'gform_field_validation', function ( $result, $value, $form, $field ) {
if ( $field->get_input_type() === 'email' && $result['is_valid'] ) {
$request_url = add_query_arg(
array(
'email' => $value,
'apikey' => 'your_api_key_here',
@lukecav
lukecav / functions.php
Last active April 3, 2024 23:20
Logout of WordPress without confirmation message
function getLogoutUrl($redirectUrl = ''){
if(!$redirectUrl) $redirectUrl = site_url();
$return = str_replace("&amp;", '&', wp_logout_url($redirectUrl));
return $return;
}
/**
* Bypass logout confirmation on nonce verification failure
*/
function logout_without_confirmation($action, $result){
@ccurtin
ccurtin / woocommerce-search-products-by-category-dropdown.php
Created December 11, 2017 17:42
WooCommerce Search Products by Category Dropdown
<form name="myform" method="GET" action="<?php echo esc_url(home_url('/'));?>">
<?php if (class_exists('WooCommerce')): ?>
<?php
if (isset($_REQUEST['product_cat']) && !empty($_REQUEST['product_cat'])) {
$optsetlect = $_REQUEST['product_cat'];
} else {
$optsetlect = 0;
}
$args = array(
@danielcharrua
danielcharrua / gravity_forms_date_conditional.js
Created January 6, 2021 18:06
Add conditional fields depending on a date field
<script>
gform.addAction( 'gform_input_change', function( elem, formId, fieldId ) {
if ( fieldId == 13 ) {
valorCampoDate = elem.value;
var parts = valorCampoDate.split( '/' );
// Presta atención al mes ( parts[1] ); JavaScript cuenta los meses desde 0:
// Enero - 0, Febrero - 1, etc.
var myDate = new Date( parts[2], parts[1] - 1, parts[0] );
// Cambiar el valor del campo oculto.