Skip to content

Instantly share code, notes, and snippets.

Avatar

Curtis McHale curtismchale

View GitHub Profile
View wecr_grouped_product_message.php
<?php
/**
* Allows you to change the default message for grouped 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, may be a product variation id
* @return string Your custom message
*/
function change_grouped_product_message( $message, $product_id ) {
return 'Our custom message';
View wecr_variable_product_message.php
<?php
/**
* Allows you to change the default message for variable 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, may be a product variation id
* @return string Your custom message
*/
function change_variable_product_message( $message, $product_id ) {
return 'Our custom message';
View wecr_subscription_message.php
<?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';
View enqueue.php
<?php
/**
* Registers and enqueues scripts and styles
*
* @uses wp_enqueue_style
* @uses wp_enqueue_script
*
* @since 1.0
* @author SFNdesign, Curtis McHale
*/
View extending-wp-query.php
<?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
*/
View wecr_restricted_content_message_global.php
<?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';
View wecr_restricted_content_message_logged_in_create_topics.php
<?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';
}
View wecr_restricted_content_message_cant_create_topics.php
<?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';
}
View wecr_restricted_content_message_no_topics_found.php
<?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';
}
View wecr_restricted_content_message_cant_reply.php
<?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';
}