-
-
Save anwppro/98df192271a27e897145033ff58cd284 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action( 'rest_api_init', 'anwp_fl_templater_add_rest_routes' ); | |
| function anwp_fl_templater_add_rest_routes() { | |
| register_rest_route( | |
| 'fl', | |
| '/games/', | |
| [ | |
| 'methods' => 'GET', | |
| 'callback' => 'anwp_fl_templater_api_games', | |
| 'permission_callback' => function () { | |
| return true; | |
| }, | |
| ] | |
| ); | |
| } | |
| function anwp_fl_templater_api_games() { | |
| global $wpdb; | |
| return rest_ensure_response( $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}anwpfl_matches" ) ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment