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
| const path = require( 'path' ); | |
| const webpack = require( 'webpack' ); | |
| const ExtractTextPlugin = require( 'extract-text-webpack-plugin' ); | |
| // const BrowserSyncPlugin = require( 'browser-sync-webpack-plugin' ); | |
| // Set different CSS extraction for editor only and common block styles | |
| const blocksCSSPlugin = new ExtractTextPlugin( { | |
| filename: './blocks/css/blocks.style.css', | |
| } ); | |
| const editBlocksCSSPlugin = new ExtractTextPlugin( { |
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
| .sidebar { | |
| background-color: $light-grey; | |
| padding-top: 30px; | |
| padding-bottom: 30px; | |
| .widget { | |
| margin-bottom: 20px; | |
| .widgettitle { | |
| @include josefin(28px, $dark-blue, 400, uppercase); | |
| border-bottom: 1px solid $dark-blue; | |
| text-align: center; |
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
| <?php | |
| include_once( SPORTS_BENCH_PATH . 'functions/rest-api/sports-bench-team-rest-controller.php' ); | |
| /** | |
| * Register the custom routes for the tables | |
| * | |
| * @since 1.4 | |
| */ | |
| function sports_bench_register_endpoints(){ |
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
| <?php | |
| /** | |
| * Sports-bench-team-rest-controller.php | |
| * | |
| * Creates a REST API controller for teams | |
| * | |
| * @package Sports Bench | |
| * | |
| * @author Jacob Martella | |
| * |
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
| <?php | |
| class Sports_Bench_Team_REST_Controller extends WP_REST_Controller { | |
| /** | |
| * Delete one item from the collection | |
| * | |
| * @param WP_REST_Request $request Full data about the request. | |
| * @return WP_Error|WP_REST_Request | |
| */ | |
| public function delete_item( $request ) { | |
| $item = $this->prepare_item_for_database( $request ); |
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
| <?php | |
| class Sports_Bench_Team_REST_Controller extends WP_REST_Controller { | |
| /** | |
| * Update one item from the collection | |
| * | |
| * @param WP_REST_Request $request Full data about the request. | |
| * @return WP_Error|WP_REST_Response | |
| */ | |
| public function update_item( $request ) { | |
| $item = $this->prepare_item_for_database( $request ); |
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
| <?php | |
| class Sports_Bench_Team_REST_Controller extends WP_REST_Controller { | |
| /** | |
| * Create one item from the collection | |
| * | |
| * @param WP_REST_Request $request Full data about the request. | |
| * @return WP_Error|WP_REST_Response | |
| */ | |
| public function create_item( $request ) { |
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
| <?php | |
| class Sports_Bench_Team_REST_Controller extends WP_REST_Controller { | |
| /** | |
| * Get a collection of items | |
| * | |
| * @param WP_REST_Request $request Full data about the request. | |
| * @return WP_Error|WP_REST_Response | |
| */ | |
| public function get_items( $request ) { | |
| $params = $request->get_params(); |
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
| <?php | |
| protected function prepare_item_for_database( $request ) { | |
| global $wpdb; | |
| $table_name = $wpdb->prefix . 'sb_teams'; | |
| if ( isset( $request[ 'team_id' ] ) ) { | |
| $team_id = wp_filter_nohtml_kses( sanitize_text_field( $request[ 'team_id' ] ) ); | |
| } elseif ( isset( $request[ 'id' ] ) ) { | |
| $team_id = wp_filter_nohtml_kses( sanitize_text_field( $request[ 'id' ] ) ); |