Skip to content

Instantly share code, notes, and snippets.

@LogixRepo
LogixRepo / disable-plugins-when-doing-local-dev.php
Created May 17, 2012 02:01 — forked from markjaquith/disable-plugins-when-doing-local-dev.php
Disables specified WordPress plugins when doing local development
<?php
/*
Plugin Name: Disable plugins when doing local dev
Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify
Version: 0.1
License: GPL version 2 or any later version
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/
@LogixRepo
LogixRepo / gist:2501216
Created April 26, 2012 17:40
Wordpress: Function - enqueue_scripts_method()
/* ENQEUE CUSTOM SCRIPTS */
function enqueue_scripts_method() {
/*
wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer );
$handle (required): script name - Default: None
$src (optional): url to script (optional if wp_register_script has been used, if this is the case use just $handle) - Default: false
$deps (optional): if script depends on another script, i.e. 'jquery' - Default: array()
$ver (optional): script version - Default: false
$in_footer (optional): Boolean to link file in wp_footer(). Default: false
@LogixRepo
LogixRepo / gist:2485040
Created April 25, 2012 00:55
Wordpress: Is Child Function
/*
* Checks if the page is the parent or a child of the page matching the $pid param
* $pid can be the page slug or the page ID #
*
* This function is best used to display menus when the parent/top level menu item needs
* a rollover state or special treatment.
*
* @param \$pid (string or int)
* returns true if current page ID matches $pid, else return false
*/