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.4.2, address, code snippet, type
- This topic has 3 replies, 2 voices, and was last updated 10 years, 11 months ago by
Steven Zahm.
-
AuthorPosts
-
09/08/2015 at 10:59 pm #346048
Javier
ParticipantHello Steven
I just want to show in $ AddressTypes the work type, How Could I do?
My code:
cnHTML::field( array( 'type' => 'select', 'class' => '', 'id' => 'address[' . $token . '][type]', 'options' => $addressTypes, 'required' => FALSE, 'before' => '', 'label' => __( 'Address Type', 'connections' ), 'return' => FALSE, ), $address->typeThank you very much!
09/09/2015 at 9:56 am #346125Steven Zahm
Keymaster@ Javier
re: I just want to show in $ AddressTypes the work type, How Could I do?
I’m sorry, I’m not sure I understand. This code will already show the Work address type.
09/09/2015 at 1:24 pm #346173Javier
ParticipantHello Steven,
I want to select only the work type, and then show on the user profile only type work
if ($ atts ['show_addresses']) $ entry-> getAddressBlock (array ('format' => $ atts ['addr_format'], 'type' => 'work'));As I can put the address input is single type work and in select not show me all types
cnHTML::field( array( 'type' => 'select', 'class' => '', 'id' => 'address[' . $token . '][type]', 'options' => $addressTypes, (ONLY TYPE WORK) 'required' => FALSE, 'before' => '', 'label' => __( 'Address Type', 'connections' ), 'return' => FALSE, ), $address->typeThanks!
09/09/2015 at 4:14 pm #346211Steven Zahm
Keymaster@ Javier
re: I want to select only the work type, and then show on the user profile only type work
Oh, you are in the wrong section of code then. You do not need to edit the Connections PHP files at all to make this change.
Install the Code Snippets plugin.
Add a new snippet with the following code:
function cn_add_remove_types( $options ) { unset( $options['home'] ); unset( $options['school'] ); unset( $options['other'] ); return $options; } add_filter( 'cn_address_options', 'cn_add_remove_types' );Save and activate the snippet.
That’ll do it. Hope that helps!
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.
