Support » Fixing WordPress » Default Screen Options

  • WP 2.7 is awesome, I love it! I’ve been able to do some great things with it. I’m hoping to be able to customize the user experience on the admin side a little bit though, so here goes…

    Currently, once users are logged in, they can select their screen options, meaning, they can pick and choose which modules show up for them on a given page. I was wondering if we could have default screen options. For example, I would like to hide the custom fields module, discussion module, and a few other modules on the Add New Post (post-new.php) page.

    I see that there is some information in the database in the usermeta table, which seems to be what I’m after, but how do I have default information here? Is this even where I would look?

    I’ve been pouring through code for a few days now, and if it’s a simple selection in the admin interface for the administrator to set this, I’m gonna be sad…

    Thanks in advance!

Viewing 15 replies - 1 through 15 (of 17 total)
  • Yes, would like the same information if anyone has it…

    Thread Starter rockwell08

    (@rockwell08)

    Nobody has any ideas on how to do this? Disallowing users access to certain modules, and loading defaults for users would be a very powerful way to allow users to only post to a particular category…

    I’ve looked into TDO mini forms, which is an awesome plugin, but I just don’t think it’s robust enough for what I’m trying to do. I would like users to be able to use the media tools available in the post publishing interface that WordPress provides…

    Thanks again!

    This is exactly what I was searching for.

    I don’t use certain parts of the ‘Add New Post’ with my theme, so don’t want to confuse users with a long list of things that they don’t have to fill in.

    If I could just untick the items not to be shown in admin, and make that the default, it would make things so much easier :o)

    Joe

    knuckle34

    (@knuckle34)

    Anyone find a plugin or work around for selecting specific modules for individual or users of one level?

    Anyone working on a plugin?

    Can you change the default screen options and then use WP-CMS Post Control to remove the screen options…it may work.

    drincruz

    (@drincruz)

    hey guys, i’m just reading this thread now.

    our wordpress install needed the same thing; we didn’t want users to use categories, tags, etc. (we have our own custom tagging and such).

    anyhow, if you edit wp-admin/edit-form-advanced.php you can comment out the modules you’d like not to be shown.

    for example, we removed “Tags”, so if you look at line 287 you can comment it out like so:
    //add_meta_box('tagsdiv', __('Tags'), 'post_tags_meta_box', 'post', 'side', 'core');

    /********************
    ********************/

    side note: you can obviously do the same concept and add new meta boxes. our users liked the in-line preview as opposed to opening preview in a new window.

    just add the following somewhere in the file:

    /**
     * Display in-line preview.
     *
     * 2009-03-18
     */
    function post_preview_meta_box($post) {
    ?>
    <label class="hidden" for="preview"><?php _e('Post Preview') ?></label>
    <?php
    $uri_params = array('p' => "$post->ID", 'preview' => "true");
    ?>
    <div id='preview' class='wrap'>
    <h2 id="preview-post"><?php _e('Updated when post is saved'); ?></h2>
    <iframe src="<?php echo clean_url(apply_filters('preview_post_link', add_query_arg($uri_params, get_option('siteurl')))); ?>" width="100%" height="300" ></i
    frame>
    </div>
    <?php
    }
    add_meta_box('preview', __('Post Preview'), 'post_preview_meta_box', 'post', 'normal', 'core');

    good luck. cheers!

    drincruz

    (@drincruz)

    you can also modify the wp_usermeta table to “hide” their metaboxes. (though, of course this isn’t exactly disabling users from unhiding them)

    you can run the following to get a better understanding:

    select * from wp_usermeta where meta_key like '%meta%';

    asechrest

    (@asechrest)

    knuckle34

    (@knuckle34)

    Although these are great plugins. They do not do what is referred to in this thread.

    Being able to remove what is seen as modules in the dashboard (not settings or menus on the left).

    Has anyone tried the coding above to see how it works? A pic would be great.

    drincruz

    (@drincruz)

    actually, i just found a function i can use so that this can be worked out as a plugin.

    so, you can use the remove_meta_box() function to remove those unwanted meta boxes.

    so for example, i still don’t want my users using the ‘tags’. i simply made a new plugin that has the following:

    function unused_meta_boxes() {
    remove_meta_box('tagsdiv','post','side');
    }
    
    add_action('admin_head', 'unused_meta_boxes');

    a lot easier than i thought.

    the add_meta_box is defined as follows:
    add_meta_box($id, $title, $callback, $page, $context = 'advanced', $priority = 'default', $callback_args=null)

    and the remove_meta_box is defined as follows:
    remove_meta_box($id, $page, $context)

    you should still reference the wp-admin/edit-form-advanced.php file if you’re not sure what arguments the remove_meta_box take for whatever you’d like to remove.

    hope this helps! cheers!

    asechrest

    (@asechrest)

    Although these are great plugins. They do not do what is referred to in this thread.

    Being able to remove what is seen as modules in the dashboard (not settings or menus on the left).

    I’m not sure what you mean. Adminimize appears to do exactly what the original poster requests. It “…hide[s] the custom fields module, discussion module, and a few other modules on the Add New Post (post-new.php) page.”

    A combination of Adminimize and Level2Categories also seems to satisfy the third poster’s request by “Disallowing users access to certain modules, and loading defaults for users…” which “…allow[s] users to only post to a particular category…”

    Did you try the plugins?

    asechrest

    (@asechrest)

    so for example, i still don’t want my users using the ‘tags’. i simply made a new plugin that has the following:

    Unless I’m completely misunderstanding what you’re trying to accomplish, doesn’t the plugin Adminimize already do this?

    Adminimize provides a full list of all modules on the Write Post (and others) page, and you can deactive each module for each user role, including the tags module.

    drincruz

    (@drincruz)

    i’ll be honest, i haven’t had time to check out that plugin. though, i guess i’ll have to check it out since you speak so highly of it. 🙂

    i’ll keep you guys posted.

    cheers!

    Thread Starter rockwell08

    (@rockwell08)

    I’ll check out Adminimize, it sounds like it’ll do the trick. I ended up using Flutter to create custom write panels, and hiding what I didn’t want users to see, then hijacking the navigation to hide the post options that I didn’t want users to access in the first place.

    The Post Slug box is essential for our writers, so I would like to have it in the right-hand upper corner for all users. I know I can activate it and move it around for my own account, but apart from the fact that it keeps getting unchecked I see no way to permanently change the box order – next time I activate the Post Slug box it’s way at the bottom of the food chain again.

    Adminimize doesn’t help me unfortunately, as I need to activate something that’s deactivated by default, and not the other way round.

    Adminimize worked great, thanks for the suggestion asechrest.

    I have a user category I created Role Manager, then used Adminimize to edit that role so they couldn’t see categories, slugs, or anything else on the post page, the page page, and the sidebar that I didn’t want them to see. Perfect!

    Along with Bind User to Category, now my users make a post, and it posts where it’s supposed to with no problems.

    Here’s an image of my limited user’s dashboard after using Adminimize:

    http://www.smugmug.com/photos/651519689_Hmrs8-L.gif

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Default Screen Options’ is closed to new replies.