-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwishlist-view-header.php
executable file
·70 lines (63 loc) · 2.54 KB
/
wishlist-view-header.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
/**
* Wishlist header
*
* @author YITH
* @package YITH\Wishlist\Templates\Wishlist\View
* @version 3.0.0
*/
/**
* Template variables:
*
* @var $wishlist \YITH_WCWL_Wishlist Current wishlist
* @var $is_custom_list bool Whether current wishlist is custom
* @var $can_user_edit_title bool Whether current user can edit title
* @var $form_action string Action for the wishlist form
* @var $page_title string Page title
* @var $fragment_options array Array of items to use for fragment generation
*/
if ( ! defined( 'YITH_WCWL' ) ) {
exit;
} // Exit if accessed directly
?>
<?php do_action( 'yith_wcwl_before_wishlist_form', $wishlist ); ?>
<form
id="yith-wcwl-form"
action="<?php echo esc_attr( $form_action ); ?>"
method="post"
class="woocommerce yith-wcwl-form wishlist-fragment"
data-fragment-options="<?php echo wc_esc_json( wp_json_encode( $fragment_options ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>"
>
<!-- TITLE -->
<?php
do_action( 'yith_wcwl_before_wishlist_title', $wishlist );
if ( ! empty( $page_title ) ) :
?>
<div class="wishlist-title-container">
<div class="wishlist-title <?php echo ( $can_user_edit_title ) ? 'wishlist-title-with-form' : ''; ?>">
<?php echo wp_kses_post( apply_filters( 'yith_wcwl_wishlist_title', '<h2>' . $page_title . '</h2>' ) ); ?>
<?php if ( $can_user_edit_title ) : ?>
<a class="btn button show-title-form">
<?php echo yith_wcwl_kses_icon( apply_filters( 'yith_wcwl_edit_title_icon', '<i class="fa fa-pencil"></i>' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php esc_html_e( 'Edit title', 'yith-woocommerce-wishlist' ); ?>
</a>
<?php endif; ?>
</div>
<?php if ( $can_user_edit_title ) : ?>
<div class="hidden-title-form">
<input type="text" value="<?php echo esc_attr( $page_title ); ?>" name="wishlist_name"/>
<div class="edit-title-buttons">
<a role="button" href="#" class="hide-title-form">
<?php echo yith_wcwl_kses_icon( apply_filters( 'yith_wcwl_cancel_wishlist_title_icon', '<i class="fa fa-remove"></i>' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</a>
<a role="button" href="#" class="save-title-form">
<?php echo yith_wcwl_kses_icon( apply_filters( 'yith_wcwl_save_wishlist_title_icon', '<i class="fa fa-check"></i>' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</a>
</div>
</div>
<?php endif; ?>
</div>
<?php
endif;
do_action( 'yith_wcwl_before_wishlist', $wishlist );
?>