Forum Replies Created
-
AuthorPosts
-
Steven Zahm
Keymaster@ Karen
You could try to use the method described here.
It does require a bit of code but may provide the solution you are looking for.
Let me know.
Steven Zahm
Keymaster@ Michael
Look like I had one type in the code I gave… change this:
echo '<a href="' . $entry->getPermalink() . '>';to this:
echo '<a href="' . $entry->getPermalink() . '">';I m still unsure if this will do it though because there is quite a bit of javascript involved in make Gridder function the way it does. If this change does not work, it might not be easy to make necessary changes to the javascript.
Steven Zahm
Keymaster@ Age
Yes, it is possible. But, I have not worked out the code to do so. I think it would be pretty straightforward…
You would use the
cncsv_map_import_fieldsfilter to add theCertificationsfield mapping choice to the drop down.You would also use the
cncsv_import_fieldsto register the callback to import the Certifications. Much like importing the meta code.The code within the function would be nearly identical to the code in the file
class.cncsv-entry.phpfile in theprocessTerms()method around line518. This file is part of the Connections CSV Import extension.Off the top, the only changes would be changing the taxonomy from
categorytocertificationand theelseifto add the default could be removed since it is not required.Something like this (untested):
add_filter( 'cncsv_map_import_fields', 'cncsv_import_certifications_field_option' ); function cncsv_import_certifications_field_option( $fields ) { $fields['certifications'] = 'Certifications'; return $fields; } add_action( 'cncsv_import_fields', 'cncsv_import_certification_field_import', 10, 3 ); function cncsv_import_certification_field_import( $id, $row, $entry ) { $termIDs = array(); $parsed = $entry->arrayPull( $row, 'certification', $termIDs ); if ( ! empty( $parsed ) ) { /* * Convert the supplied certifications to an array and sanitize. * Apply the same filters added to the core WP default filters for `pre_term_name` so the certification name * will return a match if it exists. */ $certifications = explode( ',', $parsed ); $certifications = array_map( 'sanitize_text_field', $certifications ); $certifications = array_map( 'wp_filter_kses', $certifications ); $certifications = array_map( '_wp_specialchars', $certifications ); foreach ( $certifications as $certification ) { // Query the db for the term to be added. $term = cnTerm::getBy( 'name', $certification, 'certification' ); if ( $term instanceof cnTerm_Object ) { $termIDs[] = $term->term_id; } else { // Add the new certification. $insert_result = cnTerm::insert( $certification, 'certification', array( 'slug' => '', 'parent' => '0', 'description' => '' ) ); if ( ! is_wp_error( $insert_result ) ) { $termIDs[] = $insert_result['term_id']; } } } } // Do not set certification relationships if $termIDs is empty because if updating, it will delete existing relationships. if ( ! empty( $termIDs ) ) Connections_Directory()->term->setTermRelationships( $id, $termIDs, 'certification' ); }-
This reply was modified 8 years, 1 month ago by
Steven Zahm. Reason: Code corrections
Steven Zahm
Keymaster@ Age
Sorry, no, this is not possible. For a couple reasons…
One, is Connections is actually older than the ability to access the WP Media Library. Two, many users (of private directories) have databases that contain thousands of entries. Having that many photos/logos in the Media library will negatively affect WP performance (meaning, slow it down) and make the Media Library nearly unable due to the large amount of images. So for performance reasons this ended up being a good thing.
Steven Zahm
Keymaster@ Age
Thanks! I’ve added to the plugin so it’ll be in future updates.
Steven Zahm
Keymaster@ Jess
Does the city code snippet work as expected? Meaning, is a new field present when you add/edit an entry? If it is present, is the city saved correctly?
What is the exact path of your override
card.phpfile?Steven Zahm
Keymaster@ giri
You had posted the login publically. I made the post private but it does appear you noticed this and changed the login, which is good. If you wish to share an admin account so I can take a look, please create the account with this plugin:
https://wordpress.org/plugins/temporary-login-without-password/
Reply back, as a private reply, with the temp login link.
Steven Zahm
Keymaster@ Michael
Well, this is untested… but the code would be something like this.
Replace this:
<?php $entry->getImage( array( 'image' => $atts['image'], 'height' => $atts['image_height'], 'width' => $atts['image_width'], 'fallback' => array( 'type' => 'block', 'string' => '' ), 'style' => $atts['image_opacity'] ? array( 'opacity' => $atts['image_opacity'], 'filter' => 'alpha(opacity=' . $atts['image_opacity'] * 100 . ')' ) : array(), ) ); ?>with this:
<?php echo '<a href="' . $entry->getPermalink() . '>'; $entry->getImage( array( 'image' => $atts['image'], 'height' => $atts['image_height'], 'width' => $atts['image_width'], 'fallback' => array( 'type' => 'block', 'string' => '' ), 'style' => $atts['image_opacity'] ? array( 'opacity' => $atts['image_opacity'], 'filter' => 'alpha(opacity=' . $atts['image_opacity'] * 100 . ')' ) : array(), ) ); echo '</a>'; ?>Steven Zahm
Keymaster@ Age
Ok, I made the change. Let me know how it goes!
Steven Zahm
Keymaster@ Age
I took a look in the code… I was almost right use this as the meua key
"66.9123". Notice I added quotes around the number. -
This reply was modified 8 years, 1 month ago by
-
AuthorPosts
