Skip to content

Instantly share code, notes, and snippets.

View curtismchale's full-sized avatar

Curtis McHale curtismchale

View GitHub Profile
<?php
/**
* Allows you to filter the stock bbPress message that reads 'You cannot create new topics at this time.'
*
* @param string $message stock Easy Content Restriction message
* @return string Your custom message
*/
function change_cant_create_topics_message( $message ) {
return 'Our custom message';
}
<?php
/**
* Allows you to filter the stock bbPress message that reads 'Oh bother! No topics were found here!'
*
* @param string $message stock Easy Content Restriction message
* @return string Your custom message
*/
function change_no_topics_message( $message ) {
return 'Our custom message';
}
<?php
/**
* Allows you to filter the stock bbPress message that reads 'You cannot reply to this topic:'
*
* @param string $message stock Easy Content Restriction message
* @return string Your custom message
*/
function change_cant_reply_message( $message ) {
return 'Our custom message';
}
@curtismchale
curtismchale / wecr_allowed_post_types.php
Last active August 29, 2015 14:03
Adds a Custom Post Type called 'members_cpt' to the list of allowed post types.
<?php
/**
* Adds the custom post type 'members_cpt' to the list of post types allowed
*
* @param array $allowed Existing array of allowed CPT's
* @return array $allowed Modified array of allowed CPT's
*/
function add_members_cpt( $allowed ){
$allowed[] = 'members_cpt';
return $allowed;
<?php
// hooked inside a class for my normal dev work
add_action( 'admin_notices', 'check_required_plugins' );
/**
* Checks for WooCommerce and kills our plugin if it isn't active
*
* @uses function_exists Checks for the function given string
* @uses deactivate_plugins Deactivates plugins given string or array of plugins
*
<?php
function demo_shortcode(){
$args = array(
'post_type' => 'product',
'meta_query'=> array(
'relation' => 'OR',
array(
'key' => 'some_key',
'value' => '42',
'compare' => 'IN',
@curtismchale
curtismchale / edd-purchase-links-top-of-content.php
Created June 24, 2014 17:36
Moves the EDD Purchase button (and variations) to the top of the content instead of placing it at the bottom. Removes the original purchase links so they don't show up twice. Blogged: http://wp.me/p1Fud2-1of June 26, 2014
/**
* Builds out the custom post types for the site
*
* @uses register_post_type
*
* @since 1.0
* @author SFNdesign, Curtis McHale
*/
function add_cpt(){
@curtismchale
curtismchale / Three Wise Monkeys.md
Last active November 12, 2021 20:15 — forked from malarkey/Three Wise Monkeys.md
The NDA I use.

Date: [date]

Between us [company name] and you [customer name].

Summary:

In short; neither of us will share any confidential information about each-other, by any means, with anyone else.

What’s confidential information?

@curtismchale
curtismchale / mastermind-format
Created September 4, 2013 19:55
Basic format for mastermind notes
Billy Bob Thorton wasn't here because he was abducted by aliens again.
### $name
- point form covering what they talk about during the call
- include goals that are accomplished
**Goals from last week**
**Goals**