View mycred-sell-this-button-filter-example
/**
* Adjust Sell Content Button
* @version 1.0
*/
function mycred_pro_adjust_sell_content_button( $button, $post, $setup, $mycred ) {
return '<button type="button" class="mycred-buy-this-content-button ' . $setup['button_classes'] . '" data-pid="' . $post->ID . '" data-type="' . $mycred->cred_id . '"><i class="fa fa-download" aria-hidden="true"></i></button>';
}
add_filter( 'mycred_sell_this_button', 'mycred_pro_adjust_sell_content_button', 10, 4 );
View redirect-when-out-of-mycred-points
/**
* Redirect When Out of Points
* @since 1.0
* @version 1.0
*/
function mycred_pro_redirect_when_no_more_points() {
// The Page ID where we want users to be redirected to
// when they have run out of points
$redirect_to = 1;
View mycred-register-marketpress-gateway
/**
* Register Gateway in MarketPress
* @since 1.0
* @version 1.0
*/
function mycred_pro_add_marketpress_gateway( $gateways ) {
$global = ( is_multisite() && mycred_centralize_log() ) ? true : false;
$gateways[ MYCRED_SLUG ] = array( 'MP_Gateway_myCRED_New', MYCRED_DEFAULT_LABEL, $global, false );
View mycred-for-marketpress3
/**
* MarketPress Gateway 3.x
* @since 1.1
* @version 1.0
*/
if ( ! class_exists( 'MP_Gateway_myCRED_New' ) && class_exists( 'MP_Gateway_API' ) ) :
class MP_Gateway_myCRED_New extends MP_Gateway_API {
var $plugin_name = MYCRED_SLUG;
var $admin_name = MYCRED_DEFAULT_LABEL;
View play-audio-on-mycred-link-click
View mycred-publish-hook-new-filter-example1
/**
* Add Custom Post Status
* @version 1.0
*/
function mycred_pro_add_custom_post_status( $new_statuses ) {
$new_statuses[] = 'archived';
return $new_statuses;
View mycred-publish-hook-old-filter-example1
/**
* Add Custom Post Status
* @version 1.0
*/
function mycred_pro_add_custom_post_status( $old_statuses ) {
$old_statuses[] = 'pre-approved';
return $old_statuses;
View mycred-sell-this-button-filter-example1
/**
* Insert Icon
* Insert an icon for all buy buttons.
* @version 1.0
*/
function mycred_pro_insert_buy_button_icon( $button ) {
return str_replace( '">', '"><i class="fa fa-bolt" aria-hidden="true"></i> ', $button );
}
View mycred-woo-price-append
/**
* Show Cost in Points
* Show the cost of a product in points next to the regular price.
* @version 1.0
*/
function mycred_pro_append_point_price( $rendered_price, $product ) {
if ( $product->get_price() > 0 ) {
$price = $product->get_price();
View mycred-points-history-in-woo
/**
* Add Points Endpoint
* @version 1.0
*/
function mycred_pro_add_points_history_to_woo( $items ) {
$items['points'] = 'Points History';
return $items;