WordPress.org

Forums

[resolved] How can I select all categories when editing posts (8 posts)

  1. Marcelo Pedra
    Member
    Posted 1 year ago #

    Hello guys. I'm having this very same need as a couple years ago somebody shared in these forums: http://wordpress.org/support/topic/admin-select-all-categories?replies=3, and to no avail.

    I have a site with a bunch of parent categories with about 7-20 child categories each, and I need a way to be able to automatically select all the childs when I select its parent. Moreover, a "Select All" categories link would be helpful too. I did a thorough search in the plugin repo and didnt find anything.

    Is there any solution? any plugin? function? filter? someone?

    Help please!

  2. C W
    Member
    Posted 1 year ago #

    EDIT: posted in the wrong thread.

  3. Marcelo Pedra
    Member
    Posted 1 year ago #

    EDIT: keep on topic please.

  4. C W
    Member
    Posted 1 year ago #

    Sorry, I seem to have posted that reply in the wrong thread!

  5. C W
    Member
    Posted 1 year ago #

    Incidentally, try this for a check all option. I just tested it myself and it seems to work well.

  6. Marcelo Pedra
    Member
    Posted 1 year ago #

    It works! Great! Thanks!

  7. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

    Make sure to use:

    get_stylesheet_directory_uri()

    in place of

    get_template_directory_uri()

    When adding this in a Child Theme (which we should be), so:

    The .js is fine, we use this function:

    function init_be_javascripts() {
        if (is_admin()) {
            wp_register_script('extra_be-script', get_stylesheet_directory_uri() . '/js/be-scripts.js', 'jquery', 0.1, true );
            wp_enqueue_script('extra_be-script');
        }
    }
    add_action('init', 'init_be_javascripts');

    In the Child Theme functions.php (tested).

    Of course this selects every category there is...now we just need a tweak to select just the children on currently selected categories :-/

  8. Marcelo Pedra
    Member
    Posted 1 year ago #

    Guys, I just found a solution: one plugin!
    http://wordpress.org/plugins/select-all-terms/
    It does exactly what I wanted to, and it's thoroughly coded.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.