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

  1. latinosamorir
    Posted 1 year 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.


  2. latinosamorir
    Posted 1 year 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
    Plugin Author

    Posted 1 year 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
    Posted 1 year ago #

    Thank you! Will try to create one and share.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Football Pool
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.