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
// Use your own external URL logo link. | |
function wpc_url_login(){ | |
return "http://erikyang.info/"; // your URL here | |
} | |
add_filter('login_headerurl','wpc_url_login'); |
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
// remove admin bar at front end | |
add_filter('show_admin_bar', '__return_false'); |
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
// Add a widget in WordPress Dashboard | |
function wpc_dashboard_widget_function(){ | |
// Entering the text between the quotes | |
echo "<ul> | |
<li>Release Date: March 2012</li> | |
<li>Author: Aurelien Denis.</li> | |
<li>Hosting provider: my own server</li> | |
</ul>"; | |
} |
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
//HIDING UNWANTED WORDPRESS DASHBOARD WIDGETS | |
add_action('wp_dashboard_setup', 'wpc_dashboard_widgets'); | |
function wpc_dashboard_widgets() { | |
global $wp_meta_boxes; | |
// Today widget | |
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']); | |
// Last comments | |
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']); |
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
// add custom role & capability | |
add_action('admin_init', 'add_custom_role'); | |
function add_custom_role() | |
{ | |
$marketing = add_role('marketing', | |
'Marketing', | |
array( | |
'read' => true, | |
'manage_links', |
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
/* | |
add custom admin setting tag & content; | |
http://codex.wordpress.org/Administration_Menus | |
*/ | |
/** Step 2 (from text above). */ | |
add_action( 'admin_menu', 'my_plugin_menu' ); | |
/** Step 1. */ | |
function my_plugin_menu() { | |
add_options_page( 'My Plugin Options', 'My Plugin', 'manage_options', 'my-unique-identifier', 'my_plugin_options' ); |
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
/* | |
add custom admin page; | |
http://codex.wordpress.org/Function_Reference/add_menu_page | |
*/ | |
add_action( 'admin_menu', 'register_my_custom_menu_page' ); | |
function register_my_custom_menu_page(){ | |
/* | |
args: | |
$page_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
/** | |
add custome meta box. | |
* Calls the class on the post edit screen | |
*/ | |
function call_someClass() | |
{ | |
return new someClass(); | |
} | |
if ( is_admin() ) | |
add_action( 'load-post.php', 'call_someClass' ); |
OlderNewer