This file contains 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
/* Attrify | |
Allows you to activate and configure jQuery plugins* via html attributes & without writing javascript. | |
* most, not all. | |
EXAMPLE: | |
<a class="attrify" | |
data-plugn="nivoLightbox" | |
data-effect="fade" | |
data-theme="default" |
This file contains 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 | |
/** | |
* Plugin Name: CF Get Submission Data | |
* Plugin URI: | |
* Description: Example in getting submission data in a form processor | |
* Version: 1.0.0 | |
* Author: David Cramer | |
* Author URI: | |
* License: GPL-2.0+ | |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
This file contains 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 | |
// Simple snippet to show how to use Foundation's grid over the built in Bootstrap grid. | |
add_filter('caldera_forms_render_grid_settings', 'setup_foundation_grid', 10, 2); | |
function setup_foundation_grid($grid, $form){ | |
// Bootstrap grid sized to foundation equivilents | |
$grid_sizes = array( | |
'xs' => 'small', | |
'sm' => 'small', |
This file contains 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 | |
// Default grid render settings | |
$grid_settings = array( | |
"first" => 'first_row', // Classname for first row | |
"last" => 'last_row', // Classname for last row | |
"single" => 'single', // Classname for single row (grid with only 1 row) | |
"column_first" => 'first_col', // Classname for first column | |
"column_last" => 'last_col', // Classname for last column | |
"column_single" => 'single', // Classname for single column (grid row with a single column) |
This file contains 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 | |
/* Example to auto populate an option based field in caldera forms | |
* This example uses a by slug. method. this way you can populate the | |
* field by simply giving it the desired slug. in this example: gdp | |
* | |
* To populate based on type where {type} is dropdown, radio, checkbox etc... | |
* add_filter('caldera_forms_render_get_field_type-{type}', 'cf_get_data_json'); | |
*/ | |
// Add filter on the fetch field config to populate |
This file contains 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
$.fn.formJSON = function(){ | |
var fields = $(this).serializeArray(), | |
json = {}, | |
arraynames = {}; | |
for( var v = 0; v < fields.length; v++){ | |
var field = fields[v], | |
name = field.name.replace(/\]/gi,'').split('['), | |
value = field.value, | |
lineconf = {}; | |
for(var i = name.length-1; i >= 0; i--){ |
This file contains 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 re_init_wp_editors(){ | |
if( typeof tinyMCEPreInit === 'undefined'){ | |
return; | |
} | |
var ed, init, edId, qtId, firstInit, wrapper; | |
if ( typeof tinymce !== 'undefined' ) { |
This file contains 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
jQuery( function( $ ){ | |
var first_date_id = 'fld_5161421', // date field ID to sync from | |
second_date_id = 'fld_8954452', // date field ID to sync to | |
date_forward = 1; // number of days to sync forward by | |
// get the first field | |
var first_date = $( '[data-field="' + first_date_id + '"]' ); | |
if( !first_date.length ){ |
This file contains 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 this to your theme or child theme's functions.php file to | |
// remove the cf_id=x from redirect URLs on form submit | |
function cf_remove_cfid( $url ){ | |
if( false !== strpos( $url, '?' ) ){ | |
$parts = explode( '?', $url ); | |
parse_str( $parts[1], $query ); | |
if( isset( $query['cf_id'] ) ){ | |
unset( $query['cf_id'] ); | |
return $parts[0] . '?' . http_build_query( $query ); |
This file contains 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 | |
/** | |
* The Template for displaying product archives, including the main shop page which is a post type archive | |
* | |
* This template can be overridden by copying it to yourtheme/woocommerce/archive-product.php. | |
* | |
* HOWEVER, on occasion WooCommerce will need to update template files and you | |
* (the theme developer) will need to copy the new files to your theme to | |
* maintain compatibility. We try to do this as little as possible, but it does | |
* happen. When this occurs the version of the template file will be bumped and |
OlderNewer