Michael Fields
Forum Replies Created
-
Please read this as it might answer some of your questions:
http://ww.wp.xz.cn/support/topic/plugin-taxonomy-list-shortcode-shows-draft-and-private?replies=3
Sometimes this problem can be fixed by the callback function that you define when registering your taxonomy.
Sorry to be so short, but I gotta run and catch a train!
Best wishes,
-MikeThis makes sense – as I don’t recall testing it. I have some updates that will be released for 3.1 as soon as I get a few minutes to retest them on the actual release. This change will not be include there, but will definitely be in the next one. I believe I found a better way to add a link to the media uploader recently an this should fix the search problem as well. Thanks for pointing this out!
-MikeForum: Plugins
In reply to: [Taxonomy Images] [Plugin: Taxonomy Images BETA] Return only the image url?Sparky,
You’re welcome! Please see the code above, it gets the url for the term being queried.
Basically $taxonomy_images_plugin->settings is an array with term_taxonomy_id’s as keys and image->ID’s as values. If you have a term object, you can see if $term->term_taxonomy_id is a key in $taxonomy_images_plugin->settings and if so, pass the value to wp_get_attachment_url() to return a url.
This is a quote from the plugin’s page:
Please note that this plugin only changes the meta box under “Edit”. The “Quick Edit” menu will still use check boxes. I plan on updating this in a future release.
I can’t figure out for the life of me how to hook into this section. A javascript based approach has been suggested in the past, but was really buggy IMHO and resulted in data loss if not extremely careful.
If you come up with a solution here, I would be more than happy to include it in the plugin.
Best wishes,
-MikeThanks for your kind words! Glad the my plugin was useful to you π To answer your question about taxonomy… Basically categories and tags are taxonomies that come pre-installed with WordPress. Version 3.1 will introduce a new taxonomy called post formats. You can also create custom taxonomies if you need to. This plugin will be able to handle all of them.
I included the css switch in case a user wanted to add their own custom css for the plugin. Most people will want to leave it checked.
Best wishes,
-MikeI’m using a custom field search plugin at the moment that creates the pages I need things linked to, but I can’t get it to display a falt unordered list of the values, only a dropdown with a “go” button. That is what I have going on HERE, near the top right. I’d like the exact same functionality, but in list form in the sidebar, instead, and can’t seem to find ANY way to make that happen.
The first thing I would do is dig through the plugin and locate the function(s) that creates the dropdown. Roughly, it should consist of 2 parts: a query and a loop. I would copy the query verbatim and create a loop that produces an unordered list.
I know that you probably do not want to hear this, but if I were you and there wasn’t a painful amount of products on the site. I would totally switch to a custom taxonomy. IMHO it’s the best route to go. It should be possible (though I’ve never used this plugin) to modify the Sitewide Tags plugin to be used for custom taxonomies. I’ve done similar things with other plugins that only worked for built-in categories. It take a bit of time, but is well worth it. You could then define a taxonomy with a fixed set of terms much like what WordPress is doing in 3.1 with post formats. Just a thought.
Hope I was at least a bit of help π
-MikeModifying this plugin may not be the best way to go. It was created specifically for taxonomies and originally forked from the Category Widget. The code you would have to write would be dependent on which custom fields need to be displayed and it’s hard to give advice without know you data structure. What exactly do you need to do?
Forum: Plugins
In reply to: [Plugin: Taxonomy Images BETA] Not compatible with Reveal IDs for WP AdminTry putting this line before the code you posted above:
global $taxonomy_images_plugin;Thanks! I do appreciate the ratings π Glad to hear it works on 3.0.4.
No problem, Glad I could help!
Weird, somehow my plugin is setting a capitalized value for the query var:
?taxonomy=Formatos is not the same as ?taxonomy=formatos
Is it possible that you have formatos capitalized somewhere? I don’t think my plugin would do this for you.
I’ve already rewritten a great deal of this plugin but am waiting to release it until 3.1 is stable.
First thing I would try is to comment out the following lines:
'query_var' => true, 'rewrite' => true,and then refresh your permalinks by visiting Settings -> Permalinks in the Administration Panels. If this does not work, please try the following arguments and then refresh your permalinks again:
'query_var' => 'formatos', 'rewrite' => array( 'slug' => 'formatos' ),BTW, WordPress does not really do this:
/%taxonomy%/%taxonomySlug%/
it does this:
/%taxonomy%/%taxonomy-slug%/
If nothing else works, please post a link to the site in question.
Ani10,
What method have you used to register your taxonomies with WordPress. Please post your code if available.Mbstring is a non-default extension. I had cases where it was missing, even on PHP 5. As far as I know WordPress doesnβt require the extension. There is a fallback for mb_substr() in /wp-includes/compat.php, but mb_strrpos() may be a little bit risky.
That’s really good to know. Thanks for the info.
I wouldnβt append an ellipsis to such a string. More than 20 characters without white space occur mostly in languages like Chinese or Korean where typography follows other rules. You could try to be very cool and look into WPLANG to set the correct ellipsis (and white space). There was an interesting discussion in a Mozilla group on this topic.
But doing nothing is probably better than doing it wrong.Really didn’t know this could be such an involved thing. I think it just might be a good idea to have $append default to a translatable string. I’ll have to dig through core and see if I can figure out language detection… I just downloaded the Japanese version of WordPress and took a peak at /wp-content/languages/ja.po and it uses three periods in all instances of “more…”. Not sure what the best way to handle this is. I definitely want it included for all languages that support it.
Here are my proposed edits to your modifications. I noticed that while using the string you provided:
1ΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆΓΆ
that the ellipses were not appended so this had to be moved outside the conditional.
I also moved a few things around and reduced the number of
returnstatements to 1. Please let me know your thoughts. Thanks again for your contribution!function taxonomy_short_description_shorten( $string, $max_length = 23, $append = '…' ) { $string = strip_tags( $string ); $string = trim( $string ); $string = html_entity_decode( $string, ENT_QUOTES, 'UTF-8' ); $string = rtrim( $string, '-' ); /* Count how many characters are in the string. */ $length = strlen( utf8_decode( $string ) ); /* String is longer than max-length. It needs to be shortened. */ if ( $length > $max_length ) { /* Shorten the string to max-length */ $string = mb_substr( $string, 0, $max_length, 'utf-8' ); /* avoid breaks within words - find the last white space */ $pos = mb_strrpos( $string, ' ', 'utf-8' ); /* No space? One long word or chinese/korean/japanese text. shorten the string to the last space no break space, verbose notation for readability. */ if ( false !== $pos ) { $string = mb_substr( $string, 0, $pos, 'utf-8' ); } /* Append shortened string with the value of $append preceeded by a non-breaking space. */ $string.= "\xC2\xA0" . $append; } return $string; }