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
// Custom Templates Shortcode to Get Templates from the /templates Directory | |
// Usage: [gettemplate name="templatename"] | |
function prefix_templates_shortcode_function( $atts ){ | |
$a = shortcode_atts( array( | |
'name' => 'none' | |
), $atts ); | |
ob_start(); | |
get_template_part('templates/' . $a['name']); | |
return ob_get_clean(); |
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
//Max Clicks | |
var i = 0; | |
var el = document.getElementById("cb-dust-particles"); | |
el.addEventListener("click", function(){ | |
i++; | |
if(i == 10) { | |
pJSDom[0].pJS.interactivity.events.onclick.enable = false; | |
} | |
}, false); |
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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RedirectMatch 301 ^/wp-content/uploads/([0-9]{4})/([0-9]{2})/(.*)$ https://www.mylivesite.com/wp-content/uploads/$1/$2/$3 | |
</IfModule> |
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
/** | |
* Enable REST API Support for Charitable Campaigns | |
* | |
*/ | |
/** | |
* Register support for post type | |
*/ | |
function en_enable_campaign_rest_support( $post_type_args ) { |
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 | |
/** | |
* Register an action with 'fl_page_data_add_properties' hook | |
*/ | |
add_action( 'fl_page_data_add_properties', 'demo_add_properties' ); | |
function demo_add_properties(){ | |
/** |
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
// Example of how to zip a directory | |
var gulp = require('gulp'); | |
var zip = require('gulp-zip'); | |
gulp.task('zip', function () { | |
return gulp.src([ | |
'./**/*', | |
'!./{node_modules,node_modules/**/*}', | |
'!./assets/{sass,sass/*}', | |
'!./gulpfile.js', |
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 | |
// Disables the visual editor on Caldera forms backend so things like HTML emails don't get messed up | |
add_filter( 'user_can_richedit', 'caldera_page_can_richedit' ); | |
function caldera_page_can_richedit( $can ) | |
{ | |
$screen = get_current_screen(); | |
if( $screen->id == 'toplevel_page_caldera-forms'){ | |
return false; | |
} | |
return $can; |
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 | |
/** | |
* Deletes a batch (max 50) of S2 Members users | |
* @return int number of users deleted | |
*/ | |
public function delete_batch_of_expired_users(){ | |
$max_users = 50; | |
$args = array( |
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 | |
/** | |
* Grab the url of a publicly embeddable video hosted on vimeo | |
* @param str $video_url The "embed" url of a video | |
* @return str The url of the thumbnail, or false if there's an error | |
*/ | |
function grab_vimeo_thumbnail($vimeo_url){ | |
if( !$vimeo_url ) return false; | |
$data = json_decode( file_get_contents( 'http://vimeo.com/api/oembed.json?url=' . $vimeo_url ) ); |
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 | |
/** | |
* Hides the thirsty link buttons | |
*/ | |
function fsb_admin_hide_ta_mce_button(){ | |
if( get_post_type() == 'post' ){ | |
echo '<style>.mce-toolbar .mce-btn-group .mce-btn.ta-add-link-button + .mce-btn {display: none;}</style>'; | |
} | |
} | |
add_action( 'admin_head', 'fsb_admin_hide_ta_mce_button' ); |