Post Pay Counter

The best way to pay authors on WordPress

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

Change Post Link

by

› Forums › Post Pay Counter PRO › Support › Change Post Link

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 5 replies, 2 voices, and was last updated 5 years, 12 months ago by Stefano.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • May 17, 2019 at 11:48 am #65142
    UD
    Guest

    Hi Stefano,

    In the PPC shortcode, I was wondering where I can change the post url from edit (https://website.com/wp-admin/post.php?post=24371&action=edit) to view (https://website.com/post-title)?

    I tried to find it in the code, but was unsuccessful.

    Thanks!

    May 17, 2019 at 11:54 am #65144
    Stefano
    Keymaster

    Hi there,
    the post URL is actually dynamically changed depending on whether the user viewing stats has permission to edit posts or not.

    The thing happens on line 302 of post-pay-counter/classes/ppc_html_functions_class.php, although I don’t advise to change it there. Instead, you can hook to the filter ppc_author_stats_html_after_post_title (and ppc_author_stats_csv_after_post_title if you want it to apply to csv stats as well). You get 4 parameters being $html, $author, $formatted_stats, $post, where $html contains the linked post title from which you may want to change the URL.

    Hope this helps! 🙂

    Have a nice day,
    Stefano

    • This reply was modified 5 years, 12 months ago by Stefano.
    May 17, 2019 at 12:29 pm #65148
    UD
    Guest

    Thank you!

    Unfortunately, I can’t view the documentation https://postpaycounter.com/category/developer-documentation/ or the tutorial pages to find an example of the filters. For me they look blank and I’m not sure it’s on my end only.

    May 17, 2019 at 1:28 pm #65150
    UD
    Guest

    Is there a way you could send me an example of the filter please? I’m only looking to change the link from edit to view, while keeping the HTML the same.

    Thanks!

    May 17, 2019 at 8:44 pm #65170
    Stefano
    Keymaster

    You can paste the attached code (copy and paste) in your theme functions.php, and then make sure to disable post links in Post Pay Counter > Options > Miscellanea > Performance 🙂

    Let me know!

    Attachments:
    1. code.txt
  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Change Post Link’ 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 © 2025 · Centric Theme on Genesis Framework · WordPress · Log in