Noptin_Sidebar::widget( string $args, string $instance )

Outputs the opt in form widget on the front end


Parameters Parameters

$args

(string) (Required) The widget args to use.

$instance

(string) (Required) The instance args to use.


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/class-noptin-sidebar.php

	public function widget( $args, $instance ) {

		// Abort early if there is no form...
		if ( empty( $instance['form'] ) ) {
			return;
		}

		// ...or the form cannot be displayed on this page.
		$form = noptin_get_optin_form( trim( $instance['form'] ) );

		if ( 'sidebar' !== $form->optinType || ! $form->can_show() ) {
			return;
		}

		// Display the widget.
		echo $args['before_widget'];
		echo $form->get_html();
		echo $args['after_widget'];
	}


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