Skip to content

Instantly share code, notes, and snippets.

View wordpressvn's full-sized avatar
🏠
Working from home

WordPress Vietnam Team wordpressvn

🏠
Working from home
View GitHub Profile

Keybase proof

I hereby claim:

  • I am wordpressvn on github.
  • I am huynhsituan (https://keybase.io/huynhsituan) on keybase.
  • I have a public key ASD8XhpTr-WNlhiAXnfUFFYDKMrGsEbDrFmmy4kOc83e5Qo

To claim this, I am signing this object:

@wordpressvn
wordpressvn / codesnippet.php
Created June 18, 2021 04:51 — forked from codeagencybe/codesnippet.php
split street/housenumber woocommerce
/*
Description: unset WooCommerce billing & shipping address_1 field in checkout in favor for 2 new custom fields street and houseno
Author: Code Agency
Author URI: https://codeagency.be
*/
function codeagency_remove_checkout_fields( $fields ) {
// Billing fields
// unset( $fields['billing']['billing_company'] );
// unset( $fields['billing']['billing_email'] );
@wordpressvn
wordpressvn / add-rel-nofollow-checkbox.php
Created June 30, 2021 08:47 — forked from danielbachhuber/add-rel-nofollow-checkbox.php
Add a 'Add rel="nofollow" to link' checkbox to the WordPress link editor
<?php
/**
* Add a 'Add rel="nofollow" to link' checkbox to the WordPress link editor
*
* @see https://danielbachhuber.com/tip/rel-nofollow-link-modal/
*/
add_action( 'after_wp_tiny_mce', function(){
?>
<script>
@wordpressvn
wordpressvn / frontendDevlopmentBookmarks.md
Created July 1, 2021 10:23 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.
@wordpressvn
wordpressvn / minifier.php
Created July 2, 2021 10:11 — forked from abranhe/minifier.php
WordPress Minifier
<?php
/**
* W3C Fix and HTML minifier
* Nobody knows how this work, so don't touch it!!!
*
* https://wordpress.stackexchange.com/a/227896/129134
* https://stackoverflow.com/a/41148695
*/
@wordpressvn
wordpressvn / tiny_login.php
Created July 3, 2021 11:14 — forked from ideag/tiny_login.php
WordPress front-end login and registration forms
<?php
/*
Plugin Name: tinyLogin
Plugin URI: http://wp.tribuna.lt/tiny-login
Description: A simple front-end login/registration system. Adds template tags and shortcodes. Shortcodes: [tiny_form_login]/[tiny_form_register]. Template tags: get_tiny_form_login()/get_tiny_form_register() and the_tiny_form_login()/the_tiny_form_register()
Version: 0.1
Author: Arūnas
Author URI: http://wp.tribuna.lt/
Text Domain: tiny_login
*/
let botToken='1356037801:AAG8tzLp03DIhпр48jZ-MHC3NNGOF6QFjM4'//токен бота
let webAppUrl='https://script.google.com/macros/s/AKfycbxK945bZlFW_8rrtPt0XmkVyN7ra0ELuUZHyOeR9zvOPcDxUGxu/exec'//id таблицы
let telegramUrl = "https://api.telegram.org/bot" + botToken;
function setWebhook(){
var url = telegramUrl + "/setWebhook?url=" + webAppUrl;
var response = UrlFetchApp.fetch(url);
Logger.log(response)
}
function deleteWebhook(){
<?php
// Debug
//Activate log files in wp-config.php
define( 'WP_DEBUG', true ); // Enabling WP_DEBUG will cause all PHP errors, notices and warnings to be displayed.
define( 'WP_DEBUG_LOG', true ); // Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_DISPLAY', true ); // Controls whether debug messages are shown inside the HTML of pages or not.
// use this
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );

** WP - Optimizations and Cleanup **

Here you can find a a list of WP optimization and cleanup functions and methodology.

  1. .htaccess
  • Force https to your site.
  • Enable Browser Cache for your static files. This will fix the "Leverage Browser Caching" in the google pagespeed results.
  • Enable file compreassion for faster page load.
  1. wp-config.php
@wordpressvn
wordpressvn / Wordpress snippets.php
Created July 10, 2021 12:41 — forked from AntonLitvin/Wordpress snippets.php
Разные полезные функции и фильтры
=====================================================================
Фильтр по acf полю
<select onchange="location=value">
<option value="" selected="selected">Выбрать район</option>
<option value="?district=1">Район 1</option>
<option value="?district=2">Район 2</option>
<option value="?district=3">Район 3</option>
</select>