Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

Noptin_Form::update( $status = false )

Updates the form in the db


Return Return

(mixed) True on success. WP_Error on failure


Top ↑

Source Source

File: includes/class-noptin-form.php

	private function update( $status = false ) {

		// Prepare the args...
		$args = $this->get_post_array();

		if ( ! empty( $status ) ) {
			$args['post_status'] = $status;
		}

		// ... then update the form.
		$id = wp_update_post( $args, true );

		// If an error occured, return it.
		if ( is_wp_error( $id ) ) {
			return $id;
		}

		$state = $this->data;
		unset( $state['optinHTML'] );
		unset( $state['optinType'] );
		unset( $state['id'] );
		update_post_meta( $id, '_noptin_state', $this->data );
		update_post_meta( $id, '_noptin_optin_type', $this->optinType );
		return true;
	}


Top ↑

Changelog Changelog

Changelog
VersionDescription
1.0.5Introduced.

Top ↑

User Contributed Notes User Contributed Notes

30 day money back guarantee
Safe & Secure online payment
Custom CSS Slide Example
Custom Animation Example
Default Animation