Skip to content

Instantly share code, notes, and snippets.

View c-nefi's full-sized avatar

Nefi C c-nefi

View GitHub Profile
@c-nefi
c-nefi / functions.php
Last active December 13, 2015 18:18 — forked from joshmoto/functions.php
// SEND EMAIL WHAT SHOW ON CUSTOM BOX
function print_my_custom_notification_box( $post ) {
wp_nonce_field( 'my_custom_notification_box_nonce_action', 'my_custom_notification_box_nonce_field' ); ?>
<script type="text/javascript">
jQuery(document).ready(function($){
$('#mynotification-box-button').click(function(e){
e.preventDefault();
$('#mynotification-box .spinner').show();
$.ajax({ url: ajaxurl, data: { action: 'sendnotification', postID: $('#post_ID').val(), my_notification_nonce: $('#my_custom_notification_box_nonce_field').val() },
jQuery(document).ready(function($) {
var countryClass = '.dealer-country select',
dealerClass = '.dealer-name select',
savedtown = '';
function get_dealer_name(){
var countrySelect = $(countryClass),
country = countrySelect.val(),
dealerSelect = countrySelect.parents('form').find(dealerClass);
dealerSelect.attr('disabled','disabled');
@c-nefi
c-nefi / gist:4663590
Last active December 11, 2015 21:38 — forked from joshmoto/gist:4663253
<!-- THE SCRIPT -->
<?php echo do_shortcode('[gravityform id="3" name="Competition Entry" ajax="true"]'); ?>
<script type="text/javascript">
jQuery(document).ready(function($) {
var countryClass = '.dealer-country select',
dealerClass = '.dealer-name select';
<script type="text/javascript">
jQuery(document).ready(function($) {
var countyClass = '.dealer-country select',
dealerClass = '.dealer-name select';
// disable dealer name before county county selected
$(dealerClass).attr('disabled','disabled');
$(countyClass).change(function(){
var countySelect = $(this),