Created
March 29, 2023 13:25
-
-
Save plugin-republic/114e227d8d47779f688d6e5eb999f399 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Filter exact children validation notice | |
*/ | |
function prefix_exact_children_validation_notice( $notice, $label, $min_products ) { | |
$notice = sprintf( | |
__( '%s requires you to choose %s products', 'pewc' ), | |
esc_html( $label ), | |
$min_products | |
); | |
return $notice; | |
} | |
add_action( 'pewc_filter_exact_children_validation_notice', 'prefix_exact_children_validation_notice', 10, 3 ); | |
/** | |
* Filter min children validation notice | |
*/ | |
function prefix_min_children_validation_notice( $notice, $label, $min_products ) { | |
$notice = sprintf( | |
__( '%s requires you to choose %s products', 'pewc' ), | |
esc_html( $label ), | |
$min_products | |
); | |
return $notice; | |
} | |
add_action( 'pewc_filter_min_children_validation_notice', 'prefix_min_children_validation_notice', 10, 3 ); | |
/** | |
* Filter max children validation notice | |
*/ | |
function prefix_max_children_validation_notice( $notice, $label, $min_products ) { | |
$notice = sprintf( | |
__( '%s requires you to choose %s products', 'pewc' ), | |
esc_html( $label ), | |
$min_products | |
); | |
return $notice; | |
} | |
add_action( 'pewc_filter_max_children_validation_notice', 'prefix_max_children_validation_notice', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment