Skip to content

Instantly share code, notes, and snippets.

@carmoreira
carmoreira / europe.txt
Created March 26, 2019 11:46
Europe Countries Group for Interactive World Maps
group:GG|JE|AX|DK|EE|FI|FO|GB|IE|IM|IS|LT|LV|NO|SE|SJ|AT|BE|CH|DE|DD|FR|FX|LI|LU|MC|NL|BG|BY|CZ|HU|MD|PL|RO|RU|SU|SK|UA|AD|AL|BA|ES|GI|GR|HR|IT|ME|MK|MT|CS|RS|PT|SI|SM|VA|YU
@carmoreira
carmoreira / fix.php
Created April 4, 2019 17:25
traveler theme fix to use advisor quiz
add_action('admin_enqueue_scripts','traveler_fix', 100);
function traveler_fix() {
if( isset( $_GET['page'] ) && $_GET['page'] === 'advqoptions' ){
wp_deregister_script('select2.js');
wp_dequeue_script('select2.js');
wp_deregister_script('select2_js');
wp_dequeue_script('select2_js');
wp_deregister_script('select2');
wp_dequeue_script('select2');
@carmoreira
carmoreira / nopointers.css
Created April 9, 2019 14:36
disable pointer events for tooltip in interactive world maps - fixes tooltip 'blinking' issue
.iwm_map_canvas .google-visualization-tooltip {
pointer-events:none;
}
@carmoreira
carmoreira / lshowcase_workaround.js
Created April 16, 2019 22:13
Workaround to allow links to be clicked inside bxslider ( error: Added non-passive event listener to a scroll-blocking 'touchstart' event. )
jQuery('html').on('mousedown', '.bx-viewport a', function() {
var url = jQuery(this).attr('href');
if( url !== ''){
window.open( url, jQuery(this).attr('target') );
}
});
@carmoreira
carmoreira / cap.php
Created April 16, 2019 22:29
change capability in Interactive World Maps
add_filter( 'i_world_map_capability', 'my_custom_capability' );
function my_custom_capability() {
return 'manage_options';
}
@carmoreira
carmoreira / hacks.js
Last active April 23, 2019 16:53
hacks for team showcase layout
jQuery(document)
.ready(function () {
ts_move_cell(".tshowcase-box-info");
ts_move_cell(".tscontent");
ts_fix_url(".tshowcase-box-info");
ts_fix_url(".tscontent");
})
.ajaxSuccess(function () {
ts_move_cell(".tshowcase-box-info");
@carmoreira
carmoreira / allow_email.css
Created May 22, 2019 15:47
allow check answers to be clicked even without adding email.
.advq_disabled_button {
pointer-events:all !important;
opacity:1 !important;
}
@carmoreira
carmoreira / slow_redirect.js
Created May 22, 2019 16:04
slow redirect for Advisor Quiz results
// slow redirect
jQuery('.advq_profile_box').each(function() {
var redirect = jQuery(this).attr('data-redirect');
jQuery(this).attr('data-slow-redirect', redirect);
jQuery(this).attr('data-redirect', '');
});
jQuery('.advq_checkanswers .advq_button').on('click', function() {
setTimeout(function() {
jQuery('.advq_profile_box').each(function() {
@carmoreira
carmoreira / create_user.php
Created May 22, 2019 16:35
Create user from email submitted
add_action('adqv_email_submitted', 'advq_create_new_user_from_email');
function advq_create_new_user_from_email( $email_address ){
if( null == username_exists( $email_address ) ) {
// Generate the password and create the user
$password = wp_generate_password( 12, false );
$user_id = wp_create_user( $email_address, $password, $email_address );
// Set the nickname
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.