Skip to content

Instantly share code, notes, and snippets.

View danielmcclure's full-sized avatar

Daniel McClure danielmcclure

View GitHub Profile
/**
* Remove the "nofollow" attribute from all comments author's links
* except for a specific author.
*/
function dofollow_blog_author_comment( $return, $author ) {
if ( $author === 'Your Name' ) {
$return = str_replace( "rel='external nofollow ugc'", '', $return );
}
return $return;
@danielmcclure
danielmcclure / m3-custom-functionality.php
Created September 24, 2019 00:25
M3 Custom Functionality Plugin Header for WordPress
<?php
/**
* M3 Custom Functionality
*
* @package M3CustomFunctionality
* @author Daniel McClure
* @copyright Copyright (c) 2019, Daniel McClure
* @license GPL-2.0+
*
* @wordpress-plugin
@danielmcclure
danielmcclure / wp-config.php
Created September 17, 2019 21:04
Sentry.io Settings for WP Config
<?php
/**
* Sentry.io Settings for WP Config
* Enables features and settings for the WordPress Sentry plugin for Sentry.io
* Plugin URI: https://wordpress.org/plugins/wp-sentry-integration/
*/
// Delete and customise as appropriate, replacing _YOUR_DSN_ with you actual DSN from Sentry.io
define( 'WP_SENTRY_DSN', '_YOUR_DSN_' ); // Enable PHP Tracker
<?php
$args = array(
'label' => '', // Text in Label
'class' => '',
'style' => '',
'wrapper_class' => '',
'value' => '', // if empty, retrieved from post meta where id is the meta_key
'id' => '', // required
'name' => '', //name will set from id if empty
@danielmcclure
danielmcclure / functions.php
Created July 23, 2019 02:14
Suppress all Genesis microdata/schema output
<?php
// Suppress all Genesis microdata/schema output
add_filter( 'genesis_disable_microdata', '__return_true' );
@danielmcclure
danielmcclure / style.scss
Created May 22, 2019 02:39 — forked from seothemes/style.scss
Gravity Forms SCSS
/* ## Gravity Forms
--------------------------------------------- */
.gform_heading,
.gform_body,
.gform_footer {
clear: both;
}
.gform_heading {
@danielmcclure
danielmcclure / wp-config.php
Created May 2, 2019 04:03
Settings that Block Updates for WordPress Sites
<?php
/**
* Settings that Block Updates for WordPress Sites
*/
// Disable Live File Editing
define( 'DISALLOW_FILE_MODS', true );
// Disable Automatic WordPress Updates
define( 'WP_AUTO_UPDATE_CORE', false );
@danielmcclure
danielmcclure / regex.txt
Created April 19, 2019 00:43
Image File Regex
.*\.(ai|bmp|eps|gif|indd|j2c|jp2|jpe?g|jpf|jpm|mj2|png|psd|raw|svg|tiff|webp)$
@danielmcclure
danielmcclure / functions.php
Created April 3, 2019 21:10
Disable WooCommerce Extension Recommendations in the WordPress Dashboard
<?php
// Disable WooCommerce Extension Recommendations in the WordPress Dashboard
add_filter( ‘woocommerce_allow_marketplace_suggestions’, ‘__return_false’ );
@danielmcclure
danielmcclure / functions.php
Created March 27, 2019 20:56
Get Current User Country (Geolocation) & Customise Output with WooCommerce
/**
* @snippet Get Current User Country (Geolocation) - WooCommerce
* @how-to Watch tutorial @ https://businessbloomer.com/?p=19055
* @sourcecode https://businessbloomer.com/?p=72811
* @author Rodolfo Melogli
* @compatible Woo 3.5.3
* @donate $9 https://businessbloomer.com/bloomer-armada/
*/
function bbloomer_use_geolocated_user_country(){