public function save_options() {
		if ( ! filter_input( INPUT_POST, 'submit' ) ) {
			return false;
		}

		if ( ! wp_verify_nonce( filter_input( INPUT_POST, '_wpnonce' ), 'update-permalink' ) ) {
			return false;
		}

		if ( false === strpos( filter_input( INPUT_POST, '_wp_http_referer' ), 'options-permalink.php' ) ) {
			return false;
		}

		$post_types = CPTP_Util::get_post_types();

		foreach ( $post_types as $post_type ) :

			$structure = trim( esc_attr( filter_input( INPUT_POST, $post_type . '_structure' ) ) ); // get setting.

			// default permalink structure.
			if ( ! $structure ) {
				$structure = CPTP_DEFAULT_PERMALINK;
			}

			$structure = str_replace( '//', '/', '/' . $structure );// first "/"
			// last "/".
			$lastString = substr( trim( esc_attr( filter_input( INPUT_POST,'permalink_structure' ) ) ), - 1 );
			$structure  = rtrim( $structure, '/' );

			if ( '/' === $lastString ) {
				$structure = $structure . '/';
			}

			update_option( $post_type . '_structure', $structure );
		endforeach;
		$no_taxonomy_structure = ! filter_input( INPUT_POST, 'no_taxonomy_structure' );
		$add_post_type_for_tax = filter_input( INPUT_POST, 'add_post_type_for_tax' );

		update_option( 'no_taxonomy_structure', $no_taxonomy_structure );
		update_option( 'add_post_type_for_tax', $add_post_type_for_tax );
		update_option( 'cptp_permalink_checked', CPTP_VERSION );
	}