Skip to content

Instantly share code, notes, and snippets.

View bdeleasa's full-sized avatar

Brianna Deleasa bdeleasa

View GitHub Profile
@bdeleasa
bdeleasa / wordpress-seo-og-image-fix.php
Created March 20, 2017 17:02
Wordpress plugin that outputs og:image:width and og:image:height tags because Facebook needs them when sharing URLs for the first time.
<?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 / wp-adjacent-post-nav-orderby-menu-order.php
Created February 21, 2017 14:55
Orders the Wordpress post navigation links by menu order instead of date.
<?php
add_filter( 'get_next_post_where', 'PLUGINNAME_adjacent_post_where' );
add_filter( 'get_previous_post_where', 'PLUGINNAME_adjacent_post_where' );
/**
* Overrides the post navigation to sort by menu order.
*
* @since 1.0.0
*
* @param $sql
* @return mixed
@bdeleasa
bdeleasa / dequeue-easy-testimonials-scripts.php
Created February 12, 2017 17:11
Dequeues the default styles provided by the Easy Testimonials plugin.
<?php
add_action( 'wp_enqueue_scripts', 'themename_dequeue_easy_testimonials_scripts' );
/**
* Dequeues the default styles provided by the Easy Testimonials plugin.
*
* We're styling the widgets and posts ourselves, so we don't need their
* extra stylesheet.
*
* @since 1.0.0
@bdeleasa
bdeleasa / dequeue-upw-styles.php
Created January 23, 2017 19:06
Dequeues the default stylesheet from the Ultimate Posts Widget plugin.
<?php
add_action( 'wp_enqueue_scripts', 'themename_dequeue_upw_styles', 999 );
/**
* Dequeues the default stylesheet from the Ultimate Posts Widget plugin.
*
* We're going to style the widget ourselves, so instead of loading and
* overriding unnecessary styles, we're just going to remove the stylesheet.
*
* @since 1.0.0
*
@bdeleasa
bdeleasa / search-filter-only-posts.php
Created December 13, 2016 15:59
Wordpress plugin that filters the Wordpress search results to show only posts, no other post types.
<?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.
*
* @since 1.0.0
@bdeleasa
bdeleasa / the-events-calendar-show-all-events.php
Last active February 22, 2021 18:11
Modifies the event archive provided by The Events Calendar plugin to include both present and past events.
<?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 / upw-query-only-posts-with-featured-image.php
Created September 4, 2016 18:02
Filter the Ultimate Posts Widget posts to only include posts with a featured image.
@bdeleasa
bdeleasa / dequeue-easy-testimonials-scripts-styles.php
Created August 25, 2016 13:39
Functions for dequeueing unneeded scripts and styles outputted by the Easy Testimonials plugin.
<?php
add_action( 'wp_enqueue_scripts', 'themename_dequeue_easy_testimonials_style', 999 );
/**
* Removes the Easy Testimonials CSS style because we're styling the testimonials
* in our stylesheet.
*
* @since 1.0.0
*
* @param none
@bdeleasa
bdeleasa / wp-domain-masking.php
Created April 14, 2016 15:19
Wordpress plugin that removes the X-Frame-Options header to allow for domain masking.
<?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 / 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');