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 image sizes | |
| */ | |
| add_action('after_setup_theme', function (): void { | |
| $imageSizeColumnsAll = [3, 6, 9, 12, 18, 24]; | |
| $biggestImageSize = 1600; | |
| foreach ($imageSizeColumnsAll as $column) { |
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
| /* | |
| CONFIGURE HERE | |
| - TARGET_TEXTS: all text variants of the phone number on your site to replace. | |
| - TARGET_TEL: digits-only version of the phone number (for tel: links). | |
| - CAMPAIGN_NUMBERS: map of se_campaign value => replacement number display format (tel is auto-generated). | |
| - STORAGE_KEY/STORAGE_DAYS: storage settings (uses localStorage if available, cookie fallback). | |
| */ | |
| (function () { | |
| var TARGET_TEXTS = [ | |
| "(555) 555-1212", |
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
| APP_URL=http://whatever-your-local-domain-is.test |
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
| #!/bin/bash | |
| # Set up variables | |
| DBUSER="" | |
| DBPASSWORD="" | |
| DESTINATION="/volumes/external/mariadb" | |
| EXCLUDE_DB="information_schema|performance_schema|mysql|sys" # Add any databases you want to exclude | |
| # Get the list of databases | |
| DBS=$(mysql -u $DBUSER -p$DBPASSWORD -e "SHOW DATABASES;" | grep -Ev "Database|$EXCLUDE_DB") |
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 | |
| /** | |
| * Temporary fix for Gravity Forms merge tags on form notification edit screens | |
| * | |
| * @see https://github.com/roots/acorn/issues/198 | |
| */ | |
| add_action('admin_footer', function (): void { | |
| // Only on GF admin pages | |
| if (!class_exists('GFForms') || !isset($_GET['page']) || 'gf_edit_forms' !== $_GET['page']) { | |
| return; |
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: Solid Security configuration | |
| * Plugin URI: https://joshuafredrickson.com | |
| * Version: 1.0.0 | |
| * Description: Filter notifications in non-production environments. | |
| * Author: Kinetic | |
| * Author URI: https://joshuafredrickson.com | |
| * License: GNU General Public License v2 | |
| * License URI: http://www.gnu.org/licenses/gpl-2.0.html |
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
| /** | |
| * Hook into the Gravity Forms submission process to show a loading state | |
| */ | |
| const wrapper = document.querySelector( | |
| '.gform_wrapper' | |
| ); | |
| const gfSubmitting = `gf_submitting_${ | |
| wrapper.querySelector('form').dataset.formid | |
| }`; |
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 | |
| /** | |
| * Remove Slider Revolution metabox from certain post types. | |
| * This includes removing it from the top of ACF field groups. | |
| */ | |
| add_action('do_meta_boxes', function (): void { | |
| if (!is_admin()) { | |
| return; | |
| } |
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: Content Security Policy | |
| * Version: 1.0.1 | |
| * Description: Adds a Content-Security-Policy header to all non-admin requests. | |
| * Requires PHP: 8.1 | |
| * Requires at least: 5.7.0 | |
| * License: GNU General Public License v2 | |
| * License URI: http://www.gnu.org/licenses/gpl-2.0.html | |
| * Original Inspiration: https://gist.github.com/westonruter/c8b49406391a8d86a5864fb41a523ae9 |
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 | |
| use Illuminate\Support\Str; | |
| /** | |
| * Add `rel="preload"` to font files found in the manifest | |
| */ | |
| add_filter('wp_head', function (): void { | |
| echo collect( | |
| json_decode(asset('manifest.json')->contents()) |
NewerOlder