Skip to content

Instantly share code, notes, and snippets.

View bairamispanagiotis's full-sized avatar

Panos bairamispanagiotis

View GitHub Profile
@gabrielmerovingi
gabrielmerovingi / mycred-publish-content-cat-hook
Last active August 14, 2020 13:05
This custom hook allows you to reward posts being published based on the category they are assigned. The hook will reward points when a post is published, so if a category is added after publishing, it will not payout. Goes into your child theme's functions.php file or custom plugin.
/**
* 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' ),