Skip to content

Instantly share code, notes, and snippets.

View garretthyder's full-sized avatar
🗞️
Working away

Garrett Hyder garretthyder

🗞️
Working away
View GitHub Profile
@hearvox
hearvox / wp-yoast-hooks.php
Last active March 6, 2021 13:02
Hooks to disable Yoast SEO plugin features and admin screen controls.
<?php
/*******************************
=Yoast SEO Hooks (includes Premium)
******************************/
/* Remove default redirects feature, for posts and term.
* @link https://kb.yoast.com/kb/how-to-disable-automatic-redirects/
*/
add_filter('wpseo_premium_post_redirect_slug_change', '__return_true' );
add_filter('wpseo_premium_term_redirect_slug_change', '__return_true' );
@Zodiac1978
Zodiac1978 / functions.php
Last active November 4, 2021 22:29
Display Wordpress Home/Front Page at top of Admin Pages List
<?php
/**
* Plugin Name: Page List Optimizer
* Description: Push Front Page & Posts Page & Privacy Page to top of admin list
* Plugin URI: https://torstenlandsiedel.de
* Version: 1.0
* Author: Torsten Landsiedel
* Author URI: http://torstenlandsiedel.de
* Licence: GPL 2
* License URI: http://opensource.org/licenses/GPL-2.0
@helgatheviking
helgatheviking / custom-modal-metabox.js
Last active May 21, 2024 10:43
Create a completely custom media frame (WIP)
/**
* @type {Object} JavaScript namespace for our application.
*/
var Custom_Modal = {};
(function($, Custom_Modal) {
var $ = jQuery;
_.extend( Custom_Modal, { view: {}, controller: {} } );
@BurlesonBrad
BurlesonBrad / functions.php
Created March 10, 2016 21:34 — forked from TimBHowe/functions.php
Reduce or remove WooCommerce 2.5 minimum password strength requirement for creating a user account. Warning: Use at your own risk.
<?php
/**
*Reduce the strength requirement on the woocommerce password.
*
* Strength Settings
* 3 = Strong (default)
* 2 = Medium
* 1 = Weak
* 0 = Very Weak / Anything
*/
@davidroyer
davidroyer / shortcodes.php
Created February 3, 2016 20:37 — forked from gyrus/shortcodes.php
TinyMCE button for WordPress shortcode
<?php
/**
* Skeletal sample shortcode
*/
add_shortcode( 'pilau-sample', 'pilau_sample_shortcode' );
function pilau_sample_shortcode( $atts ) {
extract( shortcode_atts( array(
'text' => ''
), $atts ) );
@mikejolley
mikejolley / ipn-test.php
Last active September 18, 2020 14:29
Quick snippet/plugin/dropin to test IPN support
<?php
/**
* Plugin Name: PayPal Sandbox IPN Tester
* Description: Pings the IPN endpoint to see if your server can connect. Just head to <a href="/?ipn-test=1">yoursite.com/?ipn-test=1</a> whilst logged in as admin.
* Version: 1.0.0
* Author: WooThemes
* Requires at least: 4.1
* Tested up to: 4.3
*/
if ( ! defined( 'ABSPATH' ) ) {
@garretthyder
garretthyder / woocommerce_emails_attach_downloadables.php
Created August 13, 2015 11:45
Add Downloadable Products to Woocommerce Completed Order & Invoice Emails as Attachments
<?php
// Add Downloadable Products to Woocommerce Completed Order & Invoice Emails as Attachments
function woocommerce_emails_attach_downloadables($attachments, $status, $order) {
if ( ! is_object( $order ) || ! isset( $status ) ) {
return $attachments;
}
if ( empty( $order ) ) {
return $attachments;
@yratof
yratof / functions.php
Created March 10, 2015 14:37
ACF OEmbed with thumbnails
<?php
/* Pull apart OEmbed video link to get thumbnails out*/
function get_video_thumbnail_uri( $video_uri ) {
$thumbnail_uri = '';
// determine the type of video and the video id
$video = parse_video_uri( $video_uri );
// get youtube thumbnail
@daithi-coombes
daithi-coombes / functions.php
Last active September 8, 2018 13:37
To enable 'price from' and 'price to' search for wordpress [WP Property Plugin](https://usabilitydynamics.com/products/wp-property/forum/topic/price-range-search/)
/**
* Rename these to the form input names you are going to use.
* When you create a new attribute in Properties->Settings->Developer
* the form input name will appear greyed out under the attribute name
*/
define('SPRP_SEARCH_FROM_KEY', 'price_from_per_month');
define('SPRP_SEARCH_TO_KEY', 'price_to_per_month');
function parse_search(){
@jaredatch
jaredatch / gist:5645033
Last active February 4, 2023 12:51
Modify/change the default allowed tags for bbPress.
<?php
/**
* Modify/change the default allowed tags for bbPress.
*
* The default list (below) is in bbpress/includes/common/formatting.php, L24-66.
* Adjust below as needed. This should go in your theme's functions.php file (or equivilant).
*/
function ja_filter_bbpress_allowed_tags() {
return array(