Skip to content

Instantly share code, notes, and snippets.

View michaelbragg's full-sized avatar

Michael Bragg michaelbragg

View GitHub Profile
@michaelbragg
michaelbragg / disable-admin-notification-password-change.php
Created November 24, 2020 10:31
[WordPress] Disable Admin Notification of User Password Change
<?php
/**
* Plugin Name: Disable Admin Notification Password Change
* Plugin URI: https://www.michaelbragg.com
* Description: Disable the email notification, to the site admin, when a user changes their password.
* Author: Michael Bragh
* Author URI: [email protected]
* Version: 1.0.0
* License: GPLv3
*/
<?php
/**
* Block: Icons
*
* @package EDGE\Toolkit\Components
*/
// Default class to use as base for custom CMS class.
$block_link_classes = [
'c-icon-group'
@michaelbragg
michaelbragg / docker-compose.yml
Created July 18, 2020 06:08
Docker | WordPress | Mailhog: Add the ability to send email from WordPress and have it caught in Mailhog.
volumes:
db_data:
version: '3.7'
services:
mysql:
container_name: mysql
image: mysql:5.7
volumes:
@michaelbragg
michaelbragg / site-config.php
Created April 6, 2020 15:43
Change path to store ACF JSON files outside the theme directory
/**
* Update ACF Local JSON save path.
*/
function ti_acf_json_save_point( $path ) {
// Update save file path.
$path = WPMU_PLUGIN_DIR . '/acf-json';
return $path;
}
add_filter(
@michaelbragg
michaelbragg / .htaccess
Created July 2, 2019 12:33
Hide development site from Search Engines
<IfModule mod_headers.c>
Header set X-Robots-Tag "noindex, nofollow, noarchive"
<FilesMatch "\.(doc|pdf|png|jpe?g|gif)$">
Header set X-Robots-Tag "noindex, noarchive, nosnippet"
</FilesMatch>
</IfModule>
@michaelbragg
michaelbragg / get_search_form()
Last active June 21, 2017 13:05
Add filter to `get_search_form()` allowing custom classes to be passed to search form submit element.
Add filter to `get_search_form()` allowing custom classes to be passed to search form submit element.
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@michaelbragg
michaelbragg / example.php
Created February 24, 2016 14:21
WordPress: Checks if paramater(s) are in the post type
<?php
/**
* Example One: String
*/
if( is_post_type( 'post_type01' ) ):
echo "This is the post type";
endif;
@michaelbragg
michaelbragg / cmb2-register-form.php
Created February 17, 2016 19:06
For CMB2 Issue
/**
* Register the form and fields for our front-end submission form
*/
function cmb2_form() {
$business_category = new_cmb2_box( array(
'id' => 'cmb2_form_categories_business',
'title' => __( 'Business Start Up & Entrepreneur', 'cmb2_form' ),
'object_types' => array( 'cmb2_form', ),
'context' => 'normal',
@michaelbragg
michaelbragg / loop-testimonial.php
Last active October 26, 2015 14:03
Template for, WordPress plugin, Testimonial Rotator's loop.
<?php
/**
* Testimonial Rotator: Loop Template
*/
?>
<div class="slide slide<?php echo $slide_count;?> testimonial_rotator_slide hreview itemreviewed item <?php echo $has_image; ?> cf-tr">
<?php /* Post Thumbnail */ ?>