WordPress.org

Ready to get started?Download WordPress

Forums

Football Pool
Number of predictions per user shortcode (4 posts)

  1. latinosamorir
    Member
    Posted 5 months ago #

    I'd like to show on user profile the # of predictions the user has saved.

    Is there a shortcode or function for this?

    If not, how can I go about creating one?

    Thank you.
    Giovanni

    https://wordpress.org/plugins/football-pool/

  2. latinosamorir
    Member
    Posted 5 months ago #

    On that note, I'd also like to show when a user has completed the prediction form for each group, is that possible?

  3. AntoineH
    Member
    Plugin Author

    Posted 5 months ago #

    There is not a shortcode for this. If you want to make one, you can have a look at the class-football-pool-shortcodes.php file. The php-code to add a shortcode is not that complicated.

    The predictions for a user are in the pool_wp_predictions table. Count the rows for a given user_id.

    The time a prediction is made is not recorded in the plugin. So there is no way you can get it from the plugin's data.
    But - just a thought - if there is a hook in the save action of the form (haven't got the code at hand to check it at the moment), you could use that hook to save some data to the wp_users_meta table. This requires some knowledge of hooks in WP and the WP user object.

  4. latinosamorir
    Member
    Posted 5 months ago #

    Thank you! Will try to create one and share.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.