Forked from spivurno/gp-limit-choices-choiceless-message.php
Created
September 5, 2016 04:40
-
-
Save phillipwilhelm/f9b92de4ae9ae11637c4d83f6991b256 to your computer and use it in GitHub Desktop.
Gravity Perks // GP Limit Choices // Customize Choiceless Message
This file contains hidden or 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 | |
| /** | |
| * 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