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 | |
set_error_handler( 'backtrace_error_handler', error_reporting() ); | |
function backtrace_error_handler( $errno, $errstr, $errfile, $errline, $errcontext ) { | |
// handle @ | |
if( 0 === error_reporting() ) | |
return false; |
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 | |
Oh_Shuddup::on_load( array( 'get_theme_data' ) ); | |
/** | |
* Shuts up deprecated messages for specific functions. | |
*/ | |
class Oh_Shuddup { | |
static $functions; |
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
// Logo | |
// http://wordpress.org/about/logos/ | |
@wp_logo_blue: #21759B; | |
@wp_logo_orange: #D54E21; | |
@wp_logo_grey: #464646; | |
// Admin | |
// http://dotorgstyleguide.wordpress.com/outline/colors/ |
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: R Debug | |
Description: Set of dump helpers for debug. | |
Author: Andrey "Rarst" Savchenko | |
Author URI: https://www.rarst.net/ | |
License: MIT | |
*/ |
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 | |
// @link http://books.google.com/books?id=fvA7zLEFWZgC&pg=PA61&lpg=PA61#v=onepage&q&f=false | |
function nice_labels( $min, $max, $ticks = 5 ) { | |
$range = nice_number( $max, false ); | |
$d = nice_number( $range / ( $ticks - 1 ) ); | |
$graphmin = floor( $min / $d ) * $d; | |
$graphmax = ceil( $max / $d ) * $d; | |
$nfrac = max( array( - floor( log( $d, 10 ) ), 0 ) ); |
NewerOlder