Post Pay Counter

The best way to pay authors on WordPress

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

allow drafts to be included in stats

by

› Forums › Post Pay Counter PRO › Support › allow drafts to be included in stats

We are based in Europe with a GMT+1/GMT+2 time zone - support replies may be delayed due to time zone differences with your country.

  • This topic has 3 replies, 1 voice, and was last updated 3 years ago by Mohamed.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • February 23, 2020 at 5:49 pm #71050
    Mohamed
    Guest

    I want to add the drafts to the counter, but I couldn’t do it, although I found this code below:

    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;
    }

    I tried to add to ppc_general_functions_class.php, but it broke the plugin. can you please tell me how should I add it and to which file?

    February 23, 2020 at 6:10 pm #71052
    Stefano
    Keymaster

    Hi Mohamed,
    you should add that code to you theme’s functions.php file 🙂

    Have a nice day,
    Stefano

    February 23, 2020 at 6:14 pm #71054
    Mohamed
    Guest

    perfect.. That worked like a charm.. Thanks!

    February 23, 2020 at 6:16 pm #71056
    Mohamed
    Guest

    I have another question (sorry to bother you):

    How can I make it only count the posts that were created in this month? Cause the one that is published includes posts that were created previously.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘allow drafts to be included in stats’ is closed to new replies.

Your cart

Number of items in cart: 0

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

What are you looking for?

BEFORE POSTING

Before posting, please please please do have a look at our Documentation section. Your problem may be addressed there, allowing you to solve it without help from us :)

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

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