author | ymh <ymh.work@gmail.com> |
Tue, 15 Dec 2020 13:49:49 +0100 | |
changeset 16 | a86126ab1dd4 |
parent 9 | 177826044cd9 |
child 19 | 3d72ae0968f4 |
permissions | -rw-r--r-- |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1 |
<?php |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3 |
* Customize API: WP_Customize_Theme_Control class |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5 |
* @package WordPress |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6 |
* @subpackage Customize |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7 |
* @since 4.4.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
9 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
10 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
11 |
* Customize Theme Control class. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
12 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
13 |
* @since 4.2.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
14 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
15 |
* @see WP_Customize_Control |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
16 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
17 |
class WP_Customize_Theme_Control extends WP_Customize_Control { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
18 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
19 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
20 |
* Customize control type. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
21 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
22 |
* @since 4.2.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
23 |
* @var string |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
24 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
25 |
public $type = 'theme'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
26 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
27 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
28 |
* Theme object. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
29 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
30 |
* @since 4.2.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
31 |
* @var WP_Theme |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
32 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
33 |
public $theme; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
34 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
35 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
36 |
* Refresh the parameters passed to the JavaScript via JSON. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
37 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
38 |
* @since 4.2.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
39 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
40 |
* @see WP_Customize_Control::to_json() |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
41 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
42 |
public function to_json() { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
43 |
parent::to_json(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
44 |
$this->json['theme'] = $this->theme; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
45 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
46 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
47 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
48 |
* Don't render the control content from PHP, as it's rendered via JS on load. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
49 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
50 |
* @since 4.2.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
51 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
52 |
public function render_content() {} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
53 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
54 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
55 |
* Render a JS template for theme display. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
56 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
57 |
* @since 4.2.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
58 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
59 |
public function content_template() { |
16 | 60 |
/* translators: %s: Theme name. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
61 |
$details_label = sprintf( __( 'Details for theme: %s' ), '{{ data.theme.name }}' ); |
16 | 62 |
/* translators: %s: Theme name. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
63 |
$customize_label = sprintf( __( 'Customize theme: %s' ), '{{ data.theme.name }}' ); |
16 | 64 |
/* translators: %s: Theme name. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
65 |
$preview_label = sprintf( __( 'Live preview theme: %s' ), '{{ data.theme.name }}' ); |
16 | 66 |
/* translators: %s: Theme name. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
67 |
$install_label = sprintf( __( 'Install and preview theme: %s' ), '{{ data.theme.name }}' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
68 |
?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
69 |
<# if ( data.theme.active ) { #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
70 |
<div class="theme active" tabindex="0" aria-describedby="{{ data.section }}-{{ data.theme.id }}-action"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
71 |
<# } else { #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
72 |
<div class="theme" tabindex="0" aria-describedby="{{ data.section }}-{{ data.theme.id }}-action"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
73 |
<# } #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
74 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
75 |
<# if ( data.theme.screenshot && data.theme.screenshot[0] ) { #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
76 |
<div class="theme-screenshot"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
77 |
<img data-src="{{ data.theme.screenshot[0] }}" alt="" /> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
78 |
</div> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
79 |
<# } else { #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
80 |
<div class="theme-screenshot blank"></div> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
81 |
<# } #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
82 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
83 |
<span class="more-details theme-details" id="{{ data.section }}-{{ data.theme.id }}-action" aria-label="<?php echo esc_attr( $details_label ); ?>"><?php _e( 'Theme Details' ); ?></span> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
84 |
|
9 | 85 |
<div class="theme-author"> |
86 |
<?php |
|
16 | 87 |
/* translators: Theme author name. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
88 |
printf( _x( 'By %s', 'theme author' ), '{{ data.theme.author }}' ); |
9 | 89 |
?> |
90 |
</div> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
91 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
92 |
<# if ( 'installed' === data.theme.type && data.theme.hasUpdate ) { #> |
16 | 93 |
<# if ( data.theme.updateResponse.compatibleWP && data.theme.updateResponse.compatiblePHP ) { #> |
94 |
<div class="update-message notice inline notice-warning notice-alt" data-slug="{{ data.theme.id }}"> |
|
95 |
<p> |
|
96 |
<?php |
|
97 |
if ( is_multisite() ) { |
|
98 |
_e( 'New version available.' ); |
|
99 |
} else { |
|
100 |
printf( |
|
101 |
/* translators: %s: "Update now" button. */ |
|
102 |
__( 'New version available. %s' ), |
|
103 |
'<button class="button-link update-theme" type="button">' . __( 'Update now' ) . '</button>' |
|
104 |
); |
|
105 |
} |
|
106 |
?> |
|
107 |
</p> |
|
108 |
</div> |
|
109 |
<# } else { #> |
|
110 |
<div class="update-message notice inline notice-error notice-alt" data-slug="{{ data.theme.id }}"> |
|
111 |
<p> |
|
112 |
<# if ( ! data.theme.updateResponse.compatibleWP && ! data.theme.updateResponse.compatiblePHP ) { #> |
|
113 |
<?php |
|
114 |
printf( |
|
115 |
/* translators: %s: Theme name. */ |
|
116 |
__( 'There is a new version of %s available, but it doesn’t work with your versions of WordPress and PHP.' ), |
|
117 |
'{{{ data.theme.name }}}' |
|
118 |
); |
|
119 |
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { |
|
120 |
printf( |
|
121 |
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ |
|
122 |
' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ), |
|
123 |
self_admin_url( 'update-core.php' ), |
|
124 |
esc_url( wp_get_update_php_url() ) |
|
125 |
); |
|
126 |
wp_update_php_annotation( '</p><p><em>', '</em>' ); |
|
127 |
} elseif ( current_user_can( 'update_core' ) ) { |
|
128 |
printf( |
|
129 |
/* translators: %s: URL to WordPress Updates screen. */ |
|
130 |
' ' . __( '<a href="%s">Please update WordPress</a>.' ), |
|
131 |
self_admin_url( 'update-core.php' ) |
|
132 |
); |
|
133 |
} elseif ( current_user_can( 'update_php' ) ) { |
|
134 |
printf( |
|
135 |
/* translators: %s: URL to Update PHP page. */ |
|
136 |
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ), |
|
137 |
esc_url( wp_get_update_php_url() ) |
|
138 |
); |
|
139 |
wp_update_php_annotation( '</p><p><em>', '</em>' ); |
|
140 |
} |
|
141 |
?> |
|
142 |
<# } else if ( ! data.theme.updateResponse.compatibleWP ) { #> |
|
143 |
<?php |
|
144 |
printf( |
|
145 |
/* translators: %s: Theme name. */ |
|
146 |
__( 'There is a new version of %s available, but it doesn’t work with your version of WordPress.' ), |
|
147 |
'{{{ data.theme.name }}}' |
|
148 |
); |
|
149 |
if ( current_user_can( 'update_core' ) ) { |
|
150 |
printf( |
|
151 |
/* translators: %s: URL to WordPress Updates screen. */ |
|
152 |
' ' . __( '<a href="%s">Please update WordPress</a>.' ), |
|
153 |
self_admin_url( 'update-core.php' ) |
|
154 |
); |
|
155 |
} |
|
156 |
?> |
|
157 |
<# } else if ( ! data.theme.updateResponse.compatiblePHP ) { #> |
|
158 |
<?php |
|
159 |
printf( |
|
160 |
/* translators: %s: Theme name. */ |
|
161 |
__( 'There is a new version of %s available, but it doesn’t work with your version of PHP.' ), |
|
162 |
'{{{ data.theme.name }}}' |
|
163 |
); |
|
164 |
if ( current_user_can( 'update_php' ) ) { |
|
165 |
printf( |
|
166 |
/* translators: %s: URL to Update PHP page. */ |
|
167 |
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ), |
|
168 |
esc_url( wp_get_update_php_url() ) |
|
169 |
); |
|
170 |
wp_update_php_annotation( '</p><p><em>', '</em>' ); |
|
171 |
} |
|
172 |
?> |
|
173 |
<# } #> |
|
174 |
</p> |
|
175 |
</div> |
|
176 |
<# } #> |
|
177 |
<# } #> |
|
178 |
||
179 |
<# if ( ! data.theme.compatibleWP || ! data.theme.compatiblePHP ) { #> |
|
180 |
<div class="notice notice-error notice-alt"><p> |
|
181 |
<# if ( ! data.theme.compatibleWP && ! data.theme.compatiblePHP ) { #> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
182 |
<?php |
16 | 183 |
_e( 'This theme doesn’t work with your versions of WordPress and PHP.' ); |
184 |
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { |
|
185 |
printf( |
|
186 |
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ |
|
187 |
' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ), |
|
188 |
self_admin_url( 'update-core.php' ), |
|
189 |
esc_url( wp_get_update_php_url() ) |
|
190 |
); |
|
191 |
wp_update_php_annotation( '</p><p><em>', '</em>' ); |
|
192 |
} elseif ( current_user_can( 'update_core' ) ) { |
|
9 | 193 |
printf( |
16 | 194 |
/* translators: %s: URL to WordPress Updates screen. */ |
195 |
' ' . __( '<a href="%s">Please update WordPress</a>.' ), |
|
196 |
self_admin_url( 'update-core.php' ) |
|
197 |
); |
|
198 |
} elseif ( current_user_can( 'update_php' ) ) { |
|
199 |
printf( |
|
200 |
/* translators: %s: URL to Update PHP page. */ |
|
201 |
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ), |
|
202 |
esc_url( wp_get_update_php_url() ) |
|
203 |
); |
|
204 |
wp_update_php_annotation( '</p><p><em>', '</em>' ); |
|
205 |
} |
|
206 |
?> |
|
207 |
<# } else if ( ! data.theme.compatibleWP ) { #> |
|
208 |
<?php |
|
209 |
_e( 'This theme doesn’t work with your version of WordPress.' ); |
|
210 |
if ( current_user_can( 'update_core' ) ) { |
|
211 |
printf( |
|
212 |
/* translators: %s: URL to WordPress Updates screen. */ |
|
213 |
' ' . __( '<a href="%s">Please update WordPress</a>.' ), |
|
214 |
self_admin_url( 'update-core.php' ) |
|
9 | 215 |
); |
216 |
} |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
217 |
?> |
16 | 218 |
<# } else if ( ! data.theme.compatiblePHP ) { #> |
219 |
<?php |
|
220 |
_e( 'This theme doesn’t work with your version of PHP.' ); |
|
221 |
if ( current_user_can( 'update_php' ) ) { |
|
222 |
printf( |
|
223 |
/* translators: %s: URL to Update PHP page. */ |
|
224 |
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ), |
|
225 |
esc_url( wp_get_update_php_url() ) |
|
226 |
); |
|
227 |
wp_update_php_annotation( '</p><p><em>', '</em>' ); |
|
228 |
} |
|
229 |
?> |
|
230 |
<# } #> |
|
231 |
</p></div> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
232 |
<# } #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
233 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
234 |
<# if ( data.theme.active ) { #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
235 |
<div class="theme-id-container"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
236 |
<h3 class="theme-name" id="{{ data.section }}-{{ data.theme.id }}-name"> |
16 | 237 |
<span><?php _ex( 'Previewing:', 'theme' ); ?></span> {{ data.theme.name }} |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
238 |
</h3> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
239 |
<div class="theme-actions"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
240 |
<button type="button" class="button button-primary customize-theme" aria-label="<?php echo esc_attr( $customize_label ); ?>"><?php _e( 'Customize' ); ?></button> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
241 |
</div> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
242 |
</div> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
243 |
<div class="notice notice-success notice-alt"><p><?php _ex( 'Installed', 'theme' ); ?></p></div> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
244 |
<# } else if ( 'installed' === data.theme.type ) { #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
245 |
<div class="theme-id-container"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
246 |
<h3 class="theme-name" id="{{ data.section }}-{{ data.theme.id }}-name">{{ data.theme.name }}</h3> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
247 |
<div class="theme-actions"> |
16 | 248 |
<# if ( data.theme.compatibleWP && data.theme.compatiblePHP ) { #> |
249 |
<button type="button" class="button button-primary preview-theme" aria-label="<?php echo esc_attr( $preview_label ); ?>" data-slug="{{ data.theme.id }}"><?php _e( 'Live Preview' ); ?></button> |
|
250 |
<# } else { #> |
|
251 |
<button type="button" class="button button-primary disabled" aria-label="<?php echo esc_attr( $preview_label ); ?>"><?php _e( 'Live Preview' ); ?></button> |
|
252 |
<# } #> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
253 |
</div> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
254 |
</div> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
255 |
<div class="notice notice-success notice-alt"><p><?php _ex( 'Installed', 'theme' ); ?></p></div> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
256 |
<# } else { #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
257 |
<div class="theme-id-container"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
258 |
<h3 class="theme-name" id="{{ data.section }}-{{ data.theme.id }}-name">{{ data.theme.name }}</h3> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
259 |
<div class="theme-actions"> |
16 | 260 |
<# if ( data.theme.compatibleWP && data.theme.compatiblePHP ) { #> |
261 |
<button type="button" class="button button-primary theme-install preview" aria-label="<?php echo esc_attr( $install_label ); ?>" data-slug="{{ data.theme.id }}" data-name="{{ data.theme.name }}"><?php _e( 'Install & Preview' ); ?></button> |
|
262 |
<# } else { #> |
|
263 |
<button type="button" class="button button-primary disabled" aria-label="<?php echo esc_attr( $install_label ); ?>" disabled><?php _e( 'Install & Preview' ); ?></button> |
|
264 |
<# } #> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
265 |
</div> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
266 |
</div> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
267 |
<# } #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
268 |
</div> |
9 | 269 |
<?php |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
270 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
271 |
} |