Created
November 30, 2014 14:30
-
-
Save WillBrubaker/891ef4001c9a32870688 to your computer and use it in GitHub Desktop.
Customize the number of possible answers for questions with options (radio, checkbox, select) in Awesome Surveys survey builder
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 | |
/* | |
Don't copy the opening php tag | |
*/ | |
/* | |
The filter 'wwm_as_admin_script_vars' was added in version 1.6 of Awesome Surveys. | |
This is a sample of it's implementation. If you're comfortable with editing PHP files, use the snippet below. | |
It's usually recommended that these types of snippets be placed in your theme's functions.php file, | |
but I personally don't think that's a good idea since depending on how the theme update works you may | |
lose these custom changes when updating your theme. | |
I like to use [Code Snippets Plugin](https://wordpress.org/plugins/code-snippets/) for this purpose. | |
If you choose to place this snippet in your theme's functions.php file please proceed with **extreme caution**. | |
Make a backup of the file before editing it and ensure that you have access to your site's file system via FTP | |
or your hosting account's cpanel just in case something goes wrong. | |
*/ | |
add_filter( 'wwm_as_admin_script_vars', 'wwm_filter_script_vars', 10, 1 ); | |
function wwm_filter_script_vars( $args ) { | |
$args['num_answers'] = 18; | |
return $args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment