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 | |
/** | |
* Plugin Name: AffiliateWP - Store Credit - Disable Store Credit Per Affiliate | |
* Plugin URI: https://affiliatewp.com | |
* Description: Disable store credit per affiliate if store credit is globally enabled for all affiliates | |
* Author: Tunbosun Ayinla | |
* Author URI: https://affiliatewp.com | |
* Version: 1.0 | |
*/ |
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
// When click on notification then move to particular reply. | |
moveToReply: function () { | |
if ( window.location.href.indexOf( '#post-' ) > 0 ) { | |
var varUrl = window.location.href.split( '#post-' ); | |
var postID = varUrl && undefined !== varUrl[1] ? varUrl[1] : ''; | |
if ( !postID ) { | |
return; | |
} | |
var scrollTop; | |
if ($('#wpadminbar').length){ |
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
/** | |
* Add customer name to reference column of the referrals page | |
*/ | |
function affwp_custom_wc_referrals_user_link( $reference, $referral ) { | |
if ( ! ( 'woocommerce' == $referral->context || class_exists( 'WC_Order' ) ) ) { | |
return $reference; | |
} | |
$order = wc_get_order( $referral->reference ); | |
if( ! $order ){ |
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
add_action( 'woocommerce_coupon_options', 'affwp_only_referral_coupon_option' ); | |
add_action( 'woocommerce_coupon_options_save', 'affwp_store_only_referral_coupon_option' ); | |
add_filter( 'woocommerce_coupon_is_valid', 'affwp_custom_block_coupon_if_no_referrer', 10, 2 ); | |
/** | |
* Add coupon option to enable only referral validity | |
*/ | |
function affwp_only_referral_coupon_option() { | |
global $post; |
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
//array of restricted user IDs | |
function bp_restricted_user_list(){ | |
// These user's won't be able to receive the messages. | |
$restricted_user_ids = array( 102, 115, 220, 225 ); //Change these values to valid user IDs | |
return $restricted_user_ids; | |
} | |
/** | |
* Is user restricted from receiving 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 foreach( get_users( array( 'role__in' => array( 'administrator', 'editor', 'author', 'contributor' ) ) ) as $author) { ?> |
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
// filter found here: https://github.com/wp-premium/woocommerce-subscriptions/blob/master/templates/myaccount/subscription-details.php | |
add_filter('wcs_subscription_details_table_dates_to_display', 'wc_remove_end_date_column', 10, 2); | |
function wc_remove_end_date_column($rows, $subscription){ | |
unset($rows['end']); | |
return $rows; | |
} |
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
$is_more_link = count( array_filter( $original_option_values ) ) > 10; |
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 | |
$get_last_reply_id = bbp_get_topic_last_reply_id( bbp_get_topic_id() ); | |
echo bbp_get_author_link( array( 'post_id' => $get_last_reply_id,'size' => '180' ) ); | |
?> |
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 | |
// Add Forum Stickers | |
if( !empty( bbp_get_topic_forum_title()) ) { ?> | |
<span class="color bs-meta-item <?php echo ( bbp_is_single_forum() ) ? esc_attr( 'no-action' ) : ''; ?>" style="background: <?php echo color2rgba( textToColor( bbp_get_topic_forum_title() ), 0.6 ); ?>"> | |
<?php if ( bbp_is_single_forum() ) { | |
?> <span class="no-links"><?php echo bbp_get_topic_forum_title(); ?></span> <?php | |
} else { | |
?> <a href="<?php echo esc_url( bbp_get_forum_permalink( bbp_get_topic_forum_id() ) ); ?>"><?php echo bbp_get_topic_forum_title(); ?></a> | |
<?php } ?> | |
</span> |