Forum Replies Created
-
AuthorPosts
-
Steven Zahm
Keymaster@ scott
Oh, I see the change, you made the link basically just a back button via the onclick handler.
Steven Zahm
Keymaster@ scott
Could you share the changes?
Steven Zahm
Keymaster@ Craig
Oh, ok, I understand … I highly recommend the registration vs using the “Custom Fields” metabox. The meta query and importing will work without registration but it is best to register.
Steven Zahm
Keymaster@ scott
Sorry, no. The best option would to be turn off the back link and just let your users uer the back button on the browser. You average web user is more than savvy enough to know to use a back button :)
Hope this helps, let me know.
Steven Zahm
Keymaster@ Craig
RE: I am guessing that I need to do a snippet like I did for my other textbox to be able to import the value from a csv file but I don’t have to register it? … Do I just use these two routines?
Hmmm… you sort of lost me.
You should register all the custom text fields. And if you want to import them, you need to register them with the CSV Import functions like your snippet above does.
When adding multiple fields you do not need to add additional snippets, just update the existing ones to include all the fields.
Here’s an example which registers three fields and imports them:
// Register the metabox and fields. add_action( 'cn_metabox', 'cn_register_custom_metabox_and_text_field' ); function cn_register_custom_metabox_and_text_field() { $atts = array( 'title' => 'Metabox Name', // Change this to a name which applies to your project. 'id' => 'custom_one', // Change this so it is unique to you project. 'context' => 'normal', 'priority' => 'core', 'fields' => array( array( 'name' => 'Field One', // 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' => 'field_one', // Change this so it is unique to you project. Each field id MUST be unique. 'type' => 'text', // This is the field type being added. 'size' => 'regular', // This can be changed to one of the following: 'small', 'regular', 'large' ), array( 'name' => 'Field Two', // 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' => 'field_two', // Change this so it is unique to you project. Each field id MUST be unique. 'type' => 'text', // This is the field type being added. 'size' => 'regular', // This can be changed to one of the following: 'small', 'regular', 'large' ), array( 'name' => 'Field Three', // 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' => 'field_three', // Change this so it is unique to you project. Each field id MUST be unique. 'type' => 'text', // This is the field type being added. 'size' => 'regular', // This can be changed to one of the following: 'small', 'regular', 'large' ), ), ); cnMetaboxAPI::add( $atts ); } // Register the custom fields CSV Import mapping options and processing callback. add_filter( 'cncsv_map_import_fields', 'cncsv_header_name' ); add_action( 'cncsv_import_fields', 'cncsv_process_import', 10, 3 ); function cncsv_header_name( $fields ) { // The field_id should match exactly the field id used when registering the custom field. $fields['field_one'] = 'Field One'; $fields['field_two'] = 'Field Two'; $fields['field_three'] = 'Field Three'; return $fields; } function cncsv_process_import( $id, $row, $entry ) { // The field_id should match exactly the field id used when registering the custom field. $one = $entry->arrayPull( $row, 'field_one', '' ); $one = cnFormatting::maybeJSONdecode( stripslashes( $one ) ); $two = $entry->arrayPull( $row, 'field_two', '' ); $two = cnFormatting::maybeJSONdecode( stripslashes( $two ) ); $three = $entry->arrayPull( $row, 'field_three', '' ); $three = cnFormatting::maybeJSONdecode( stripslashes( $three ) ); cnEntry_Action::meta( 'update', $id, array( array( 'key' => 'field_one', 'value' => $one ), array( 'key' => 'field_two', 'value' => $two ), array( 'key' => 'field_three', 'value' => $three ), ) ); }Steven Zahm
Keymaster@ Craig
RE: so I thought of putting it in an IM set for unlisted
If the var_dump is on the frontend, unlisted will be filtered out of the results.
RE: Should I be using a custom field?
Yep.
RE: how do I access the textbox and checkboxes I added?
why, use the meta query of course (take this as a light hearted tongue in cheek state expression)
Here’s how you would query a custom text field value (I think, off the top of my head.).
$results = Connections_Directory()->retrieve->entries( array( 'meta_query' => array( 'meta_key' => 'custom text field ID', 'meta_value' => 'code number', ), ) );The
meta_keyneeds to exactly the field ID you used to register the custom text field.The
meta_valueshould be your school ID field.A checkbox would be similar, but
meta_valuewould be1for selected and0for not selected (if I remember correctly).Steven Zahm
Keymaster@ Natalie
Connections does not include a cluster map (the big Google Map with the marker cluster which is not presently working).
I would say at minimum you would an the cMap template. I think that would get you mostly of everything else. Check out the demo and a few of the live sites so you know for sure.
Hope this helps, let me know.
Steven Zahm
Keymaster@ Craig
Thanks!
If you have a moment, I would truly appreciate a review as they really do make a difference.
https://wordpress.org/support/plugin/connections/reviews/
Thanks in advance for your time!
Steven Zahm
Keymaster@ Reinhard
ps.
RE: I hope this channel is confidential!
That is why I had instructed to use the plugin to create a temp login. That way user/pass are not saved in my forum. Using the plugin create self expiring links so they are of no value after they expire.
I removed the user/pass from your last post.
Steven Zahm
Keymaster@ Reinhard
The conflict is with the WP File Manager plugin. It appears it might be interesting broken HTML into the WP Editor. Specifically its feature which adds the “Insert File Manager Shortcode” Button.
When this option is disabled in the WP File Manager Settings, the page shows like it should.
The option I disable can be found on the WP File Manager Settings admin page under the General tab at the bottom. The option is called “Enable “Insert File Manager Shortcode” Button with Content Editor ?”
Hope this helps!
-
AuthorPosts
