Skip to content

Instantly share code, notes, and snippets.

View lorenzocaum's full-sized avatar

Lorenzo Orlando Caum lorenzocaum

View GitHub Profile
@lorenzocaum
lorenzocaum / gist:0092e90982b2ffbf0fda
Created June 27, 2014 23:33
Replace Select One in dropdown menu with No
<?php
//* Do NOT include the opening php tag
//* Replace Select One in dropdown menu with No
function ee_rename_select_one() {
?>
<script type="text/javascript">
jQuery(document).ready(function () {
jQuery(".event_form_field").html(function(i,t){
return t.replace('Select One','No');
@lorenzocaum
lorenzocaum / gist:c29e360427c2b3491b05
Created July 8, 2014 16:30
Replace empty cart messaging in Event Espresso 3 with something else
<?php
//* Do NOT include the opening php tag
//* Replace empty cart messaging with something else
function ee_empty_cart_messaging($content)
{
$content = str_replace('It looks like you are attempting to refresh a page after completing your registration or your cart is empty. Please go to the events page and try again.', 'Your cart is empty.',$content);
return $content;
}
add_filter('the_content','ee_empty_cart_messaging', 200);
@lorenzocaum
lorenzocaum / gist:6683b64ea28589a1afc6
Created July 9, 2014 17:20
Remove zero option from MER in Event Espresso 3 and select 1 by default
<?php
//* Do NOT include the opening php tag
//* Remove the zero option in dropdown and set default to 1
function ee_remove_zero_from_dropdown() {
?>
<script>jQuery(document).ready(function(){
jQuery(".price_id").val(1);
jQuery('#event_espresso_refresh_total').trigger('click');
@lorenzocaum
lorenzocaum / new_gist_file.php
Created August 9, 2014 22:03
Change the register button in Event Espresso 3 to say buy tickets.
<?php
//* Do NOT include the opening php tag
function ee_replace_register_test_buy_tickets( $translated, $original, $domain ) {
$strings = array(
'Register' => 'Buy Tickets',
);
if ( isset( $strings[$original] ) ) {
$translations = get_translations_for_domain( $domain );
@lorenzocaum
lorenzocaum / new_gist_file.php
Last active August 29, 2015 14:05
Remove a category dropdown option for on a specific page using the event table for Event Espresso.This example will check for a page id of 12 and then remove the dropdown (select) option for Optimist Lanzarote.
<?php
//* Do NOT include the opening php tag
function ee_remove_category_options_from_dropdown() {
if(is_page('12')){
?>
<script>
jQuery(document).ready(function () {
jQuery("#ee_filter_cat option:contains(Optimist Lanzarote)").remove();
});
@lorenzocaum
lorenzocaum / new_gist_file_0
Created August 17, 2014 01:37
Example of how to embed a Youtube video in an event for Event Espresso 3
<p><iframe width="420" height="315" src="//www.youtube.com/embed/dQw4w9WgXcQ" frameborder="0" allowfullscreen></iframe></p>
@lorenzocaum
lorenzocaum / new_gist_file.sql
Created August 26, 2014 22:46
Reassign all questions to a specific WordPress user
UPDATE `yourdatabasename`.`dbprefix_events_question` SET `wp_user` = '1';
@lorenzocaum
lorenzocaum / site-specific-plugin-adjust-cherry-jquery.php
Last active February 20, 2018 18:24
Deactivate jQuery that is included with Cherry framework and request a compatible version for WordPress from the Google CDN
<?php
/*
Plugin Name: Update jQuery Cherry framework
Description: Deactivate jQuery that is included with Cherry framework and request a compatible version for WordPress from the Google CDN
*/
/* Begin Adding Functions Below This Line */
// Remove themes old version of jQuery and load a compatible version
add_action('wp_enqueue_scripts', 'update_jquery_for_cherry_framework', 11);
function update_jquery_for_cherry_framework() {
@lorenzocaum
lorenzocaum / new_gist_file.sql
Created August 30, 2014 05:14
Reassign all question groups to a specific WordPress user
UPDATE `yourdatabasename`.`dbprefix_events_qst_group` SET `wp_user` = '1';
@lorenzocaum
lorenzocaum / new_gist_file.sql
Created September 7, 2014 20:09
Sort redirects in the Redirection plugin by alphabetical order.
SET @initialposition = 0;
UPDATE `wp_redirection_items` set `position` = (@initialposition:=@initialposition+1)
ORDER BY `url` ASC