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.

LLMS_SendWP::install()

Install / Activate SendWP plugin.


Description Description


Return Return

(WP_Error|true)


Top ↑

Source Source

File: includes/admin/class-llms-sendwp.php

	 *
	 * @since 3.36.1
	 * @since 3.37.0 Add nonce and replace references to `$` with `jQuery`.
	 * @since 3.40.0 Refactored to utilize `window.llms.emailConnectors`.
	 *
	 * @return void
	 */
	public function output_js() {

		if ( ! $this->should_output_inline() ) {
			return;
		}

		?>
		<script>
			jQuery( '#llms-sendwp-connect' ).on( 'click', function( e ) {

				e.preventDefault();

				LLMS.Spinner.start( jQuery( this ), 'small' );

				var data = {
					action: 'llms_sendwp_remote_install',
					_llms_sendwp_nonce: '<?php echo wp_create_nonce( 'llms-sendwp-install' ); ?>',
				};

				window.llms.emailConnectors.remoteInstall( jQuery( this ), data, function( res ) {

					window.llms.emailConnectors.registerClient( res.register_url, {
						client_name: res.client_name,
						client_secret: res.client_secret,
						client_redirect: res.client_redirect,
						partner_id: res.partner_id,
					} );

				} );

			} );
		</script>
		<?php

	}

}

return new LLMS_SendWP();

Top ↑

Changelog Changelog

Changelog
Version Description
3.36.1 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.