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 Car { | |
| private $model; | |
| public function __construct( $model ) { | |
| $this->model = $model; | |
| } | |
| public function get_model() { |
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 | |
| /** | |
| * Get all Super Admin users on the current site. | |
| * | |
| * @return array WP_User objects. | |
| */ | |
| function get_all_superadmin_users() { | |
| return get_users([ | |
| 'login__in' => get_super_admins() |
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 | |
| /** | |
| * Get all non-Super Admin users on the current site. | |
| * | |
| * @return array WP_User objects. | |
| */ | |
| function get_all_non_superadmin_users() { | |
| return get_users([ | |
| 'login__not_in' => get_super_admins() |
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
| { | |
| 1 => [ | |
| 'en-us' => [ | |
| 'name' => 'Puff Pastry', | |
| 'description' => 'Sign up for Puff Pastry news...' | |
| ], | |
| 'fr-ca' => [ | |
| 'name' => {French translation}, | |
| 'description' => {French transalation} | |
| ] |
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
| // ==UserScript== | |
| // @name Expand Forecast Row | |
| // @version 1.0 | |
| // @description Expand Forecast Row | |
| // @author Kellen Mace | |
| // @match https://forecastapp.com/485680/schedule/team* | |
| // @grant none | |
| // ==/UserScript== | |
| (function(document) { |
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
| // ==UserScript== | |
| // @name PHP Sandbox | |
| // @version 0.1 | |
| // @description Customize PHP Sandbox styles | |
| // @author Kellen Mace | |
| // @match http://sandbox.onlinephpfunctions.com/ | |
| // @grant none | |
| // ==/UserScript== | |
| (function() { |
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 | |
| /** | |
| * Get template part path. This function is identical to WP's | |
| * get_template_part(), except that it doesn't load the template - | |
| * just returns it so that it can be required elsewhere and have | |
| * access to variables in the local scope. | |
| * | |
| * Example usage: | |
| * $template_data = 'make this variable available in template part'; |
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 test_get_beaver_builder_module_list() { | |
| $bb_module_list = new KM_Beaver_Builder_Module_List(); | |
| // Get a list of the BB modules on the current page. | |
| $current_page_modules_list = $bb_module_list->get(); | |
| // Get a list of the BB modules on the page with a post ID of '123'. | |
| $page_123_modules_list = $bb_module_list->get( 123 ); |
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 for getting a list of Beaver Builder modules. | |
| */ | |
| class KM_Beaver_Builder_Module_List { | |
| /** | |
| * Get the list of Beaver Builder modules. | |
| * | |
| * @param int $post_id The post ID. Default is the current post being |
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 | |
| $projects = wds_get_projects(); | |
| // ...do some work... | |
| $active_projects = array_filter( $projects, function( $project ) { | |
| return 'active' === $project['status']; | |
| }); |