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 | |
////////////////////////////////////////////////////////////////////////////////// | |
//////////////////// 🚀 Schwifty-𝓪𝓼𝓼 Link Fixer 3000™ ///////////////////////////// | |
////////////////////////////////////////////////////////////////////////////////// | |
// | |
// The purpose of this snippet is to leverage the Redirection plugin database to | |
// dynamically replace links within Wordpress content so the site itself has as few | |
// pointers to URLs that redirect as possible. | |
// | |
function schwifty_replace_old_links_in_content($content) { |
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($){ | |
if(typeof gtag != 'function') { | |
return; | |
} | |
var fluentForms = $('form.frm-fluent-form'); | |
fluentForms.each(function() { | |
var $form = $(this); | |
var formId = $form.attr('data-form_id'); | |
gtag('event', 'ViewForm', { |
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(){"use strict";var e=0,r={};function i(t){if(!t)throw new Error("No options passed to Waypoint constructor");if(!t.element)throw new Error("No element option passed to Waypoint constructor");if(!t.handler)throw new Error("No handler option passed to Waypoint constructor");this.key="waypoint-"+e,this.options=i.Adapter.extend({},i.defaults,t),this.element=this.options.element,this.adapter=new i.Adapter(this.element),this.callback=t.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=i.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=i.Context.findOrCreateByElement(this.options.context),i.offsetAliases[this.options.offset]&&(this.options.offset=i.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),r[this.key]=this,e+=1}i.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},i.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(th |
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
// this should work in most cases to fix escaped quotes when querystring var has a quote (' or ") and is the value of an input or textarea | |
// it does not handle hidden fields ... feel free to improve on it or leave a comment with ideas | |
jQuery( function ( $ ) { | |
$( document ).on( 'nfFormReady', function ( ) { | |
$( 'textarea.ninja-forms-field,input[type=text].ninja-forms-field' ).each( function () { | |
var $input = $(this), | |
val = $input.val(); | |
val = val.replace(/\\'/gm,"'").replace(/\\"/gm,'"'); | |
$input.val(val).change(); | |
} ); //each |
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
add_action( 'wp_footer', function () { ?> | |
<script> | |
// don't run until main slidebars init has happened to avoid JS error | |
jQuery( window ).on( 'ocs_after', function () { | |
// @TODO add cookie test | |
// @TODO add skip list | |
// @TODO add config based on body class or something |
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 | |
// NEWS!!! NEWS!!! **** FEBRUARY 2020 // | |
// I rolled this code into a plugin! | |
// Download plugin Lazy Load Background Images for Elementor. Link is in comments below. | |
// Or go to https://james.revillini.com/projects/ | |
// if you don't want another plugin, the code below works (last time I checked) | |
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 | |
// ---------------------------------------- REDIRECT REPLY POSTS TO TOPIC WITH REPLY ANCHOR | |
function jrevillini_reply_redirect( $wp_query ) { | |
if ( !function_exists('bbp_get_reply_url') ) return; // skip this if bbpress not active | |
if ( !isset($wp_query->query['reply']) ) return; // skip if not a bbpress reply page | |
if ( isset($wp_query->query['edit']) ) return; //skip if we are EDITING a bbpress reply | |
wp_safe_redirect( bbp_get_reply_url( $wp_query->query['reply'] ) ); | |
} | |
add_action('pre_get_posts', 'jrevillini_reply_redirect'); |
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
// ------------------ AUTOFOCUS ON USERNAME FIELD WHEN SIGNING IN | |
$(document).on('click', '.lwa-links-modal', function(e){ | |
$('#lwa_user_login').focus(); | |
}); |