PHP+WORDPRESS

PHP : unset() function – 曹鹏PHP+WORDPRESS

<?php  
$xyz='caopeng.com';  
echo 'Before using unset() the value of $xys is : '. $xyz.'<br>';  
unset($xyz);  
echo 'After using unset() the value of $xys is : '. $xyz;  
?> 


<?php
function caopeng_remove_dashboard_widgets() {
  global $wp_meta_boxes;
  unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
  unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
  unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
  unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
  unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
  unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
  unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
  unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']);

}
add_action('wp_dashboard_setup', 'caopeng_remove_dashboard_widgets' );
?>

Leave a Reply

学习的梦想

锤炼的彩色