Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save phillipwilhelm/f9b92de4ae9ae11637c4d83f6991b256 to your computer and use it in GitHub Desktop.
Save phillipwilhelm/f9b92de4ae9ae11637c4d83f6991b256 to your computer and use it in GitHub Desktop.
Gravity Perks // GP Limit Choices // Customize Choiceless Message
<?php
/**
* Gravity Perks // GP Limit Choices // Customize Choiceless Message
* http://gravitywiz.com/documentation/gp-limit-choices/
*
* This snippet allows you to modify the message that id displayed in place of a field when all of it's choices have been exhausted.
*/
add_filter( 'gplc_choiceless_message', 'my_choiceless_message', 10, 2 );
function my_choiceless_message( $message, $field ) {
if( $field['formId'] == 1 && $field['id'] == 2 ) {
$message = __( 'My custom choiceless message!' );
}
return $message;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment