This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Allows you to filter the stock bbPress message that reads 'You must be logged in to create new topics.' | |
* | |
* @param string $message stock Easy Content Restriction message | |
* @return string Your custom message | |
*/ | |
function change_logged_in_topic_message( $message ) { | |
return 'Our custom message'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Allows you to override any custom message or the default message for users | |
* | |
* @param string $message stock Easy Content Restriction message | |
* @param int $product_ids The post_id array for the product the message would be tied to | |
* @return string Your custom message | |
*/ | |
function change_global_message( $message, $product_ids ) { | |
return 'Our custom message'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Abstracting the featured Ads Query so that we don't have to retype it all over | |
* | |
* @class WP_Query | |
* @uses wp_parse_args | |
* | |
* @since 1.0 | |
* @author SFNdesign, Curtis McHale | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Registers and enqueues scripts and styles | |
* | |
* @uses wp_enqueue_style | |
* @uses wp_enqueue_script | |
* | |
* @since 1.0 | |
* @author SFNdesign, Curtis McHale | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Overrides the default message for subscription type products | |
* | |
* @param string $message stock Easy Content Restriction message | |
* @param int $product_id The post_id for the product the message would be tied to | |
* @return string Your custom message | |
*/ | |
function change_subscription_message( $message, $product_id ) { | |
return 'Our custom message'; |