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 | |
| /** | |
| * Introduces a new column to the 'Page' dashboard that will be used to render the page template | |
| * for the given page. | |
| * | |
| * @param array $page_columns The array of columns rendering page meta data. | |
| * | |
| * @return array $page_columns The update array of page columns. | |
| */ |
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 | |
| add_shortcode('year', function() { | |
| $current_year = date('Y'); | |
| $thanksgiving = strtotime("December 1st $current_year"); | |
| return $thanksgiving < time() ? $current_year + 1 : $current_year; | |
| }); |
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 | |
| /** | |
| * Routes specific js & css files to enqueue if they exist. | |
| * | |
| * (The idea is to use default.css & default.js for all your global styles, | |
| * then simply include default.css & default.js into your $template.css & template.js files | |
| * so that you can easily keep filesizes small and minimize the number of resources requested.) | |
| */ | |
| add_action( 'wp_enqueue_scripts', 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 | |
| add_filter('sage/display_sidebar', function ($display) { | |
| static $display; | |
| isset($display) || $display = in_array(true, [ | |
| // The sidebar will be displayed if any of the following return true | |
| is_single(), | |
| is_404(), | |
| is_page_template('views/template-custom.blade.php') |
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
| <? | |
| /** | |
| * Plugin Name: WordPress Catch All Cache Buster | |
| * Description: A quick catch-all cache-busting WordPress plugin when having clients clear their browser cache isn't an option. | |
| * Version: 1.0.0 | |
| * Author: Joseph Roberts | |
| * Author URI: https://github.com/DigitalJoeCo | |
| * License: MIT | |
| * License URI: http://opensource.org/licenses/MIT | |
| */ |
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 | |
| /** | |
| * Don't break my homepage mu-plugin | |
| * | |
| */ | |
| add_filter('user_can_richedit', function ($can) { | |
| global $post; | |
| if ($post_ID === (int) get_option('page_on_front')) { | |
| return false; |
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 | |
| add_action('plugins_loaded', function() { | |
| if ( !function_exists('is_plugin_active') ) { | |
| /** WordPress Plugin Administration API */ | |
| require_once(ABSPATH . 'wp-admin/includes/plugin.php'); | |
| } | |
| if ( is_plugin_active( 'advanced-custom-fields-pro/acf.php' ) ) { | |
| return; |