Skip to content

Instantly share code, notes, and snippets.

<?php
/*
Plugin Name: Woocommerce NewBook.cloud Integration
Plugin URI: https://camerongilroy.com
Description: Woocommerce NewBook.cloud Integration
Version: 1.0.0
Author: Cameron Gilroy
Author URI: https://camerongilroy.com
License: GPL-2.0+
License URI: http://www.gnu.org/licenses/gpl-2.0.txt
<div id="tallemu-crm-web-form-e9ebd388-8c9c-4802-b13b-90de23f4f159">Loading...</div>
<script defer="" type="text/javascript" src="https://weblink.tallemu.com/api/webform/loader?dbKey=96e01c59-d938-412a-a065-b7e066700301&formKey=e9ebd388-8c9c-4802-b13b-90de23f4f159&SkipCSS=true"></script>
//this sets the number of columns that are displayed when the Big Camp booking is done.
function wc_cp_summary_max_columns( $cols, $composite )
{
$cols = 5;
return $cols;
}
add_filter('woocommerce_composite_component_summary_max_columns', 'wc_cp_summary_max_columns', 10, 2);
//Skip the cart page if the product is Big Camp 2020
function Add_To_Cart_redirect()
.oxygen-vsb-responsive-video-wrapper {padding-bottom:0!important}
.oxygen-builder-body .oxygen-vsb-responsive-video-wrapper, .admin-bar .oxygen-vsb-responsive-video-wrapper {padding-bottom: 56.25%!important;}
@CameronGilroy
CameronGilroy / Shortcodes
Created September 27, 2019 01:10
GiveWP & Oxygen
[ct_new_columns ct_options='{"ct_id":4,"ct_parent":0,"selector":"new_columns-4-12387"}'][ct_div_block ct_options='{"ct_id":5,"ct_parent":4,"selector":"div_block-5-12387","original":{"width":40,"width-unit":"%"},"activeselector":false}'][ct_code_block ct_options='{"ct_id":3,"ct_parent":5,"selector":"code_block-3-12387","original":{"code-php":"PD9waHAKCWVjaG8gZG9fc2hvcnRjb2RlKCAnW2dpdmVfZm9ybSBpZD0iJy5nZXRfdGhlX0lEKCkuJyIgc2hvd190aXRsZT0iZmFsc2UiIHNob3dfZ29hbD0idHJ1ZSIgc2hvd19jb250ZW50PSJhYm92ZSJdJyApOwo/Pg=="},"activeselector":false}'][/ct_code_block][/ct_div_block][ct_div_block ct_options='{"ct_id":6,"ct_parent":4,"selector":"div_block-6-12387","original":{"width":60,"width-unit":"%"},"activeselector":false}'][ct_text_block ct_options='{"ct_id":11,"ct_parent":6,"selector":"text_block-11-12387","original":{"margin-top":"58"},"activeselector":false}'][ct_span ct_options='{"ct_id":12,"ct_parent":11,"selector":"span-12-12387"}'][oxygen data='excerpt' ][/ct_span][/ct_text_block][ct_headline ct_options='{"ct_id":15
<script>
document.addEventListener("DOMContentLoaded", function() { //is the page fully loaded, (the quiz is built with JS so this cant run before the quiz is loaded) https://wordpress.org/plugins/ultimate-viral-quiz/
document.querySelector(".single-post .uvq-quiz-container hr").remove();
document.querySelector(".single-post .uvq-quiz-container .text-description-content").remove();
document.querySelector(".single-post .uvq-quiz-container .col-md-6").classList.add('col-md-12');
document.querySelector(".single-post .uvq-quiz-container .col-md-6").classList.remove('col-md-6');
});
</script>
@CameronGilroy
CameronGilroy / Display_Spots.php
Created July 22, 2019 00:59
Display how many spots are left in the choice label when using the GP Limit Choices perk
<?php
/**
* Display how many spots are left in the choice label when using the GP Limit Choices perk
* https://gravitywiz.com/gravity-perks/
*/
add_filter( 'gplc_remove_choices', '__return_false' );
add_filter( 'gplc_pre_render_choice', 'ayc_add_how_many_left_message', 10, 5 );
function ayc_add_how_many_left_message( $choice, $exceeded_limit, $field, $form, $count ) {
$limit = rgar( $choice, 'limit' );
$how_many_left = max( $limit - $count, 0 );
@CameronGilroy
CameronGilroy / gist:5141caaa8308fc2941a9f07192cf024d
Created June 18, 2019 21:07
Oxygen editor console error log when givewp.com is installed
Note: The site owner has disabled Google Analytics tracking for your user role. app-5cda2213f911c80f508142c7.closte.com:70:11
ReferenceError: tinymce is not defined
app-5cda2213f911c80f508142c7.closte.com:55049:1
<anonymous> https://app-5cda2213f911c80f508142c7.closte.com/?ct_template=fundraising&ct_builder=true&ct_inner=true:55049
Error: $ is not a function
@https://app-5cda2213f911c80f508142c7.closte.com/wp-content/plugins/oxygen/component-framework/angular/controllers/ui.min.js:1:1162
X@https://app-5cda2213f911c80f508142c7.closte.com/wp-includes/js/jquery/jquery.js:3:4562
prop@https://app-5cda2213f911c80f508142c7.closte.com/wp-includes/js/jquery/jquery.js:4:13165
@https://app-5cda2213f911c80f508142c7.closte.com/wp-content/plugins/oxygen/component-framework/angular/controllers/ui.min.js:1:1133
invoke@https://ajax.googleapis.com/ajax/libs/angularjs/1.3.5/angular.js:4138:17
<?php
/**
* Hook: woocommerce_before_main_content.
*
* @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content)
* @hooked woocommerce_breadcrumb - 20
* @hooked WC_Structured_Data::generate_website_data() - 30
*/
@CameronGilroy
CameronGilroy / functions.php
Created May 13, 2018 00:31 — forked from stephanieleary/functions.php
Redirect private page 404 errors to the login screen with a message
<?php
add_action( 'wp', 'my_private_page_404' );
function my_private_page_404() {
$queried_object = get_queried_object();
if ( isset( $queried_object->post_status ) && 'private' == $queried_object->post_status && !is_user_logged_in() ) {
wp_safe_redirect( add_query_arg( 'private', '1', wp_login_url( $_SERVER['REQUEST_URI'] ) ) );
exit;
}