Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not update on multisite Wordpress #43

Open
dpotuznik opened this issue Feb 27, 2018 · 2 comments
Open

Not update on multisite Wordpress #43

dpotuznik opened this issue Feb 27, 2018 · 2 comments

Comments

@dpotuznik
Copy link

Hi,
thank's for your plugin is really nice,
but i need to change wordpress to a multisite installation,

and now the site1 work, but all the other doesn't save the modification.
if i deactivate your plugin i can update with the plugin activated don't.

thank for your help.
In the meantime a wish you a beautiful day.
Best Regards
Daniel

@helgatheviking
Copy link
Owner

Hi Daniel. Thanks for the report. Unfortunately, I don't have any availability at the moment to look in to this right now. If you want to make an attempt, I am open to a pull request.

@kellenmace
Copy link

@dpotuznik (and anyone else who comes across this issue) –

If you have a WP multisite and want to display some taxonomies as radio buttons, but don't want to go through every site in the network and manually configure the settings on their options pages, you can do something like this:

function use_radio_buttons_for_taxonomies( string $taxonomy ) : void {
    if ( ! class_exists( 'WordPress_Radio_Taxonomy' ) ) {
        return;
    }

    // Add the taxonomies you would like displayed as radio buttons here.
    $taxonomies_to_convert = [ 'project_status', 'employee_status' ];

    $should_convert_this_taxonomy = in_array( $taxonomy, $taxonomies_to_convert, true );

    if ( ! $should_convert_this_taxonomy ) {
        return;
    }

    $rbft_instance = radio_buttons_for_taxonomies();
    $rbft_instance->taxonomies[ $taxonomy ] = new WordPress_Radio_Taxonomy( $taxonomy );
}
add_action( 'registered_taxonomy', 'use_radio_buttons_for_taxonomies' );

With that code in place, you don't have to set anything on any of your sites' options pages. Radio buttons will be displayed for the taxonomies you specify in the $taxonomies_to_convert array across the whole network.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants