Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have an install set up along the lines of this tutorial, whereby my core files (wp-admin, wp-includes) are separate from the content folder:

/wp/wp-includes/
/wp/wp-admin/
/wp/wp-load.php etc
/custom-content/plugins/
/custom-content/themes/
/custom-content/uploads/

So far everything is working great; the core and plugins are loaded via svn:externals and working fine. The only issue I've stumbled on is trying to run a simple function to streamline the admin area for the client. Currently I'm trying the following, which has worked on regular installs (with the wp-content folder in the same directory as the other folders):

add_action( 'admin_init', 'remove_menu_pages' );

function remove_menu_pages() {

global $current_user;
    $current_user = wp_get_current_user();
    $current_user_id = $current_user->ID; // get the user ID

    if ($current_user_id != '1') { // End client will have user id of 2

    // Remove the "Tools" menu
        remove_menu_page('tools.php');

    }
}

This has worked fine in the past, but doesn't seem to work in the new setup. As far as I can tell, I'm having trouble hooking into admin'_init; I've also tried enqueuing a stylesheet for the admin area without any luck. Am I missing something obvious?

share|improve this question

closed as too localized by brasofilo, s_ha_dum, toscho Apr 12 '13 at 2:55

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
As far as you can tell? Can you confirm whether or not the action is firing? Just putting a die('action fired'); inside remove_menu_pages should be all it takes. –  vancoder Apr 11 '13 at 17:45
1  
Thanks to @vancoder's suggestion, I managed to track down the issue. As per Sod's law it was a improperly closed function further up the functions file. Problem solved! –  Dre Apr 11 '13 at 18:10

Browse other questions tagged or ask your own question.