Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
Tagged: 8.5.17, cn_education_level_options, education level, extension, filter
- This topic has 7 replies, 2 voices, and was last updated 6 years, 7 months ago by
Steven Zahm.
-
AuthorPosts
-
06/20/2016 at 11:41 am #380080
Carolin Collins
ParticipantHi! Can I change the items that are in the dropdown for the Education Level somewhere? They only correspond in part with our local education system and with this being a directory of accountants I would like to be able to add some relevant qualifications. Thanks!
-
This topic was modified 6 years, 7 months ago by
Carolin Collins.
06/20/2016 at 1:09 pm #380092Steven Zahm
Keymaster@ Carolin
You can use the
cn_education_level_options
filter to change the options.Here’s an example:
add_filter( 'cn_education_level_options', 'cn_change_edu_lvl' ) ); function cn_change_edu_lvl( $options ) { unset( $options['1'] ); // Remove 1st - 4th Grade $options['50'] = 'CPA Qualification'; // Add an education option. return $options; }
Here’s the list of the existing options:
'-1' => __( 'Choose...', 'connections_education_levels'), '1' => __( '1st - 4th Grade', 'connections_education_levels'), '5' => __( '5th - 6th Grade', 'connections_education_levels'), '7' => __( '7th - 8th Grade', 'connections_education_levels'), '9' => __( '9th Grade', 'connections_education_levels'), '10' => __( '10th Grade', 'connections_education_levels'), '11' => __( '11th Grade', 'connections_education_levels'), '12' => __( '12th Grade No Diploma', 'connections_education_levels'), '13' => __( 'High School Graduate', 'connections_education_levels'), '15' => __( 'Some College No Degree', 'connections_education_levels'), '20' => __( 'Associate\'s Degree, occupational', 'connections_education_levels'), '25' => __( 'Associate\'s Degree, academic', 'connections_education_levels'), '30' => __( 'Bachelor\'s Degree', 'connections_education_levels'), '35' => __( 'Master\'s Degree', 'connections_education_levels'), '40' => __( 'Professional Degree', 'connections_education_levels'), '45' => __( 'Doctoral Degree', 'connections_education_levels'),
You can unset any of the numbers and when adding a new item, you can use any number which is not being used. Infact you are not limited to numbers, you could make them unique strings.
Hope that helps!
06/20/2016 at 1:14 pm #380093Carolin Collins
ParticipantProbably a dumb questions but where do I do this? I should be fine after that :) Cheers!
06/20/2016 at 1:41 pm #380097Steven Zahm
Keymaster@ Carolin
I highly recommend the Code Snippets plugin. Add a new snippet, copy/paste the example I gave and then save and activate the snippet.
Hope that helps!
06/20/2016 at 2:56 pm #380111Carolin Collins
ParticipantThanks so much for that. So if I want to take out multiple options and add multiple ones, do I just duplicate the lines incl. the semi-colon at the end?
add_filter( ‘cn_education_level_options’, ‘cn_change_edu_lvl’ ) );
function cn_change_edu_lvl( $options ) {
unset( $options['1'] ); // Remove 1st - 4th Grade unset( $options['5'] ); unset( $options['7'] ); $options['50'] = 'CPA Qualification'; // Add an education option. $options['51'] = 'Diploma'; return $options;
}
06/20/2016 at 3:49 pm #380115Steven Zahm
Keymaster@ Carolin
re; So if I want to take out multiple options and add multiple ones, do I just duplicate the lines incl. the semi-colon at the end?
Yep, that is correct.
06/21/2016 at 3:35 am #380130Carolin Collins
ParticipantGreat, thanks so much – that worked perfectly! You have been very helpful.
On another note, is it possible to turn this into a multiple selector rather than a single selector drop-down?
06/22/2016 at 9:40 am #380321Steven Zahm
Keymaster@ Carolin
re: is it possible to turn this into a multiple selector rather than a single selector drop-down?
This, well, is possible but much more difficult because it will be both the widget and content block because both are designed to show the value, not multiple. Perhaps using the Hobbies extension instead would be better since it is designed to show multiple options and values.
You could “swap out” the hobby options with your education options using a filter like so:
add_filter( 'cn_education_level_options', 'cn_change_hobby_to_edu_lvl' ) ); function cn_change_hobby_to_edu_lvl( $options ) { $options = array( 'Education Choice One', 'Education Choice Two', 'Education Choice Three', 'Education Choice Four', 'Education Choice Five', ); return $options; }
Hope that helps!
-
This topic was modified 6 years, 7 months ago by
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.