Post Pay Counter

The best way to pay authors on WordPress

  • Features
    • Addons
  • Cart
  • PRO version
  • Addons
  • Support
  • Tutorials
    • Questions and Answers
    • Developer documentation

How to set users’ PayPal email address

September 9, 2017 by Stefano

Post Pay Counter PRO allows to pay authors through PayPal with ease. However, users must enter the PayPal email address which they would like to be paid to, for the feature to work.

There are several ways in which you can make them do that.

1. Their profile page

The user profile page is the easiest place in which they can set their PayPal email address, just as any other profile settings. The feature is enabled by default and you need to take no action. However, this requires that authors have access to wp-admin, at least for profile editing, which they may not depending on your setup.

PayPal-Setup-6

2. Any public page of your choice

The PRO version comes with several shortcodes for stats. It also ships a shortcode to display the PayPal email address form in any public page of your choice. You just need to create a new page, enter [ppc_user_paypal_email_settings] as text and publish it. Logged-in users visiting that page will see the apt field to enter and change their PayPal email address.

[Read more…]

Filed Under: Tutorials Tagged With: developer documentation, payments, paypal, post pay counter pro

Add custom statuses to Post Pay Counter stats

July 22, 2016 by Stefano Leave a Comment

This is just a quick note for developers who want to allow custom statuses in Post Pay Counter stats. By default PPC allows publish, future, pending and private, but you’ll see it’s not difficult to add your own ones. I’ll assume you are a developer, so I will only provide the details on where to hook and assume you know what to do at that point.

You will need two functions hooking to two different points:

  • Filter settings retrieval adding your custom statuses to the array of allowed ones. The filter in this case is ppc_get_settings, line 111 of classes/ppc_general_functions_class.php. Have a look at the structure of the array and add your status to the sub-array counting_allowed_post_statuses.
  • Tweak the WP_Query arguments to include your custom statuses. Here the filter is ppc_get_requested_posts_args, line 100 of classes/ppc_generate_stats_class.php. You want to edit the post_status parameter (which is an array), adding your custom ones.
    (Advanced note: don’t make the WP_Query settings-dependent. You can see that by default PPC includes all possible statuses in the WP_Query post_status parameter, and not only active ones. This is to make stats quicker, and only discard irrelevant results in PPC_counting_stuff::data2cash().

This is an example code to allow drafts to be included in stats:

1
2
3
4
5
6
7
8
9
10
11
add_filter( 'ppc_get_settings', 'ppc_add_draft_status_settings', 10 );
function ppc_add_draft_status_settings( $settings ) {
    $settings['counting_allowed_post_statuses']['draft'] = 1;
    return $settings;
}
 
add_filter( 'ppc_get_requested_posts_args', 'ppc_draft_status_wp_query', 10 );
function ppc_draft_status_wp_query ( $status ) {
    $status['post_status'][] = 'draft';
    return $status;
}

 

Filed Under: Developer documentation, Questions & Answers Tagged With: developer documentation, post statuses

Your cart

Number of items in cart: 0

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

What are you looking for?

Connect on Facebook

Follow the Post Pay Counter page on Facebook to be up-to-date with discounts and latest releases!

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

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