View mycred-wpulike-per-type
/**
* Adjust WP ULike Reference
* When getting points for liking a content, change the reference
* to identify the post type so we can create badges for each post type
* that gets liked instead of just one for all likes.
* @version 1.0
*/
add_filter( 'mycred_run_this', 'mycred_wpulike_per_cpt', 10, 3 );
function mycred_wpulike_per_cpt( $run_this, $mycred ) {
View mycred-view-content-category-hook
/**
* Register Custom Hook
* @since 1.0
* @version 1.0
*/
add_filter( 'mycred_setup_hooks', 'mycred_pro_register_view_content_category_hook' );
function mycred_pro_register_view_content_category_hook( $installed ) {
$installed['view_category_content'] = array(
'title' => __( '%plural% for Viewing Content (Categories)', 'mycred' ),
View mycred-publish-content-cat-hook
/**
* Register Custom Hook
* @since 1.0
* @version 1.0
*/
add_filter( 'mycred_setup_hooks', 'mycred_pro_register_publish_content_category_hook' );
function mycred_pro_register_publish_content_category_hook( $installed ) {
$installed['publish_category_content'] = array(
'title' => __( '%plural% for Publishing Content (Categories)', 'mycred' ),
View points-for-publishing-content-hook-example
/**
* Register Custom Hook
* @since 1.0
* @version 1.0
*/
add_filter( 'mycred_setup_hooks', 'mycred_pro_register_publish_content_category_hook' );
function mycred_pro_register_publish_content_category_hook( $installed ) {
$installed['publish_category_content'] = array(
'title' => __( '%plural% for Publishing Content (Categories)', 'mycred' ),
View mycred-publish-hook-ref-filter-example1
/**
* Adjust Publish Reference
* Log the event under a unique reference based on the post type being published.
* @version 1.0
*/
function mycred_pro_publish_ref_by_type( $reference, $post ) {
return 'publish_' . $post->post_type;
}
View reward-completed-woo-orders
/**
* Reward Completed Orders
* Will give a user 1 point for each product in an order.
* @version 1.0.1
*/
function mycred_pro_reward_completed_orders( $order_id ) {
if ( ! function_exists( 'mycred' ) ) return;
$order = wc_get_order( $order_id );
View reward-mycred-payment
add_filter( 'mycred_woo_reward_mycred_payment', '__return_true' );
View mycred-history-woo-my-account
class My_Custom_My_Account_Endpoint {
/**
* Custom endpoint name.
*
* @var string
*/
public static $endpoint = 'my-custom-endpoint';
/**
View mycred-woo-reward-log-filter-example1
/**
* Change Woo Rewards Log
* @version 1.0
*/
function mycred_pro_adjust_woo_rewards_log( $log_entry = '' ) {
return 'Store Purchase Reward';
}
add_filter( 'mycred_woo_reward_log', 'mycred_pro_adjust_woo_rewards_log' );
View enforce-max-mycred-balance
/**
* Enforce Maximum
* Make sure users can not earn more than 1000 points.
* @version 1.0
*/
function mycred_enforce_max_balance( $run, $request, $mycred ) {
extract( $request );
// The maximum balance a user can have