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
// spam & delete links for all versions of wordpress | |
function delete_comment_link($id) { | |
if (current_user_can('edit_post')) { | |
echo '| <a href="'.get_bloginfo('wpurl').'/wp-admin/comment.php?action=cdc&c='.$id.'">del</a> '; | |
echo '| <a href="'.get_bloginfo('wpurl').'/wp-admin/comment.php?action=cdc&dt=spam&c='.$id.'">spam</a>'; | |
} | |
} |
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
// delay feed update | |
function publish_later_on_feed($where) { | |
global $wpdb; | |
if (is_feed()) { | |
// timestamp in WP-format | |
$now = gmdate('Y-m-d H:i:s'); | |
// value for wait; + device | |
$wait = '10'; // integer |
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
// Set the post revisions unless the constant was set in wp-config.php | |
if (!defined('WP_POST_REVISIONS')) define('WP_POST_REVISIONS', 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
// REMOVE META BOXES FROM DEFAULT POSTS SCREEN | |
function remove_default_post_screen_metaboxes() { | |
remove_meta_box( 'postcustom','post','normal' ); // Custom Fields Metabox | |
remove_meta_box( 'postexcerpt','post','normal' ); // Excerpt Metabox | |
remove_meta_box( 'commentstatusdiv','post','normal' ); // Comments Metabox | |
remove_meta_box( 'trackbacksdiv','post','normal' ); // Talkback Metabox | |
remove_meta_box( 'slugdiv','post','normal' ); // Slug Metabox | |
remove_meta_box( 'authordiv','post','normal' ); // Author Metabox | |
} | |
add_action('admin_menu','remove_default_post_screen_metaboxes'); |
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
if ( !defined('SAVEQUERIES') && isset($_GET['debug']) && $_GET['debug'] == 'sql' ) | |
define('SAVEQUERIES', true); | |
if ( !function_exists('dump') ) : | |
/** | |
* dump() | |
* | |
* @param mixed $in | |
* @return mixed $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
// CUSTOMIZE ADMIN MENU ORDER | |
function custom_menu_order($menu_ord) { | |
if (!$menu_ord) return true; | |
return array( | |
'index.php', // this represents the dashboard link | |
'edit.php?post_type=events', // this is a custom post type menu | |
'edit.php?post_type=news', | |
'edit.php?post_type=articles', | |
'edit.php?post_type=faqs', | |
'edit.php?post_type=mentors', |
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 USER PROFILE FIELDS | |
function my_custom_userfields( $contactmethods ) { | |
// ADD CONTACT CUSTOM FIELDS | |
$contactmethods['contact_phone_office'] = 'Office Phone'; | |
$contactmethods['contact_phone_mobile'] = 'Mobile Phone'; | |
$contactmethods['contact_office_fax'] = 'Office Fax'; | |
// ADD ADDRESS CUSTOM FIELDS | |
$contactmethods['address_line_1'] = 'Address Line 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 new_excerpt_length($length) { | |
return 100; | |
} | |
add_filter('excerpt_length', 'new_excerpt_length'); |
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
//remove pings to self | |
function no_self_ping( &$links ) { | |
$home = get_option( 'home' ); | |
foreach ( $links as $l => $link ) | |
if ( 0 === strpos( $link, $home ) ) | |
unset($links[$l]); | |
} | |
add_action( 'pre_ping', 'no_self_ping' ); |
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('wp_dashboard_setup', 'my_custom_dashboard_widgets'); | |
function my_custom_dashboard_widgets() { | |
global $wp_meta_boxes; | |
// Remove these dashboard widgets... | |
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']); | |
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']); | |
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']); |