- Given an API route for retrieving a specific record, do the following:
- Get the
idparam - Return a 404 if the record isn't found
- Return a response with the record if it is found
- Get the
Route format:
php| /** | |
| * This file is enqueued by means of wp_enqueue_script() - variables are passed | |
| * in from PHP by means of wp_localize_script() | |
| * | |
| */ | |
| /* TM: We use an anonymous function to invoke the JavaScript. Also refactored for proper | |
| * WordPress coding standards. | |
| */ | |
| (function( $ ) { |
| <?php | |
| // Exit if accessed directly | |
| if ( !defined( 'ABSPATH' ) ) { | |
| exit; | |
| } | |
| /** | |
| * Archive Template | |
| * |
| Timesheet: <b>January 4, 2019</b> | |
| <br/><br/> | |
| <table> | |
| <thead> | |
| <tr> | |
| <th>Project</th> | |
| <th>Task</th> | |
| <th>Hours</th> | |
| </tr> | |
| </thead> |
| /* General iframe Background */ | |
| iframe { | |
| background: #fff; | |
| } | |
| /* Update Credit Card Field */ | |
| #stripe-card-element { | |
| background: #ffffff !important; | |
| padding: 10px 5px !important; | |
| margin: 5px 0px !important; |