Ready to get started?Download WordPress


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

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


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

    Posted 11 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
    Posted 11 months ago #

    Thank you! Will try to create one and share.


You must log in to post.

About this Plugin

About this Topic


No tags yet.