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
| File path for a pre WordPress 4.7 asset: | |
| <img src="<?php echo get_template_directory_uri(); ?>/images/filename.png" /> | |
| File path for a WordPress 4.7 + asset: | |
| <img src="<?php echo get_theme_file_uri( ‘/images/filename.png’ ); ?>" /> |
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
| Below is a full tutorial on how to setup and use Googles Firebase push notification API for both Android and iOS. It is based on this | |
| earlier implementation of Googles GCM method: https://gist.github.com/prime31/5675017 - FCM is the new method and GCM will eventually be | |
| retired. | |
| ## THE BELOW METHOD IS THE NEWER FCM METHOD: | |
| Register your app in the FCM Console: https://console.firebase.google.com (add project) | |
| 1. Click on the newly added project, in the upper left menu is the "Overview" and Gear Settings. | |
| 2. Click on the GEAR settings icon, and then on "Project Settings" | |
| 3. In the main screen, click on "Cloud Messaging" |
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: Disable auto translation updates | |
| Description: Prevents WordPress from automatically updating translation files in the global languages directory. | |
| Author: Tim Whitlock | |
| 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 | |
| /* | |
| Plugin Name: Loco Standalone Loader | |
| Description: Mimics Loco_hooks_LoadHelper without dependency on the main plugin | |
| Author: Tim Whitlock | |
| Version: 1.0 | |
| */ | |
| new LocoStandaloneLoadHelper; |
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 | |
| /** | |
| * First we will create a settings page and add the name of the page to the | |
| * admin dashboard | |
| * Hook to be used in `admin_menu` | |
| */ | |
| add_action( 'admin_menu', 'wpgf_menu_page_setup' ); | |
| function wpgf_menu_page_setup() { | |
| add_menu_page( |
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( 'gform_after_submission', 'upload_photo', 10, 2 ); | |
| function convert_to_attachment( $entry, $form ) { | |
| // ID of the title field | |
| $title = rgar( $entry, 1 ); | |
| // ID of the upload button | |
| $url = rgar( $entry, 2 ); |
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
| // Your server must have wp-cli installed (http://wp-cli.org/) | |
| var async = require("async"); | |
| var exec = require("child_process").exec; | |
| var cores = 32; // Adjust the number of cores to match your environment | |
| var total = 0; | |
| var finished = 0; | |
| var q = async.queue(function(task, callback) { |
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
| if ( ! function_exists( 'helper_vc_fonts' ) ) { | |
| function helper_vc_fonts( $fonts_list ) { | |
| $poppins->font_family = 'Poppins'; | |
| $poppins->font_types = '300 light regular:300:normal,400 regular:400:normal,500 bold regular:500:normal,600 bold regular:600:normal,700 bold regular:700:normal'; | |
| $poppins->font_styles = 'regular'; | |
| $poppins->font_family_description = esc_html_e( 'Select font family', 'helper' ); | |
| $poppins->font_style_description = esc_html_e( 'Select font styling', 'helper' ); | |
| $fonts_list[] = $poppins; | |
| return $fonts_list; |
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('wp_footer', 'react_login_add_babel_script', 999); | |
| function react_login_add_babel_script() { | |
| ?> | |
| <script type="text/babel"> | |
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
| @echo off | |
| setlocal | |
| call :setESC | |
| cls | |
| echo %ESC%[101;93m STYLES %ESC%[0m | |
| echo ^<ESC^>[0m %ESC%[0mReset%ESC%[0m | |
| echo ^<ESC^>[1m %ESC%[1mBold%ESC%[0m | |
| echo ^<ESC^>[4m %ESC%[4mUnderline%ESC%[0m |