Skip to content

Instantly share code, notes, and snippets.

View jamigibbs's full-sized avatar

Jami Gibbs jamigibbs

View GitHub Profile
@esthezia
esthezia / php-sanitize-multidimensional-array.php
Created June 18, 2013 11:01
PHP - Sanitize a multidimensional array
<?php
/**
* Sanitize a multidimensional array
*
* @uses htmlspecialchars
*
* @param (array)
* @return (array) the sanitized array
*/
@wpscholar
wpscholar / functions.php
Last active March 1, 2021 13:26
Enqueueing IE conditional stylesheets in WordPress the right way
<?php
add_action( 'wp_enqueue_scripts', 'enqueue_my_styles' );
/**
* Example callback function that demonstrates how to properly enqueue conditional stylesheets in WordPress for IE.
* IE10 and up does not support conditional comments in standards mode.
*
* @uses wp_style_add_data() WordPress function to add the conditional data.
* @link https://developer.wordpress.org/reference/functions/wp_style_add_data/
@westonruter
westonruter / WidgetWithBehaviorScript.widget.php
Created May 6, 2010 22:08
WidgetWithBehaviorScript: Template for a WordPress widget which enqueues an accompanying behavior script; script only output if widget is rendered.
<?php
class WidgetWithBehaviorScript extends WP_Widget {
function __construct() {
parent::__construct(__CLASS__, 'Widget with Accompanying Behavior Script', array(
'classname' => __CLASS__,
'description' => "This WordPress widget serves as a pattern for how to enqueue a script only if the widget is actually rendered."
));