Post Pay Counter

The best way to pay authors on WordPress

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

How to define settings priority (user, category, role)

January 18, 2022 by Stefano 2 Comments

Post Pay Counter allows quite a fine-grained settings control. By itself, the free version allows to assign different settings to different users, while addons allow to define special settings for given user roles, categories, and post types.

What happens, though, if you have multiple settings addons active? What settings will actually be used for a post that belongs to a category with special settings, written by an author belonging to a user role with special settings?

The default settings priority is defined as follows:

  1. User settings
  2. Category settings
  3. User role settings
  4. General settings

The ordering of points 1 and 4 cannot be altered: user settings will always have the highest priority, while general settings will always be the final fallback if nothing more special is found. However, Points 2 and 3 can be exchanged. This can be achieved with the following lines of code to be pasted in your theme functions.php (or any similar file).

To enforce the ordering above, with category settings having a higher priority over role settings, use this code:

# Category settings come first
add_action( 'PPC_URCS_settings_priority', function( $priority ) { return 8; } );
add_action( 'PPC_CCS_settings_priority', function( $priority ) { return 9; } );

To enforce the opposite ordering, with role settings having a higher priority over category settings, use this code:

# User role settings come first
add_action( 'PPC_URCS_settings_priority', function( $priority ) { return 9; } );
add_action( 'PPC_CCS_settings_priority', function( $priority ) { return 8; } );

(The Post Type Custom Settings addon is not compatible with the other addons. They can still be used all together, but in case of a settings clash, there is no way, as of now, to control the behavior.)

  • Was this Helpful ?
  • Yes   No
Post Views: 1,009

Filed Under: Developer documentation, Tutorials Tagged With: settings

Comments

  1. Lee Floyd says

    January 31, 2022 at 7:48 pm

    I have PRO. I am not using it yet, but I am trying to do so now. I saw a previous question regarding other ad networks besides adsense and that you can only currently support adsense. What would be the cost to add another ad network like adsterra? If not, how is the best alternative way to pay multiple authors on my site based on page views?

    Reply
    • Stefano says

      February 1, 2022 at 9:21 am

      Hi Lee! In general the cost can be quite high, as it involves integrating with a whole new service. For Adsterra, I couldn’t even find any easily accessible public documentation, and their only “Request API” button seems broken, so I wouldn’t count too much on the API quality making it an easier job.
      For payment based on page views, several methods other than Google Analytics are supported, have a look at this tutorial 🙂
      https://postpaycounter.com/pay-writers-per-visit-wordpress/

      Reply

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 © 2025 · Centric Theme on Genesis Framework · WordPress · Log in