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
/** | |
* Disable changing the theme for anyone a part from the admin user | |
*/ | |
add_action('admin_init', 'disable_changing_theme_for_non_admin'); | |
function disable_changing_theme_for_non_admin() { | |
global $submenu, $userdata; | |
get_currentuserinfo(); | |
if ($userdata->ID != 1) { | |
unset($submenu['themes.php'][5]); | |
} |
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_filter('query_vars', 'add_queryvars' ); | |
function add_queryvars( $qvars ){ | |
$qvars[] = '_m'; | |
return $qvars; | |
} |
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
tar czf new-files.tar.gz `git diff <COMMITIDFROM> <COMMITIDTO> --name-only` |
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
$child_of = 0; | |
if (empty($post->post_parent)){ | |
$child_of = $post->ID; | |
} | |
else { | |
$child_of = $post->post_parent; | |
} | |
// Set defaults | |
$defaults = array( |
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 add_attr_attachment_link($html){ | |
$attr = array( | |
// array of attributes | |
); | |
$html = str_replace('<a','<a '.join(' ',$attr),$html); | |
return $html; | |
} | |
add_filter('wp_get_attachment_link','add_attr_attachment_link',10,1); |
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 wp_list_pages_add_first_last($content) { | |
$content = preg_replace('/li class\=\"/', 'li class="first ', $content, 1); | |
$content_rev = strrev($content); | |
$content_rev = preg_replace('/\"\=ssalc il/', ' tsal"=ssalc il', $content_rev, 1); | |
return strrev($content_rev); | |
} | |
add_filter('wp_list_pages','wp_list_pages_add_first_last'); |
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 | |
ini_set('xdebug.var_display_max_children', 3999 ); | |
ini_set('xdebug.var_display_max_data', 3999 ); | |
ini_set('xdebug.var_display_max_depth', 3999 ); | |
?> |
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 wpautop_fix( $content ){ | |
$content = ereg_replace('<p[^>]*>(<img[^>]*>)<\\/p[^>]*>', '\\1', $content); | |
return $content; | |
} | |
add_filter('the_content', 'wpautop_fix'); |
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(d){ | |
dojo.extend(dojo.NodeList, { | |
equalHeight: function(options, data){ | |
var defaults = { | |
height:null, | |
minHeight: 0, | |
maxHeight: null | |
}; | |
options = dojo.mixin(defaults, options); |