Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author HelgaTheViking

    (@helgatheviking)

    It would be far more complicated than that. For example, the save routine only ever saves 1 term so any time an author saved a radio button after an admin saved 2 terms, 1 term would be lost.

    I don’t fully understand why you’d want to do this as it seems to violate the whole point of the plugin in my opinion, but I do believe almost everything is possible with WordPress. So if you find you need a hook or a filter to extend RB4T to work the way that you’d like then feel free to send a pull request on Github.

    Thread Starter aaronrobb

    (@aaronrobb)

    Oh i agree it goes against the point of the plugin. ??

    What we need it for is a organization-listing website with a number of authors, which we want to limit to choosing a single category for their organization(as to not click every category to be listed under), but then allow the admins to choose additional categories if needed.

    Plugin Author HelgaTheViking

    (@helgatheviking)

    Well I see your use-case a little more clearly now, but unfortunately still don’t have many suggestions. I can easily throw a filter into the launch() method:

    /**
       * Create a class property for each taxonomy that we are converting to radio buttons, ex: $this->categories
       * @access public
       * @return object
       * @since  1.0
       */
      public function launch(){
    
          $options = apply_filters( 'radio_buttons_for_taxonomies_taxonomies', get_option( 'radio_button_for_taxonomies_options', true ) );
    
          if( isset( $options['taxonomies'] ) ) {
    
            foreach( $options['taxonomies'] as $taxonomy ) {
    
              if ( taxonomy_exists( $taxonomy ) ) {
                $this->{$taxonomy} = new WordPress_Radio_Taxonomy( $taxonomy );
              }
    
            }
    
          }
    
      }

    Which should let you turn the WordPress_Radio_Taxonomy class off for admins, but you’ve still got to do something about the save routine. If you start saving more than 1 term, when the author views the radio buttons, how will the input know which term is selected? If you save with the radio buttons, you risk losing the extra terms.

    You might be better off writing your own custom plugin… feel free to hack out as much of RB4T as you find helpful.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Turn off for Admins?’ is closed to new replies.