• Good day, thanks for this awesome plugin!

    So far it works great in the admin area but I am using directory plugin from WPMUDEV that has a built in front end editor and when I save a directory listing/custom post type and choose a radio category and save it reverts back to “No Listing Category”

    Wondering if there is something I should be looking for or if you have seen this issue before with other front end editors.

    Any input is much appreciated this is the last major road block in launching my site. I need to restrict each directory listing to one category.

    Thank you!!!

    Ron

    https://wordpress.org/plugins/radio-buttons-for-taxonomies/

Viewing 1 replies (of 1 total)
  • Plugin Author HelgaTheViking

    (@helgatheviking)

    Sorry, I am not familiar with that plugin, nor have I tested rb4t with any front-end editors.

    However, in the WordPress_Radio_Taxonomy is running the following on the save_post action.

    function save_single_term( $post_id ) {
    
    		// verify if this is an auto save routine. If it is our form has not been submitted, so we dont want to do anything
    		if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
    			return $post_id;
    
    		// prevent weirdness with multisite
    		if( function_exists( 'ms_is_switched' ) && ms_is_switched() )
    			return $post_id;
    
    		// make sure we're on a supported post type
    		if ( is_array( $this->tax_obj->object_type ) && isset( $_REQUEST['post_type'] ) && ! in_array ( $_REQUEST['post_type'], $this->tax_obj->object_type ) )
    			return $post_id;
    
    		// verify nonce
    		if ( isset( $_POST["_radio_nonce-{$this->taxonomy}"]) && ! wp_verify_nonce( $_REQUEST["_radio_nonce-{$this->taxonomy}"], "radio_nonce-{$this->taxonomy}" ) )
    			return $post_id;
    
    		// OK, we must be authenticated by now: we need to find and save the data
    		if ( isset( $_REQUEST["radio_tax_input"]["{$this->taxonomy}"] ) ){
    
    			$terms = (array) $_REQUEST["radio_tax_input"]["{$this->taxonomy}"]; 
    
    			// if category and not saving any terms, set to default
    			if ( 'category' == $this->taxonomy && empty ( $terms ) ) {
    				$single_term = intval( get_option( 'default_category' ) );
    			}
    
    			// make sure we're only saving 1 term
    			$single_term = intval( array_shift( $terms ) );
    
    			// set the single terms
    			if ( current_user_can( $this->tax_obj->cap->assign_terms ) )
    				wp_set_object_terms( $post_id, $single_term, $this->taxonomy );
    
    		}		
    
    		return $post_id;
    	}

    It is possible that this is interfering.

Viewing 1 replies (of 1 total)
  • The topic ‘Front end editing not saving category’ is closed to new replies.