Skip to content

Instantly share code, notes, and snippets.

View bdeleasa's full-sized avatar

Brianna Deleasa bdeleasa

View GitHub Profile
@bdeleasa
bdeleasa / wp-disable-canonical-url-redirection.php
Created April 12, 2016 18:38
Disable Canonical URL Redirection WP Plugin
<?php
/*
Plugin Name: Disable Canonical URL Redirection
Description: Disables the "Canonical URL Redirect" features of WordPress 2.3 and above.
Version: 1.0
Author: Brianna Deleasa
Author URI: http://chooserethink.com
*/
remove_filter('template_redirect', 'redirect_canonical');
@bdeleasa
bdeleasa / gravityforms-wpbe-fix.php
Last active August 30, 2022 13:32
Wordpress plugin that fixes an issue with WP Better Emails not being able to format Gravity Forms email notifications.
<?php
/**
* Plugin Name: Gravity Forms - WPBE Email Fix
* Plugin URI: https://gist.github.com/bdeleasa/d3bff35069a9a025c82a
* Description: Wordpress mu-plugin which fixes an issue with WP Better Emails not being able to format Gravity Forms email notifications.
* Version: 1.0.0
* Author: Brianna Deleasa
* Author URI: https://briannadeleasa.com
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
@bdeleasa
bdeleasa / wp-admin-menu-fix.php
Created September 9, 2015 12:43
Fixes an issue with Wordpress 4.3 doing some funky things in Chrome.
<?php
add_action('admin_enqueue_scripts', 'hudsonawning_chrome_fix');
/**
* Fixes an issue with the admin menu doing funky things in Chrome.
* It's rather annoying.
*
* @param none
* @return none
*/
function hudsonawning_chrome_fix() {
@bdeleasa
bdeleasa / get-widgets-count.php
Created August 26, 2015 14:31
Function for Wordpress that returns the number of active widgets in a sidebar.
<?php
/**
* Counts the number of widgets in a widget area.
*
* @param $sidebar_index string The id of the widget area
* @return int
*/
function get_widgets_count( $sidebar_index ) {
global $wp_registered_sidebars;
@bdeleasa
bdeleasa / testimonials-by-woothemes-menu-fix.php
Created August 25, 2015 14:21
Fixes the issue of the Blog menu item and the testimonials archive menu item being 'active' at the same time when using the Testimonials by Woothemes plugin.
<?php
/**
* The plugin bootstrap file
*
* This file is read by WordPress to generate the plugin information in the plugin
* admin area. This file also includes all of the dependencies used by the plugin,
* registers the activation and deactivation functions, and defines a function
* that starts the plugin.
*
* @link http://example.com
@bdeleasa
bdeleasa / ngg-customizations.php
Last active August 29, 2015 14:25
Removes all default scripts and styles outputted by the Nextgen Gallery plugin. It also outputs the necessary code to replace the lightbox with the Foundation 5 reveal modal.
<?php
new Nextgen_Gallery_Customizations();
/**
* Class Nextgen_Gallery_Customizations
*
* The class responsible for removing all of the default scripts and
* styles that Nextgen outputs and replacing the scripts with the
* necessary jQuery to activate the Foundation 5 Reveal modal. This
@bdeleasa
bdeleasa / does-url-exist
Created July 20, 2015 13:50
Function that checks whether the given URL exists (not a 404 page).
<?php
/**
* Figures out whether the given URL exists
*
* @param string
* @return bool
*
* @since 0.0.1
*/
function does_url_exist( $url ) {
@bdeleasa
bdeleasa / wp-rename-set-featured-image
Created July 9, 2015 16:01
A Wordpress plugin that renames the Featured Image metabox and text.
@bdeleasa
bdeleasa / gist:7668d33225441b325070
Created July 7, 2015 15:31
Dequeue's the WP Social Networks Widget plugin styles
<?php
add_action( 'wp_enqueue_scripts', 'themename_dequeue_wpsnw_styles', 9999 );
/**
* Removes the WP Social Networks Widget plugin styles because we're styling
* the icons with our theme CSS.
*
* @param none
* @return none
*
@bdeleasa
bdeleasa / dequeue-sci-scripts
Created July 7, 2015 15:23
Dequeue's the Simple Contact Info plugin styles.
add_action( 'wp_enqueue_scripts', 'themename_dequeue_sci_scripts', 999 );
/**
* Remove the Simple Contact Info styles from our theme
*
* @param none
* @return none
*/
function yorksonlegal_dequeue_sci_scripts() {
wp_dequeue_style( 'contact-info' );