Forum Replies Created
-
AuthorPosts
-
Steven Zahm
Keymaster@ Omar Brenes
re: so we would have to delete them in each individual entry?
Yes, unfortunately so.
That said, there might be an alternative, try this…
Install the Code Snippets plugin.
Add a new snippet with the following code:
add_filter( 'cn_entry_output_meta_key', 'cn_skip_empty_entry_meta_value', 10, 4 ); function cn_skip_empty_entry_meta_value( $html, $atts, $key, $value ) { if ( 0 < strlen( $value ) ) return ''; return $html; }Save and Activate the snippet.
This is untested, but if it works, it should “skip” rendering any meta keys where the value is empty.
Hope this helps, let me know.
Steven Zahm
Keymaster@ John
You can drop a file named
search.phpinto any of these folders:- ../wp-content/theme/{child-theme}/connections-templates/{slug}/
- ../wp-content/theme/{parent-theme}/connections-templates/{slug}/
- ../wp-content/connections-templates/{slug}/
- ../wp-content/plugins/template-folder/
The
{slug}would be the template’s slug. For example,excerpt-plus.Which folder really depends, but I suggest the last location in the list above.
Hope that helps!, let me know.
ps. More details can be found in this QuickTip on custom template override files.
Steven Zahm
Keymaster@ ottomek
**re: Is it an option to not use the GF User Registration add-on? And not let the person using form create a WP user? **
Yes, if you wish to create a user manually, you do not need to use the GF User Registration add-on. The entry will still be created in the directory.
Steven Zahm
Keymaster@ ottomek
Hmmm… there is actually no way to do this presently. If you change the code snippet to this:
// Register the metabox and field. add_action( 'cn_metabox', 'cn_register_custom_metabox_and_date_field' ); function cn_register_custom_metabox_and_date_field() { $atts = array( 'title' => 'Expiration Date', // Change this to a name which applies to your project. 'id' => 'expiration_date_metabox', // Change this so it is unique to you project. 'context' => 'normal', 'priority' => 'core', 'fields' => array( array( 'name' => 'Date', // Change this field name to something which applies to you project. 'show_label' => TRUE, // Whether or not to display the 'name'. Changing it to false will suppress the name. 'id' => 'expiration_date', // Change this so it is unique to you project. Each field id MUST be unique. 'type' => 'datepicker', // This is the field type being added. 'readonly' => is_admin() && ! current_user_can( 'manage_options' ) ? TRUE : FALSE ), ), ); cnMetaboxAPI::add( $atts ); }And make these changes to Connections
../includes/class.metabox-api.phpfile, it will work the way you want. I’ve already made the change and it’ll included in the next update.Hope that helps!
Steven Zahm
Keymaster@ Omar Brenes
For those… you need to edit the entry and remove those custom fields name values and then save the updated entry. If you have nothing to enter for the custom field values, you should add them to the entry. The reason those are being displayed is because the names have been entered and therefore they are not “empty”
Hope that helps!
Steven Zahm
Keymaster@ Heath
I have not heard back so I thought I’d check in… Did you have a chance to verify if the search results are more to your liking?
Steven 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!
Steven Zahm
Keymaster@ John
Great to hear it is working for you! Sorry about not getting that syntax correct! The meta_query support is not a feature even I use that often but is soooo very handy when you need it.
If you have a moment, I would truly appreciate a review as they really do make a difference. Many thanks in advance!
https://wordpress.org/support/view/plugin-reviews/connections
Steven Zahm
Keymaster@ ottomek
re: I have several more fieldsets that the client wants removed but I don’t think cn_remove_metaboxes snippet you gave me is going to work. What kind of snippet do I add to remove these completely from the Member Entry/Directory edit area?
Correct using the cn_remove_metaboxes snippet will not work in this case. What you have to do is hide those fields using CSS.
Steven Zahm
Keymaster@ Raymond
re: Let me know how I can help with adding the district field!
Sure thing! I expect to have the fields added sometime this week yet.
-
AuthorPosts
