PluginProbe
YayMail – WooCommerce Email Customizer / 4.4.5
YayMail – WooCommerce Email Customizer v4.4.5
4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 trunk 1.9.6 2.1.4 2.1.5 3.2.2 3.2.6 3.2.7.1 3.2.8.1 3.2.9 3.3 3.3.1 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 3.4 3.4.1 All 57 releases
← All changes | src/Functions.php +13 -20 4.4.3 → 4.4.5 View file →
@@ -68,8 +68,21 @@
68 68 return $plugin_work['yaymail'];
69 69 }
70 70 }
71 71
72 +if ( ! function_exists( 'yaymail_sanitize_template_variant' ) ) {
73 + /**
74 + * Variant slugs are stored as post meta and used as lookup keys, so only [a-z0-9_-] survives.
75 + * Anything else (including null) means the default design.
76 + */
77 + function yaymail_sanitize_template_variant( $variant ) {
78 + if ( ! is_string( $variant ) ) {
79 + return '';
80 + }
81 + return preg_match( '/^[a-z0-9_-]{1,40}$/', $variant ) ? $variant : '';
82 + }
83 +}
84 +
72 85 if ( ! function_exists( 'yaymail_version' ) ) {
73 86 function yaymail_version() {
74 87 if ( defined( 'YAYMAIL_VERSION' ) ) {
75 88 return YAYMAIL_VERSION;
@@ -199,28 +212,8 @@
199 212 * @return BaseElement[]
200 213 */
201 214 function yaymail_get_all_elements() {
202 215 return ElementsLoader::get_instance()->get_all();
203 - }
204 -}
205 -
206 -if ( ! function_exists( 'yaymail_get_email_available_elements' ) ) {
207 -
208 - /**
209 - * Get all available elements of given email
210 - *
211 - * @param string $email_id
212 - *
213 - * @return BaseElement[]
214 - */
215 - function yaymail_get_email_available_elements( $email_id ) {
216 - $find_email = yaymail_get_email( $email_id );
217 -
218 - if ( ! $find_email ) {
219 - return [];
220 - }
221 -
222 - return $find_email->get_elements();
223 216 }
224 217 }
225 218
226 219 if ( ! function_exists( 'yaymail_get_email_elements_data' ) ) {