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 twtreplace($content) { | |
$twtreplace = preg_replace('/([^a-zA-Z0-9-_&])@([0-9a-zA-Z_]+)/',"$1<a href=\"http://twitter.com/$2\" target=\"_blank\" rel=\"nofollow\">@$2</a>",$content); | |
return $twtreplace; | |
} | |
add_filter('the_content', 'twtreplace'); | |
add_filter('comment_text', 'twtreplace'); |
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 | |
class XDOMElement extends DOMElement { | |
function __construct($name, $value = null, $namespaceURI = null) { | |
parent::__construct($name, null, $namespaceURI); | |
} | |
} | |
class XDOMDocument extends DOMDocument { |
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
session_unset(); | |
session_destroy(); | |
session_write_close(); | |
setcookie(session_name(),'',0,'/'); | |
session_regenerate_id(true); |
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
add_action('init','disable_default_registration'); | |
function disable_default_registration(){ | |
global $pagenow; | |
if( 'wp-login.php' == $pagenow && $_REQUEST['action'] == 'register') { | |
$registration_redirect = apply_filters('disable_default_registration_redirect', site_url()); | |
wp_redirect($registration_redirect); | |
exit(); | |
} | |
} |
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
isset($_SESSION) || session_start(); |
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
//load styles and scripts for this page | |
add_action( 'wp_enqueue_scripts', 'this_page_stylesheet' ); | |
add_action( 'wp_enqueue_scripts', 'this_page_js' ); | |
function this_page_stylesheet() { | |
$ss_filename = str_replace('php', 'css', basename(__FILE__)); | |
wp_enqueue_style( 'page-style', get_stylesheet_directory_uri().'/appearance/'.$ss_filename); | |
} | |
function this_page_js() { |
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
/** | |
* Sorts an array by the value defined in $key | |
* @author Seth Carstens [seth@sethmatics.com] | |
* | |
* example array: | |
* $array[1]['regularvalue'->'sample1','selectedsortvalue'->'a comes before b'] | |
* $array[2]['regularvalue'->'sample2','selectedsortvalue'->'c comes after b'] | |
* ex array after usort($array, valsort('selectedsortvalue'));: | |
* $array[2]['regularvalue'->'sample2','selectedsortvalue'->'c comes after b'] | |
* $array[1]['regularvalue'->'sample1','selectedsortvalue'->'a comes before b'] |
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
//enable callFunction function | |
function callFunction(func){ | |
this[func].apply(this, Array.prototype.slice.call(arguments, 2)); | |
} | |
/* use case, calling many function dynamically | |
jQuery.each(filterGroups, function(index, value){ | |
if(value.onoff){ | |
if(maybe_debug) console.log(index,':',value);callFishFinderFunction('applyFilter',index);} | |
}); | |
*/ |
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
/** | |
* Returns array of features, also | |
* Scans the plugins subfolder "/classes" | |
* | |
* @since 0.1 | |
* @return void | |
*/ | |
protected function load_classes() { | |
// load all files with the pattern *.php from the directory inc |
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('wp_print_styles','check_styles', 1); | |
function check_styles(){ | |
$hook_name = 'wp_enqueue_scripts'; | |
global $wp_filter; | |
var_dump( $wp_filter[$hook_name] );exit; | |
} |
OlderNewer