• I love the plugin Theme My Login, but would also like to remove access to wp-admin, and instead use the url’s that Theme My Plugin sets.

    I have tried a few plugins to change the wp-admin access but they stop Theme My Plugin doing it’s thing…

    Any ideas?

Viewing 1 replies (of 1 total)
  • Not the plugin author, but just wanted to say that this is not really plugin-specific, so you’ll have to do it yourself. Here’s some untested code as an example:

    <?php
    /**
     * disable access to WP backend for non-admin users
     */
    add_action('admin_init', 'my_disable_wp_backend');
    function my_disable_wp_backend() {
        if ( ! current_user_can( 'manage_options' ) ) {
            wp_safe_redirect( tml_get_action_url( 'dashboard' ) );
            exit;
        }
    }

    This is checking for the manage_options permission, but you could also check other permissions or the current user’s role, etc.

Viewing 1 replies (of 1 total)
  • The topic ‘Theme My Login – also remove wp-admin access’ is closed to new replies.