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 | |
| // This loads the react-devtools script in wp-admin when using Safari. | |
| add_action( 'admin_enqueue_scripts', function() { | |
| if ( ! empty( $_SERVER['HTTP_USER_AGENT'] ) && strpos( $_SERVER['HTTP_USER_AGENT'], 'Safari' ) !== false ) { | |
| ?> | |
| <script src="http://localhost:8097"></script> | |
| <?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
| #!/usr/bin/env bash | |
| # =============================================================================== | |
| # Script to install PHPUnit in the Local by Flywheel Mac app | |
| # These packages are installed | |
| # | |
| # PHPUnit, git, subversion, composer, curl and wget | |
| # | |
| # The $WP_CORE_DIR and $WP_TESTS_DIR environment variables are added to the ~/.bashrc file | |
| # |
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
| function simple_plugin_updater( $update_plugins, $transient_name ) { | |
| $plugin = json_decode( | |
| json_encode( | |
| array( | |
| 'new_version' => 89, | |
| 'stable_version' => 89, | |
| 'name' => 'My Fake Plugin', | |
| 'slug' => 'my-fake-plugin.php', | |
| 'url' => 'https://myfakeplugin.com', |
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 | |
| /* | |
| * Plugin Name: Commercial Client | |
| * Plugin URI: http://pento.net/ | |
| * Description: A sample client plugin for showing updates for non-WordPress.org plugins | |
| * Author: pento | |
| * Version: 0.1 | |
| * Author URI: http://pento.net/ | |
| * License: GPL2+ | |
| */ |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <opml version="1.0"> | |
| <head> | |
| <title>Subscriptions - freek@spatie.be</title> | |
| </head> | |
| <body> | |
| <outline text="PHP" title="PHP"> | |
| <outline htmlUrl="http://mattallan.org" title="mattallan.org" xmlUrl="http://mattallan.org/feed.xml" type="rss" text="mattallan.org"/> | |
| <outline title="asked.io" xmlUrl="https://asked.io/rss" type="rss" text="asked.io"/> | |
| <outline htmlUrl="https://ocramius.github.io/" title="ocramius.github.io" xmlUrl="https://ocramius.github.io/atom.xml" type="rss" text="ocramius.github.io"/> |
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
| /** | |
| * This plugin adds support for custom restriction messages per post. | |
| * If a custom message exists, it is used in place of the ones defined | |
| * in the RCP settings under Restrict > Settings > General. | |
| */ | |
| /** | |
| * Displays the custom message metabox on the post edit screen. | |
| */ | |
| function jp_rcp_post_level_restriction_message_metabox() { |
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 | |
| /** | |
| * "Friendlier, Safer WordPress Admin Areas" | |
| * Presented by Cliff Seal at WordCamp Atlanta 2015 and Asheville 2016 | |
| * Slides: http://www.slideshare.net/cliffseal/wp-admin | |
| * | |
| * Plugin Name: A Better Admin Experience | |
| * Plugin URI: http://evermoresites.com | |
| * Description: Cleans up and sanitizes the WordPress admin area | |
| * Version: 1.0 |
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 | |
| /** | |
| * Display the post time in a human readable format | |
| * | |
| * @return string | |
| */ | |
| function carmack_human_time_diff() { | |
| $post_time = get_the_time( 'U' ); | |
| $time_now = date( 'U' ); |
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 | |
| /* | |
| Plugin Name: Easy Digital Downloads - Sort category archives by random order | |
| */ | |
| function jp_sort_edd_category_archives( $query ) { | |
| if ( is_tax( 'download_category' ) && $query->is_main_query() ) { | |
| $query->set( 'orderby', 'rand' ); | |
| } | |
| } | |
| add_action( 'pre_get_posts', 'jp_sort_edd_category_archives' ); |
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
| function jp_no_krw_decimal( $decimals, $currency ) { | |
| if ( 'KRW' == $currency ) { // Korean Won. Set to your currency code. | |
| return 0; | |
| } | |
| return $decimals; | |
| } | |
| add_filter( 'edd_currency_decimal_count', 'jp_no_krw_decimal', 10, 2 ); |