Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter cvongrim

    (@cvongrim)

    Actually when I save a custom post it also seems to wipe all of the customizer fields.

    Thread Starter cvongrim

    (@cvongrim)

    Updating the admin_init() function to this seemed to resolve both issues.

    public function admin_init() {
    		if ( isset( $_POST['_wpnonce'] ) && $_POST['_wpnonce'] ) {
    			if ( isset( $_POST[ $this->options ] ) ) {
    				check_admin_referer( $this->options );
    				$options = $_POST[ $this->options ];
    				update_option( $this->options, $options );
    			} else {
    				//update_option( $this->options, '' );
    			}
    			//wp_safe_redirect( menu_page_url( $this->domain, false ) );
    		}
    	}

    It looks like you where clearing out the options if any other page was saved. Then the other part I commented out seemed to cause any page that saves options to redirect to the plugins page.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Updating a User returns you to the wp api customizer options page’ is closed to new replies.