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
| axios({ | |
| url: 'localhost:7777/api/v1/channel/1/messages', | |
| method: 'post', | |
| data: { | |
| message_id: '2kkun2k98fkxhfu8sf2444', | |
| message: 'echo', | |
| type: 'text', | |
| channel: 'presence-lexi-2', | |
| channel_id: 1 | |
| }, |
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 | |
| WP_Route::get('/api/callback', function(){ | |
| update_option('last_called', current_time('mysql')); | |
| }); |
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 Data extends WP_Model{ | |
| public $postType = 'data'; | |
| public $attributes = [ | |
| 'foo', | |
| 'author', | |
| ]; |
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 ClearOrphanMetaAction extends WP_AJAX{ | |
| protected $action = 'clear-orphan-meta-action'; | |
| protected function run(){ | |
| global $wpdb; | |
| $wpdb->get_results(" |
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 | |
| function onSave(){ | |
| $request = new WP_AJAX; | |
| if($request->has('foo')){ | |
| // Do stuff | |
| } | |
| } |
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
| version: '3.3' | |
| services: | |
| wordpress: | |
| depends_on: | |
| - db | |
| image: wordpress:latest | |
| volumes: | |
| - ./:/var/www/html | |
| ports: |
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 | |
| WP_Route::get('/', function(){ | |
| return "Hello World." | |
| }); | |
| WP_Route::get('/flights', 'flights'); // flights() | |
| WP_Route::post('/flights/{flight}', 'singleFlight'); // singleFlight($flight) | |
| WP_Route::put('/flights/{flight}/book/{date}', 'bookFlight'); | |
| WP_Route::delete('/flights/{flight}/delete', 'deleteFlight'); |
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
| public static function fieldsCallback(){ | |
| $this_ = Self::newWithoutConstructor(); | |
| if(method_exists($this_, 'cmb2Fields')){ | |
| $fields = $this_->cmb2Fields(); | |
| if(function_exists('new_cmb2_box') && is_array($fields)){ | |
| if(!isset($fields['meta_box'])){ | |
| $fields['meta_box'] = [ | |
| 'id' => get_called_class(), |
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 | |
| WP_Route::redirect('open-google', 'https://google.com', 301); | |
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 | |
| WP_Route::match(['get', 'post'], 'flights/{flight}/confirm', 'confirmFlight'); | |
| function confirmFlight($flight){ | |
| // Your Code Here | |
| } |