Consider supporting my work by purchasing the course this tutorial is a part of i.e. VSCode Power User →
- Make sure your
Local by FlyWheelWordPress install is a custom install
| <?php | |
| function my_after_license_change( $change, $current_plan ) { | |
| switch ( $change ) { | |
| case 'activated': | |
| // License activated. | |
| break; | |
| case 'cancelled': | |
| // License cancelled. | |
| break; | |
| case 'changed': |
| let regex; | |
| /* matching a specific string */ | |
| regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello" | |
| regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO" | |
| regex = /hello/g; // looks for multiple occurrences of string between the forward slashes... | |
| /* wildcards */ | |
| regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo" | |
| regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo" |
Consider supporting my work by purchasing the course this tutorial is a part of i.e. VSCode Power User →
Local by FlyWheel WordPress install is a custom install| <?php | |
| /** | |
| * Plugin name: WP Trac #42573: Fix for theme template file caching. | |
| * Description: Flush the theme file cache each time the admin screens are loaded which uses the file list. | |
| * Plugin URI: https://core.trac.wordpress.org/ticket/42573 | |
| * Author: Weston Ruter, XWP. | |
| * Author URI: https://weston.ruter.net | |
| */ | |
| function wp_42573_fix_template_caching( WP_Screen $current_screen ) { |
| <?php | |
| /** | |
| * First Method. | |
| */ | |
| function array_search_partial($arr, $keyword) { | |
| foreach($arr as $index => $string) { | |
| if (strpos($string, $keyword) !== FALSE) | |
| return $index; | |
| } | |
| } |
| <?php | |
| if(!class_exists('WpPluginUpgradeBase')) : | |
| abstract class WpPluginUpgradeBase { | |
| function __construct() { | |
| add_action( 'admin_init', array(&$this, 'load_plugin') ); | |
| } |
| <?php | |
| /** | |
| * Lightens/darkens a given colour (hex format), returning the altered colour in hex format.7 | |
| * @param str $hex Colour as hexadecimal (with or without hash); | |
| * @percent float $percent Decimal ( 0.2 = lighten by 20%(), -0.4 = darken by 40%() ) | |
| * @return str Lightened/Darkend colour as hexadecimal (with hash); | |
| */ | |
| function color_luminance( $hex, $percent ) { | |
| // validate hex string |
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream