• Plugin Author AntoineH

    (@antoineh)


    Update: Because my dropbox links stopped working, I created this new topic for the extension examples.

    Note: Please do not reply in this topic. This topic is only for posting extensions. If you have a question or would like to report a problem about an extension, please open a new topic!

    During the last couple of years I have helped several users with all kind of requests to alter the working of the plugin. When I change the plugin’s behavior I try use hooks as much as possible. Because when you use hooks, then an upgrade of the plugin won’t overwrite your code changes.

    The help page in the plugin contains some examples and also links to some resources on the internet that can help you make your own additions to the plugin.

    But because I also made some myself, I decided to write this post to share them with you.

    One important note: some of these extensions are very old, so it is possible that some won’t work anymore in the plugin. Maybe the hook is gone or the functionality made it to the core of the plugin, making the extension useless. But the file may still be valuable as an example for you.

    Template (empty example)
    If you want to use the hooks in the plugin you have to place your code somewhere so WordPress can pick it up. One place you can put your code is the functions.php of your theme, but I personally prefer writing a simple plugin that you can simply activate/deactivate. I created a file that you can use as a start to create your own plugin.
    football-pool-extension-template.php

    • This topic was modified 7 years, 7 months ago by AntoineH.
    • This topic was modified 7 years, 7 months ago by AntoineH.
Viewing 3 replies - 16 through 18 (of 18 total)
  • Plugin Author AntoineH

    (@antoineh)

    Fix for Scripts To Footer plugin
    Not really an extension, but more a fix when using my plugin together with the Scripts To Footer plugin. The STF plugin moves all javascript files to the bottom of the page and this causes a problem if you’re using the countdown function in my plugin. Fortunately, the author of the plugin has a way to exclude certain scripts from being moved:

    add_filter( 'stf_exclude_scripts', 'stf_custom_header_scripts', 10, 1 );
    function stf_custom_header_scripts( $scripts ) {
    	$scripts[] = 'js-pool';
    	return $scripts;
    }
    Plugin Author AntoineH

    (@antoineh)

    New users
    When a new user registers for your pool, two actions are fired. One before the pool information for the user is added to the database (footballpool_pre_new_user) and one after the data is saved (footballpool_new_user).

    You can use these actions to save extra data, or to change the behavior of the registration. E.g. by not automatically activating a player by default. Example in this extension plugin:
    football-pool-do-not-activate-new-users.php

    Plugin Author AntoineH

    (@antoineh)

    Reset plugin
    Sometimes it’s handy if you can just test the plugin with some data and then delete a part of the data (e.g. all predictions) before you start the actual pool. This extension adds a page to the admin with some buttons to delete this data.
    If you want other data to be deleted, then just add a button and the required code to delete the data from the database. Should be fairly simple to extend.
    football-pool-admin-reset.php

Viewing 3 replies - 16 through 18 (of 18 total)
  • The topic ‘Extension plugins for the Football Pool plugin’ is closed to new replies.