WordPress.org

Ready to get started?Download WordPress

Forums

Adding items to "Screen Options" (6 posts)

  1. pluginqueen
    Member
    Posted 5 years ago #

    Hi, I'm a software and website developer, new to WordPress and am only beginning to familiarize myself with the API.

    I'm creating a plugin that adds a column to the user list on the users.php page. I'd like to add a checkbox to the "Screen Options" drop down so the user can choose to hide/show the column. I've tried adding the javascript to footer of the admin page, but it seems the WordPress core is overriding it. Is there some hook or function that allows me to do this?

    Thanks

    Cher

  2. Ptah Dunbar
    Member
    Posted 5 years ago #

  3. pluginqueen
    Member
    Posted 5 years ago #

    Thanks for the link ptadunbar. I found that site earlier in my search, but, I had a difficult time understanding his English and didn't think it was quite what I was looking for. If I'd been working with wordpress longer than a week, maybe it would make more sense.

    Am I to understand that the only way to include a checkbox in the Screen Options is if I create a meta box first? What if I don't want to hide or show a metabox? Ideally, I'd like to execute a js function when the user clicks the checkbox in the Screen Options without being limited to a metabox.

    A dirty solution might be to create dummy metabox and then assign the onclick event to its corresponding checkbox. I guess I could do that, unless you have any other ideas?

    Thanks again,

    Cher

  4. pluginqueen
    Member
    Posted 5 years ago #

    Also: I'm finding a lot of info that says meta_boxes are only available for link, post and pages. I'm wanting to do it for the users.php page. Is there something I'm missing?

    Cher

  5. Ptah Dunbar
    Member
    Posted 5 years ago #

    Well in order for the screen layout columns to work, you have to have metaboxes enabled. As far as changing the screen columns for native admin pages in WP, some of them are already preset to a max of 2 or 1 so changing that requires a bit of hacking.

    That link I posted above works as expected so try editing that one until you achieve your desired effect.

  6. cpatton
    Member
    Posted 5 years ago #

    pluginqueen did you ever complete the plugin you were working on? Id be very interested in trying it out.

Topic Closed

This topic has been closed to new replies.

About this Topic