Skip to content

Instantly share code, notes, and snippets.

@roscabgdn
roscabgdn / array-insert-after.php
Created February 14, 2017 10:40 — forked from wpscholar/array-insert-after.php
Insert a value or key/value pair after a specific key in an array. If key doesn't exist, value is appended to the end of the array.
<?php
/**
* Insert a value or key/value pair after a specific key in an array. If key doesn't exist, value is appended
* to the end of the array.
*
* @param array $array
* @param string $key
* @param array $new
*
@roscabgdn
roscabgdn / functions.php
Created April 14, 2016 14:03 — forked from bentasm1/functions.php
WC Vendors - Notify anyone registering in WooCommerce on Checkout or My Account Page about strong password requirement.
OPTION 1 - Add a warning that you need a stronger password.
/* WC Vendors - Add a "Need a strong password" notice to the My Account Page */
add_action( 'woocommerce_register_form', 'wcvendors_notify_password_myaccount' );
function wcvendors_notify_password_myaccount() {
echo '<strong>Important</strong> -- This site respects your security. We require all new members to use a strong password. If you can not click the Register button, <strong>you need a stronger password</a>.<br><br>';
}
/* WC Vendors - Add a "Need a strong password" notice to the Checkout Page */
add_action( 'woocommerce_after_checkout_registration_form', 'wcvendors_notify_password_checkout' );
function wcvendors_notify_password_checkout() {
@roscabgdn
roscabgdn / Excerpt wysiwyg
Last active April 13, 2016 09:30 — forked from setola/function.php
Wordpress - excerpt with wysiwyg editor
<?php
/**
* This class removes the default excerpt metabox
* and adds a new box with the wysiwyg editor capability
* @author etessore
*/
class TinyMceExcerptCustomization{
const textdomain = '';
const custom_exceprt_slug = '_custom-excerpt';