Post Pay Counter

The best way to pay authors on WordPress

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

Add User Registration Date

by

› Forums › Post Pay Counter › Feature suggestion › Add User Registration Date

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 6 replies, 2 voices, and was last updated 2 years, 11 months ago by Stefano.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • February 20, 2018 at 2:25 am #60213
    Richard
    Guest

    Hello,

    Great plugin!

    I have the Pro version and was wondering if you could add a user registration date column. This would make it easier for me to understand the overall history and performance of my users. Plus, surprisingly I do not see anything in WordPress by default that shows the registration date of users, so this would be a big help.

    February 20, 2018 at 11:56 am #60218
    Stefano
    Keymaster

    Hi Richard,
    I won’t implement this as a public feature, because I don’t think many people are interested in it. However, adding the following code in your theme’s functions.php will add it for you 🙂

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    function ppcp_add_registration_time_col( $cols ) {
    $before = array_slice( $cols, 0, 2 );
    $after = array_slice( $cols, 2, count( $cols ) );
     
    //Push the total payment col back, with new cols in the middle
    $cols = array_merge( $before, array( 'author_registration_date' => __( 'Author registration', 'ppcp' ) ), $after );
     
    return $cols;
    }
    add_filter( 'ppc_general_stats_format_stats_after_cols_default', 'ppcp_add_registration_time_col' );
     
    function ppcp_add_registration_time_content( $formatted_stats, $author, $posts ) {
    $userdata = get_userdata( $author );
    $registered = explode( ' ', $userdata->user_registered );
    $before = array_slice( $formatted_stats, 0, 2 );
    $after = array_slice( $formatted_stats, 2, count( $formatted_stats ) );
     
    //Push the total payment col back, with new cols in the middle
    $formatted_stats = array_merge( $before, array( 'author_registration_date' => $registered[0] ), $after );
    return $formatted_stats;
    }
    add_filter( 'ppc_general_stats_format_stats_after_each_default', 'ppcp_add_registration_time_content', 10, 3 );
     
    function implement_general_sortable_columns( $sortable_cols ) {
    $sortable_cols['author_registration_date'] = array( 'author_registration_date', false );
     
    return $sortable_cols;
    }
    add_filter( 'ppc_stats_general_sortable_columns', 'implement_general_sortable_columns' );

    Have a nice day,
    Stefano

    • This reply was modified 2 years, 11 months ago by Stefano.
    February 20, 2018 at 6:31 pm #60240
    Richard
    Guest

    Works great, thanks!

    February 20, 2018 at 8:51 pm #60243
    Richard
    Guest

    Hey Stefano, is there any easy way at all that I can make that date column sortable?

    February 20, 2018 at 9:09 pm #60246
    Stefano
    Keymaster

    Hi Richard,
    yes – I have edited the code in my last post and added an extra function at the bottom 🙂

    If you like the plugin, please consider leaving a positive review on the repository, I would really appreciate that 🙂

    Have a nice day,
    Stefano

    February 20, 2018 at 10:32 pm #60249
    Richard
    Guest

    Thanks! (and just left positive review, user: Multimastery)

    February 21, 2018 at 9:45 am #60251
    Stefano
    Keymaster

    Thanks man, really appreciate it! 🙂

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Add User Registration Date’ 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?

Connect on Facebook

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

BEFORE POSTING

Before posting, please please please do have a look at our Tutorials and Questions & Answers sections. Your problem may have been already addressed there, allowing you to solve it without help from us :)

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

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