Skip to content

Instantly share code, notes, and snippets.

View davidperezgar's full-sized avatar

David Perez davidperezgar

View GitHub Profile
@Klerith
Klerith / Instalaciones-React.md
Last active November 15, 2024 20:47
Instalaciones recomendadas para mi curso de React de cero a experto
@cliffordp
cliffordp / functions.php
Created May 20, 2020 04:03
GeneratePress: Remove all Google Fonts loading and options.
<?php
/**
* GeneratePress: Remove all Google Fonts loading and options.
*
* @link https://gist.github.com/cliffordp/640ff4586c9a7c9ffe6656ff65326a5e This snippet.
* @link https://share.getcloudapp.com/NQuDXKJm 1min demo that this code works.
* @link https://toolset.com/documentation/adding-custom-code/using-toolset-to-add-custom-code/?aid=5336&affiliate_key=Lsvk04DjJOhq I'm using Toolset to add custom snippets.
*/
toolset_snippet_security_check() or die( 'Direct access is not allowed' );
@ncyhere
ncyhere / woo-delivery-date-picker.php
Last active May 23, 2022 00:47
Woocommerce delivery date Picker
/**
* @snippet WooCommerce Checkout date picker
* @author NCY Design https://wordpress.ncy.design
* @compatible WooCommerce 3.7.0
*/
// Register main datepicker jQuery plugin script
add_action( 'wp_enqueue_scripts', 'enabling_date_picker' );
function enabling_date_picker() {
// Only on front-end and checkout page
@diggeddy
diggeddy / WooCatHeaderElement-BG.php
Last active February 19, 2020 10:16
Use woo thumbnail for Header Element Background
add_filter( 'generate_page_hero_background_image_url', function( $url ) {
if ( ! function_exists( 'get_woocommerce_term_meta' ) ) {
return $url;
}
global $wp_query;
$cat = $wp_query->get_queried_object();
$thumbnail_id = get_woocommerce_term_meta( $cat->term_id, 'thumbnail_id', true );
$background_image = wp_get_attachment_url( $thumbnail_id );
@westonruter
westonruter / amp-gravity-forms-submission-shim.php
Last active September 5, 2024 01:58
AMP shim support for Gravity Forms submissions
<?php
/**
* AMP Gravity Forms Submission Shim plugin bootstrap.
*
* @package Google\AMP_Gravity_Forms_Submission_Shim
* @author Weston Ruter, Google
* @license GPL-2.0-or-later
* @copyright 2020 Google Inc.
*
* @wordpress-plugin
@petskratt
petskratt / clinup
Last active May 26, 2024 14:24
Use wp-cli to clean up WordPress installs (force core & plugins reinstall, track changes in git allowing easy reverts etc)
#!/usr/bin/env bash
# for debug output, uncomment:
#set -x
function help {
echo "WordPress cleanup -v 0.5 2018-06-26 / [email protected]
Usage:
<?php
/*
################### READ ME #################################
You must create a proxy file that retrieves your import file from FTP and then returns it.
You will then call that file with the 'Download from URL' option in WP All Import.
This is an example of such a proxy file. This is provided in the hopes it is useful, but without any support.
###############################################################
Instructions:
* Copy the code below to a new php file in the root of your WP site
* Update the FTP server details
@ahmadawais
ahmadawais / flywheel-local-xdebug-vscode.md
Last active September 5, 2024 01:57
Debug WordPress with Visual Studio Code | VSCode WordPress Debug Setup | WordPress xDebug Setup for Local by FlyWheel with VSCode | Part of the VSCode Learning Course → https://VSCode.pro

VSCode WordPress Debugging Setup: WordPress Xdebug Setup for Local by FlyWheel with VSCode


Consider supporting my work by purchasing the course this tutorial is a part of i.e. VSCode Power User

🚅 TL;DR

  • Make sure your Local by FlyWheel WordPress install is a custom install
var gulp = require('gulp'),
sass = require('gulp-sass'),
prefix = require('gulp-autoprefixer'),
sourcemaps = require('gulp-sourcemaps'),
livereload = require('gulp-livereload'),
input = {
'sass': [
'sass/**/*.scss'
]

Installation

This procedure is tested on Mac OS X 10.14.0 with Xcode Developer Tools installed (xCode).

PHP 5.6, 7.0, 7.1, and 7.2 installed with Homebrew following the instructions here.

Preparation

Download the following files from Oracle website (yes, you need to create an account and accept terms):