๐ This is a WordPress plugin that displays a list of NFL teams. It includes functionality to retrieve data from an API, build a table, and enqueue styles and scripts.
- ๐ฅ Download the plugin files and upload them to the
/wp-content/plugins/acmesports-plugin
directory, or install the plugin through the WordPress plugins screen directly. Alternativley you can zip them. - ๐ Activate the plugin through the 'Plugins' screen in WordPress
- ๐ Use the shortcode
[nfl_data_teams_table]
to display the table on any page or post.
The plugin includes a shortcode that can be used to display the NFL teams table on any page or post. Simply add the shortcode [nfl_data_teams_table]
to the content of the page or post where you want the table to appear.
- ๐๏ธ Simple boiler plate structure
- ๐ก Call to api to retrieve data
get_teams_list_array()
and convert to php array - ๐๏ธ Table builder to loop through results and build table
nfl_teams_table_function()
- ๐จ Enqueue styles using
wp_enqueue_style();
"table" and "page" stylings - ๐ฅ Enqueue jquery (plugin datatables)
wp_enqueue_script();
datatables is jquery dependant - ๐งโ๐ผ Admin Page to highlight to client the instructions. IE please use shortcode [nfl_data_teams_table]
- ๐ฆ Functionality to include required (css/js dependancies) [https://datatables.net/]
- ๐ข Re-Order column data putting id first
- ๐ Possibly utilize other endpoint + shortcode [nfl_data_team_table teamid="55"] to create linked page for more stats and information
<a href="team_info/?id=58">See More</a>
- ๐ก Create method/function
get_data($endpoint ='')
to handle different endpoints.[https://delivery.oddsandstats.co/{$endpoint}] - ๐ Additional Endpoint Parameter funcionality:
get_table_data($endpoint ='',$start = '', $limit = '', $sortby = '')
- ๐ Implement jquery ajax internal endpoint to make it easier for serverside pagination of lots of results
- ๐ ๏ธ Make 1.5.0 versioned parameters available via a custom field inside admin.php?page so admins can easily change the following