Skip to content

Instantly share code, notes, and snippets.

Avatar

Andrew Schultz eversionsystems

View GitHub Profile
@eversionsystems
eversionsystems / _ajax-search.php
Last active Sep 26, 2021
WordPress AJAX Live Search Without jQuery Dependency Using Fetch API
View _ajax-search.php
<?php
namespace ES_AJAX_Search;
function ajax_search_shortcode()
{
ob_start();
?>
<div class="search-wrapper">
@eversionsystems
eversionsystems / .htaccess
Created Jun 19, 2021
Load WordPress server upload directory files from localhost. Circumvent having to download large wp-upload directories so we can load images locally.
View .htaccess
#Allow us to load images from server instead of having to download them all for large sites
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} ^/wp-content/uploads/[^\/]*/.*$
RewriteRule ^wp-content/uploads/(.*)$ https://yourwebsitename.com/wp-content/uploads/$1 [NC,L]
</IfModule>
@eversionsystems
eversionsystems / select2-bootstrap4.scss
Last active May 24, 2020
Haven't been able to find anything that formats the select2 control properly for Bootstrap 4 so I complied this sccs file to do so. Includes form validation styling but only includes form-control-lg and form-control classes. Will add the form-control-sm later.
View select2-bootstrap4.scss
/**
* Feel free to change the colors below.
* Need to update this this to handle form-control-sm.
* Ensure you load these customizations after the select2 css file in order to override them.
*
* This is an example of the input and jQuery you need
*
* <select id="select-example" class="custom-select form-control" style="width:100%">
<option value="">--Add Value--</option>
</select>
@eversionsystems
eversionsystems / multiple-roles-per-user.php
Last active Jul 26, 2021 — forked from nikolov-tmw/multiple-roles-per-user.php
Multiple roles per user WordPress plugin. Supports editing your own profile's roles.
View multiple-roles-per-user.php
<?php
/**
* Plugin Name: Multiple Roles per User
* Description: Allows anyone who can edit users to set multiple roles per user. In a default WordPress environment that wouldn't have much of an effect, since the user would have the privileges of the top-privileged role that you assign to him. But if you have custom roles with custom privileges, this might be helpful.
* Version: 1
* Author: nikolov.tmw
* Author URI: http://paiyakdev.com/
* License: GPL2
*/
@eversionsystems
eversionsystems / config
Last active Mar 27, 2020
How to tell Git which SSH Key to use - WPEngine Scenario with multiple accounts
View config
#Examples of using WP Engine to setup repositories. If both sites are on the same account you can use the same private key.
#Windows user file c:\users\user\.ssh\config
Host website1
User git
Hostname git.wpengine.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/key_rsa
IdentitiesOnly yes
@eversionsystems
eversionsystems / woocommerce-ajax-checkout-spinner.css
Last active Jul 21, 2022
WooCommerce Change AJAX Spinner Gif On Checkout
View woocommerce-ajax-checkout-spinner.css
/*
* Custom AJAX spinner on WooCommerce checkout
* The class used to load the overlay is .blockUI .blockOverlay
* The class used to load the spinner is .woocommerce .loader:before
*
*/
.woocommerce .blockUI.blockOverlay:before,.woocommerce .loader:before {
height: 3em;
width: 3em;
position: absolute;
@eversionsystems
eversionsystems / wp-config.php
Last active Mar 7, 2018
WP Config Debug Enable
View wp-config.php
define('WP_DEBUG', true);
if ( WP_DEBUG ) {
// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'log_errors', 'On' );
@ini_set( 'display_errors', 'Off' );
@ini_set( 'error_reporting', E_ALL );
@ini_set( 'error_log', 'php_error.log' );