Skip to content

Instantly share code, notes, and snippets.

View nutsandbolts's full-sized avatar

Andrea Whitmer nutsandbolts

View GitHub Profile
@wpchannel
wpchannel / mu-yoast-seo-disable-notifications.php
Last active April 16, 2023 08:33
Hide annoying notifications after each upgrade of Yoast SEO plugin and others admin notices
<?php if (!defined('ABSPATH')) die('Restricted Area');
/*
* Plugin Name: Disable Yoast SEO Notifications
* Description: Hide annoying notifications after each upgrade of Yoast SEO plugin and others admin notices.
* Version: 1.1
* Author: Aurélien Denis
* Author URI: https://wpchannel.com/
*/
@WebEndevSnippets
WebEndevSnippets / functions.php
Created January 3, 2014 20:03
Genesis : Add comment count and remove standard comment title
add_action( 'genesis_before_comments' , 'webendev_comment_count' );
/**
* Add comment count and remove standard comment title
*
*/
function webendev_comment_count () {
add_filter( 'genesis_title_comments', '_return_null' );
if ( is_single() ) {
if ( have_comments() ) {
echo '<h3>';
@pippinsplugins
pippinsplugins / gist:11402562
Last active December 15, 2021 17:07
Custom user fields for Restrict Content Pro
<?php
/*
Plugin Name: Restrict Content Pro - Custom User Fields
Description: Illustrates how to add custom user fields to the Restrict Content Pro registration form that can also be edited by the site admins
Version: 1.0
Author: Pippin Williamson
Author URI: http://pippinsplugins.com
Contributors: mordauk
*/
function get_my_plugin_data(){
// You'll likely replace this with some sort of API call home.
$plugin = json_decode(
json_encode(
array(
'new_version' => 89,
'stable_version' => 89,
'name' => 'My Fake Plugin',
'slug' => 'my-fake-plugin',
'url' => 'https://myfakeplugin.com',
@mintplugins
mintplugins / edd-fix-child-licenses.php
Last active February 18, 2019 14:46
This is a simple plugin that can be used to set all child license keys expiration dates to their parent's. This is not for use in production, and is for example purposes only
<?php
/*
Plugin Name: Easy Digital Downloads - Fix child licenses
Description: Make the child licenses of all licensed bundles match the parent license expiration
Plugin URI: https://easydigitaldownlaods.com
Author: Phil Johnston
Author URI: https://easydigitaldownloads.com
Version: 1.0
License: GPL2
*/
@blogjunkie
blogjunkie / child-theme-settings.php
Last active May 27, 2018 13:45
Integrate the WordPress Media Uploader in Theme Options. Reference this function from your add_meta_box() callback
<?php
function upload_image_metabox() {
echo '<p><strong>Upload image</strong></p>';
echo '<input type="text" id="child_logo_url" name="' . $this->get_field_name( 'welcome-image' ) . '" value="' . esc_attr( $this->get_field_value( 'welcome-image' ) ) . '" size="50" />';
echo '<input id="child_upload_logo_button" type="button" class="button" value="Upload Image" /> ';
?>
@nickcernis
nickcernis / functions.php
Last active May 26, 2018 19:18
Add a login/logout link to the menu bar of any Genesis child theme
<?php // add everything except for this opening line to your functions file
add_filter( 'wp_nav_menu_items', 'sp_add_loginout_link', 10, 2 );
function sp_add_loginout_link( $items, $args ) {
// Change 'primary' to 'secondary' to put the login link in your secondary nav bar.
if ( $args->theme_location != 'primary' ) {
return $items;
}
@pippinsplugins
pippinsplugins / gist:c6634ef6ee9b65297c85
Last active September 12, 2016 15:35
Redirect users to specific pages when logging in based on their status in Restrict Content Pro
<?php
function pw_rcp_login_redirect( $redirect_to, $request, $user ) {
$status = rcp_get_status( $user->ID );
switch( $status ) {
case 'expired' :
case 'pending' :
@dancameron
dancameron / functions.php
Created July 21, 2015 17:00
Redirect to Invoice After Estimate Approval
<?php // don't include this line since your functions.php file should already have this.
function si_redirect_after_estimate_approval() {
if ( 'estimate' !== si_get_doc_context() ) {
return;
}
?>
<script type="text/javascript">
jQuery(document).on('status_updated', function(e) {
window.location = window.location.pathname + '?redirect_after_status=1';
@nickcernis
nickcernis / functions.php
Last active January 24, 2016 21:23
Fix for the wpMandrill WordPress plugin for blogs that send both plain text and HTML email
<?php
// Add to functions.php and leave the “Content” box unticked in Settings > Mandrill
// Be sure to omit the opening <?php tag when copying this code
// Add paragraph breaks to plain text notifications sent by Mandrill
add_filter('mandrill_payload', 'wpmandrill_auto_add_breaks');
function wpmandrill_auto_add_breaks($message) {
$html = $message['html'];