This file contains hidden or 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 | |
/** | |
* Example function description | |
* | |
* @since {Next EDD Version} | |
* @param {array, string, int, objext} {$variable_name} {Short description} | |
* @return {array, string, int, mixed, object} {$variable_name} {Short description} | |
* {@internal Any To-Dos etc.} | |
*/ |
This file contains hidden or 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
/** Debugging WP */ | |
define('WP_DEBUG', true); //enable the reporting of notices during development - E_ALL | |
define('WP_DEBUG_DISPLAY', true); //use the globally configured setting for display_errors and not force errors to be displayed | |
define('WP_DEBUG_LOG', true); //error logging to wp-content/debug.log | |
define('SCRIPT_DEBUG', true); //loads the development (non-minified) versions of all scripts and CSS and disables compression and concatenation, | |
//define('E_DEPRECATED', false); //E_ALL & ~E_DEPRECATED & ~E_STRICT | |
define('AUTOSAVE_INTERVAL', '300'); // Autosave interval | |
define('SAVEQUERIES', true); // Analyse queries |
This file contains hidden or 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
/** Debugging WP */ | |
define('WP_DEBUG', true); //enable the reporting of notices during development - E_ALL | |
define('WP_DEBUG_DISPLAY', true); //use the globally configured setting for display_errors and not force errors to be displayed | |
define('WP_DEBUG_LOG', true); //error logging to wp-content/debug.log | |
define('SCRIPT_DEBUG', true); //loads the development (non-minified) versions of all scripts and CSS and disables compression and concatenation, | |
//define('E_DEPRECATED', false); //E_ALL & ~E_DEPRECATED & ~E_STRICT | |
define('AUTOSAVE_INTERVAL', '300'); // Autosave interval | |
define('SAVEQUERIES', true); // Analyse queries |
This file contains hidden or 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 rv_twitter_text($ret) { | |
$ret = preg_replace("#(^|[\n ])([\w]+?://[\w]+[^ \"\n\r\t< ]*)#", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret); | |
$ret = preg_replace("#(^|[\n ])((www|ftp)\.[^ \"\t\n\r< ]*)#", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret); | |
$ret = preg_replace("/@(\w+)/", "<a href=\"http://www.twitter.com/\\1\" target=\"_blank\">@\\1</a>", $ret); | |
$ret = preg_replace("/#(\w+)/", "<a href=\"http://search.twitter.com/search?q=\\1\" target=\"_blank\">#\\1</a>", $ret); | |
return $ret; | |
} |
This file contains hidden or 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 is_user_logged_in() { | |
$loggedin = false; | |
foreach ( (array) $_COOKIE as $cookie => $value ) { | |
if ( stristr($cookie, 'wordpress_logged_in_') ) | |
$loggedin = true; | |
} | |
return $loggedin; | |
} | |
if ( ! stristr($_SERVER['REQUEST_URI'], '/wp-admin') && ! stristr($_SERVER['REQUEST_URI'], '/wp-login.php') && ! is_user_logged_in() ) |
This file contains hidden or 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: Hacky Taxonomy Archives | |
* Description: Don't use this on a live site, plz. Proof of concept for Aaron Holbrook. | |
* Author: Andrew Nacin | |
*/ | |
add_action( 'template_redirect', function() { | |
global $wp_rewrite; | |
$taxonomy = 'fruits'; |
This file contains hidden or 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
// Modific default settings | |
{ | |
// Name of a region icon | |
// Valid icon names are dot, circle, bookmark and cross | |
"region_icon": "circle", | |
// You can use your commands instead of plain "git" or "svn" | |
// e.g. "/usr/bin/git" or "C:\bin\git.exe" | |
"vcs": [ | |
["svn", "/usr/bin/svn"], |
This file contains hidden or 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 wptest() { | |
TESTROOT=/Users/nacin/Sites/tests | |
ARGS="--colors $@" | |
FORCE=0 | |
DEBUG=0 | |
REPLACE=$(echo $ARGS | sed -e 's/ -f\>//') | |
if [ "$ARGS" != "$REPLACE" ]; then | |
FORCE=1 | |
ARGS=$REPLACE |
This file contains hidden or 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_action( 'init', function() { | |
register_taxonomy( 'some-taxonomy', 'post', array( | |
'show_ui' => true, | |
'rewrite' => false, | |
'public' => true, | |
'labels' => array( | |
'name' => 'Some Taxonomy', | |
'singular_name' => 'Some Taxonomy', |
This file contains hidden or 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
# custom login link | |
RewriteRule ^login$ http://localhost/whitelabel/wp-login.php [NC,L] |
OlderNewer