Post Pay Counter

The best way to pay authors on WordPress

  • Features
    • PRO version
  • Cart
    • Addons
  • Documentation
  • Support

Exclude columns from stats in BuddyPress page

November 10, 2017 by Stefano Leave a Comment

The BuddyPress addon allows you to display Post Pay Counter author’s stats in the BuddyPress Member page. However, by default, all columns are displayed. This may include columns that you are not interested into, or that you may not want to show to authors.

Below is a PHP code that allows to exclude some columns from display.

/**
 * Exclude post status and post type from BuddyPress stats table
 */ 
function ppc_buddypress_exclude_stats_columns( $shortcode ) {
	$exclude_columns = ''; //comma separated list of columns to be excluded

	return substr( $shortcode, 0, strlen( $shortcode )-1 ) . ' exclude="'.$exclude_columns.'"]';
}
add_filter( 'ppc_buddypress_stats_shortcode', 'ppc_buddypress_exclude_stats_columns' );

You should change the following line with the columns IDs you would like to hide:

$exclude_columns = ''; //comma separated list of columns to be excluded

Valid columns IDs are: post_id, post_title, post_type, post_status, post_publication_date, post_words, post_visits, post_adsense_revenues, post_images, post_comments, post_bonus, post_total_payment, post_due_payment.

For example, changing that line as follows will hide the post ID and the post type:

$exclude_columns = 'post_id, post_type'; //comma separated list of columns to be excluded

 

Filed Under: Developer documentation, Tutorials Tagged With: buddypress

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Your cart

Number of items in cart: 0

  • Your cart is empty.
  • Total: €0.00
  • Checkout

What are you looking for?

Copyright © 2022 · Centric Theme on Genesis Framework · WordPress · Log in

This site uses cookies, as all sites on the planet do -- More info