Skip to content

Instantly share code, notes, and snippets.

View vburlak's full-sized avatar
🚀

Vladislav Burlak vburlak

🚀
View GitHub Profile
@Ruzgfpegk
Ruzgfpegk / wp-perf.md
Last active June 28, 2025 03:36
WordPress Performance & Development tips
@westonruter
westonruter / amp-reader-nav-menu.php
Last active May 9, 2022 16:35
Basic plugin which adds a nav menu to Reader mode templates in the AMP plugin. When in Reader mode, upon activation a new “AMP Reader Sidebar” nav menu location is available for assigning the desired nav menu. Temporary until closed: https://github.com/ampproject/amp-wp/issues/2044
<?php
/**
* Plugin Name: AMP Reader Nav Menu
*
* @package AMP_Reader_Nav_Menu
* @author Weston Ruter, Google
* @license GPL-2.0-or-later
* @copyright 2019 Google Inc.
*
* @wordpress-plugin
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"
@Log1x
Log1x / functions.php
Created March 7, 2019 16:38
Remove noopener & noreferrer on WordPress links
/**
* 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;
});
@westonruter
westonruter / get-the-date-filter.php
Last active November 8, 2019 19:58
Re: Warning: date() expects parameter 2 to be integer, string given in /www/wp-content/plugins/amp/includes/amp-helper-functions.php on line 659 https://wordpress.org/support/topic/line-error-shown-with-wp_debug/#post-10799506
<?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' ) ) );
theme() { cd $(wp theme path)/$(wp option get stylesheet | cut -d/ -f1) }
@chrismccoy
chrismccoy / gutenberg.txt
Last active September 26, 2025 12:19
Gutenberg Resources
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
@caco26i
caco26i / create_trellis_project.sh
Last active February 5, 2023 04:23
Create a Roots.io project working with Git Subtrees, Trellis, Bedrock, Sage
#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
@garretthyder
garretthyder / gform_ajax_nojs.js
Created February 27, 2018 19:58
No-JS Support for Gravity Forms AJAX
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');
}