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 additional classes / id to the facetwp-template div generated by a facetwp | |
** layout template | |
**/ | |
add_filter( 'facetwp_shortcode_html', function( $output, $atts) { | |
if ( $atts['template'] = 'example' ) { // replace 'example' with name of your template | |
/** modify replacement as needed, make sure you keep the facetwp-template class **/ | |
$output = str_replace( 'class="facetwp-template"', 'id="masonry-container" class="facetwp-template small-up-1 medium-up-2 large-up-3"', $output ); | |
} | |
return $output; |
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
if ( ! function_exists( 'helper_vc_fonts' ) ) { | |
function helper_vc_fonts( $fonts_list ) { | |
$poppins->font_family = 'Poppins'; | |
$poppins->font_types = '300 light regular:300:normal,400 regular:400:normal,500 bold regular:500:normal,600 bold regular:600:normal,700 bold regular:700:normal'; | |
$poppins->font_styles = 'regular'; | |
$poppins->font_family_description = esc_html_e( 'Select font family', 'helper' ); | |
$poppins->font_style_description = esc_html_e( 'Select font styling', 'helper' ); | |
$fonts_list[] = $poppins; | |
return $fonts_list; |
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 | |
/** | |
* Remove the h1 tag from the WordPress editor. | |
* | |
* @param array $settings The array of editor settings | |
* @return array The modified edit settings | |
*/ | |
function remove_h1_from_editor( $settings ) { | |
$settings['block_formats'] = 'Paragraph=p;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre;'; | |
return $settings; |
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
//The following section is an add-on to this tutorial - https://tri.be/gravity-forms-events-calendar-submissions/ | |
//Shout to CreativeSlice.com for their initial work | |
/* Before Starting: | |
- Make sure you have these three plugins installed | |
- Gravity Forms | |
- The Events Calendar | |
- Gravity Forms + Custom Post Types | |
- Once Gravity Forms is installed, create a form with these fields | |
- Single Line Text (Event Title) | |
- Paragraph Text (Event Description) |
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 | |
/** | |
* WARNING! THIS SNIPPET MAY BE OUTDATED. | |
* The latest version of this snippet can be found in the Gravity Wiz Snippet Library: | |
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gw-gravity-forms-rename-uploaded-files.php | |
*/ | |
# First and Last Name | |
new GW_Rename_Uploaded_Files( array( | |
'form_id' => 628, |
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
/* | |
Based on: http://wordpress.stackexchange.com/questions/42652/#answer-42729 | |
These functions provide a simple way to interact with TinyMCE (wp_editor) visual editor. | |
This is the same thing that WordPress does, but a tad more intuitive. | |
Additionally, this works for any editor - not just the "content" editor. | |
Usage: |
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 pullJSON() { | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var sheets = ss.getSheets(); | |
var sheet = ss.getActiveSheet(); | |
var url="http://example.com/feeds?type=json"; // Paste your JSON URL here | |
var response = UrlFetchApp.fetch(url); // get feed | |
var dataAll = JSON.parse(response.getContentText()); // |
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 convertSheet2Json(sheet) { | |
// first line(title) | |
var firstRange = sheet.getRange(1, 1, 1, sheet.getLastColumn()); | |
var firstRowValues = firstRange.getValues(); | |
var titleColumns = firstRowValues[0]; | |
// after the second line(data) | |
var lastRow = sheet.getLastRow(); | |
var rowValues = []; | |
for(var rowIndex=2; rowIndex<=lastRow; rowIndex++) { |
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
<? | |
// Gravity Form Hook to SQL Database for Today's Dishes // | |
// the ### in gform_pre_render_### locates the id of your form // | |
add_filter('gform_pre_render_5', 'todays_dishes'); | |
function todays_dishes($form){ | |
foreach($form['fields'] as &$field){ |
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 | |
/** | |
* setup when your post type is saved to add _EventStartDate & _EventDuration | |
* meta fields add your own post types (line 10) to mach filters for the meta | |
* data. Then use tribe_get_events to query both all desired post types (be | |
* sure to set for future status) | |
*/ | |
function extend_events_startdate( $post_id ){ | |
//verify post is not a revision | |
if ( !wp_is_post_revision( $post_id ) && in_array( get_post_type( $post_id ), array( 'post' ) ) ) { |
NewerOlder