Wishlist_Edit

Summary

No summary available.

Source

File: src/BigCommerce/Templates/Wishlist_Edit.php

class Wishlist_Edit extends Controller {
	const WISHLIST    = 'wishlist';
	const NONCE_FIELD = 'nonce_field';

	protected $wrapper_tag        = 'script';
	protected $wrapper_classes    = [ 'bc-manage-wish-list-wrapper' ];
	protected $wrapper_attributes = [ 'type' => 'text/template' ];

	protected $template = 'components/wishlist/edit-form.php';

	protected function get_wrapper_attributes() {
		$attributes            = parent::get_wrapper_attributes();
		$attributes['data-js'] = 'bc-edit-wish-list-form--' . $this->options[ self::WISHLIST ]->list_id();

		return $attributes;
	}


	protected function parse_options( array $options ) {
		$defaults = [
			self::WISHLIST => null,
		];

		return wp_parse_args( $options, $defaults );
	}

	public function get_data() {
		/** @var Wishlist $wishlist */
		$wishlist = $this->options[ self::WISHLIST ];

		return [
			self::WISHLIST    => $wishlist,
			self::NONCE_FIELD => wp_nonce_field( Edit_Wishlist::ACTION . $wishlist->list_id(), '_wpnonce', true, false ),
		];
	}

}

Methods


User Contributed Notes

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