Skip to content

Instantly share code, notes, and snippets.

View mrsize's full-sized avatar

Thomas Dufranne mrsize

View GitHub Profile
@luckyshot
luckyshot / compresshtml.php
Created June 2, 2015 09:22
Compress HTML output
<?php
function compressHtml($html) {
return preg_replace( ['/\>[^\S ]+/s', '/[^\S ]+\</s', '/(\s)+/s'], ['>', '<', '\\1'], $html );
}
@ms-studio
ms-studio / add-metabox-to-taxonomy.php
Created December 14, 2015 21:57
simple but complete example of adding metabox to taxonomy - using WP 4.4 term meta functions
<?php
// source: http://wordpress.stackexchange.com/questions/211703/need-a-simple-but-complete-example-of-adding-metabox-to-taxonomy
// code authored by jgraup - http://wordpress.stackexchange.com/users/84219/jgraup
// REGISTER TERM META
add_action( 'init', '___register_term_meta_text' );
function ___register_term_meta_text() {
@aoktox
aoktox / addProduct.php
Created August 17, 2016 05:00
Insert and set attributes product woocommerce
<?php
/**
* Plugin Name: Insert Products
* Plugin URI:
* Description:
* Version: 1.04
* Author: Agus Prasetiyo
* Author URI:
* License: GPL2
* Created On:
@amboutwe
amboutwe / yoast_seo_breadcrumb_remove_link.php
Last active August 8, 2024 18:25
These snippets are examples of how you can modify the Yoast SEO breadcrumb visual output. These snippets will not alter the breadcrumb schema output. Please consult the schema documentation to change the breadcrumb schema: https://developer.yoast.com/features/schema/api#to-add-or-remove-graph-pieces