Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plugin-republic/114e227d8d47779f688d6e5eb999f399 to your computer and use it in GitHub Desktop.
Save plugin-republic/114e227d8d47779f688d6e5eb999f399 to your computer and use it in GitHub Desktop.
<?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