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
ErrorDocument 400 /errors/badrequest.html | |
ErrorDocument 401 /errors/authreqd.html | |
ErrorDocument 403 /errors/forbid.html | |
ErrorDocument 404 /errors/notfound.html | |
ErrorDocument 500 /errors/serverr.html |
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
# display no errors to user | |
php_flag display_startup_errors off | |
php_flag display_errors off | |
php_flag html_errors off | |
# log to file | |
php_flag log_errors on | |
php_value error_log /location/to/php_error.log |
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 commentCount() { | |
global $wpdb; | |
$count = $wpdb->get_var('SELECT COUNT(comment_ID) FROM ' . $wpdb->comments. ' WHERE comment_author_email = "' . get_comment_author_email() . '"'); | |
return $count . ' comments'; | |
} | |
/* USAGE */ | |
/* | |
<?php echo commentCount(); ?> | |
*/ |
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 maintenance_mode() { | |
if ( !current_user_can( 'edit_themes' ) || !is_user_logged_in() ) { | |
wp_die('Maintenance, please come back soon.'); | |
} | |
} | |
add_action('get_header', 'maintenance_mode'); | |
?> |
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 enable_more_buttons($buttons) { | |
$buttons[] = 'copy,cut,paste'; | |
return $buttons; | |
} | |
add_filter("mce_buttons_2", "enable_more_buttons"); | |
?> |
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 mytheme_admin_bar_render() { | |
global $wp_admin_bar; | |
$wp_admin_bar->add_menu( array( | |
'parent' => 'new-content', // use 'false' for a root menu, or pass the ID of the parent menu | |
'id' => 'new_media', // link ID, defaults to a sanitized title value | |
'title' => __('Media'), // link title | |
'href' => admin_url( 'media-new.php'), // name of file | |
'meta' => false // array of any of the following options: array( 'html' => '', 'class' => '', 'onclick' => '', target => '', title => '' ); | |
)); |
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 fb_add_admin_bar_trash_menu() { | |
global $wp_admin_bar; | |
if ( !is_super_admin() || !is_admin_bar_showing() ) | |
return; | |
$current_object = get_queried_object(); | |
if ( empty($current_object) ) | |
return; | |
if ( !empty( $current_object->post_type ) && | |
( $post_type_object = get_post_type_object( $current_object->post_type ) ) && |
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 if(current_user_can('administrator')){ ?> | |
<a href="<?php bloginfo('url');?>/wp-admin/edit.php?p=< ?php the_ID(); ?>">Edit Post</a> | |
<?php } ?> | |
} |
OlderNewer