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
| tap "homebrew/bundle" | |
| tap "homebrew/cask" | |
| tap "homebrew/core" | |
| tap "homebrew/services" | |
| # Search tool like grep, but optimized for programmers | |
| brew "ack" | |
| # Library for command-line editing | |
| brew "readline" | |
| # Interpreted, interactive, object-oriented programming language | |
| brew "python" |
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
| /** | |
| * Remove rel="noopener noreferrer" in TinyMCE links | |
| * | |
| * @param array $init | |
| * @return array | |
| */ | |
| add_filter('tiny_mce_before_init', function ($init) { | |
| $init['allow_unsafe_link_target'] = true; | |
| return $init; | |
| }); |
Snippets frequently used with Sage
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 | |
| function et_last_modified_date_blog( $the_date, $format ) { | |
| if ( 'post' === get_post_type() && 'U' !== $format ) { // Make sure the Unix timestamp is not being requested. | |
| $the_time = get_post_time( 'His' ); | |
| $the_modified = get_post_modified_time( 'His' ); | |
| $last_modified = sprintf( __( 'Last updated %s', 'Divi' ), esc_html( get_post_modified_time( 'M j, Y' ) ) ); | |
| $published = sprintf( __( 'Published on %s', 'Divi' ), esc_html( get_post_time( 'M j, Y' ) ) ); |
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
| theme() { cd $(wp theme path)/$(wp option get stylesheet | cut -d/ -f1) } |
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
| Eliminate All Blocks from Editor | |
| wp.data.dispatch( 'core/block-editor' ).resetBlocks([]); | |
| How to Use WordPress Block Builder to Create Custom Page Layouts Easily | |
| https://www.webfactoryltd.com/blog/how-to-use-wordpress-block-builder-to-create-custom-page-layouts-easily/ | |
| How to Extend or Create Variations for WordPress Blocks | |
| https://getbutterfly.com/how-to-extend-or-create-variations-for-wordpress-blocks/ | |
| How to disable and lock Gutenberg blocks |
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
| #change de URL of the repo | |
| repo=<repo_url.git> | |
| tools=(trellis bedrock sage) #tool from roots.io | |
| subtrees=(trellis site site/web/app/themes/sage) #folder structure for the tools | |
| #init repo | |
| git init | |
| git remote add origin ${repo} | |
| touch .gitignore |
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
| jQuery(document).ready(function($) { | |
| // Gravity Forms no-js support on Ajax | |
| if ( $('.gform_wrapper form[data-target]').length ) { | |
| $('.gform_wrapper form[data-target]').attr('target', $('.gform_wrapper form[data-target]').data('target')); | |
| } | |
| if ( $(".gform_wrapper input[name='nojs_gform_ajax']").length ) { | |
| $(".gform_wrapper input[name='nojs_gform_ajax']").attr('name', 'gform_ajax'); | |
| } |