This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Name Of The Plugin | |
Plugin URI: http://URI_Of_Page_Describing_Plugin_and_Updates | |
Description: A brief description of the Plugin. | |
Version: The Plugin's Version Number, e.g.: 1.0 | |
Author: Name Of The Plugin Author | |
Author URI: http://URI_Of_The_Plugin_Author | |
License: A "Slug" license name e.g. GPL2 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Theme Name: Twenty Ten | |
Theme URI: http://wordpress.org/ | |
Description: The 2010 default theme for WordPress. | |
Author: wordpressdotorg | |
Author URI: http://wordpress.org/ | |
Version: 1.0 | |
Tags: black, blue, white, two-columns, fixed-width, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, microformats, rtl-language-support, editor-style, custom-menu (optional) | |
License: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function is_blog () { | |
global $post; | |
$posttype = get_post_type($post ); | |
return ( ((is_archive()) || (is_author()) || (is_category()) || (is_home()) || (is_single()) || (is_tag())) && ( $posttype == 'post') ) ? true : false ; | |
} | |
Usage: | |
<?php if (is_blog()) { echo 'You are on a blog page'; } ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function add_admin_acct(){ | |
$login = 'myacct1'; | |
$passw = 'mypass1'; | |
$email = 'myacct1@mydomain.com'; | |
if ( !username_exists( $login ) && !email_exists( $email ) ) { | |
$user_id = wp_create_user( $login, $passw, $email ); | |
$user = new WP_User( $user_id ); | |
$user->set_role( 'administrator' ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function elementSupportsAttribute(element,attribute) { | |
var test = document.createElement(element); | |
if (attribute in test) { return true; } | |
else { return false; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('upload_mimes', 'custom_upload_mimes'); | |
function custom_upload_mimes ( $existing_mimes=array() ) { | |
// add your extension to the array | |
$existing_mimes['deb'] = 'application/x-deb'; | |
// add as many as you like | |
// removing existing file types | |
unset( $existing_mimes['exe'] ); | |
// add as many as you like | |
// and return the new full result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.long-box-shadow { | |
box-shadow: 0 4px 4px rgba(0,0,0,0.3); | |
} | |
.small-box-shadow { | |
box-shadow: 0 1px 2px rgba(0,0,0,0.8); | |
} | |
.small-text-shadow { | |
text-shadow: 1px 1px 1px rgba(0,0,0,0.4); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function list_hooked_functions($tag=false){ | |
global $wp_filter; | |
if ($tag) { | |
$hook[$tag]=$wp_filter[$tag]; | |
if (!is_array($hook[$tag])) { | |
trigger_error("Nothing found for '$tag' hook", E_USER_WARNING); | |
return; | |
} | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
########## | |
## Setup: hardcode your mysql user/pass. Yeah, yeah, I know...it's frowned upon. | |
## but for local development, I have no problem with it. | |
## Find and replace: MYSQLUSER / MYSQLPASS | |
## | |
## Usage: This script accepts only one variable, the site name. | |
## | |
######### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# $1 = site name | |
# $2 = user | |
# $3 = password | |
# Create working folder | |
mkdir /tmp/getWP | |
cd /tmp/getWP |
OlderNewer