Need extra feature on Job Tags add-on
-
Hi,
I am a programmer using your plugins. Great job!
I am also using WPML to translate my web site, but I am not using WPML to translate my job listings/types/tags. Therefore, I have an English and French versions of the site, that are looking at the same non-translated listings.
However, I am translating job tags using a filter on the tag-cloud function and it is working very well.
The problem is this: when a user selects a tag on the job filter cloud, the tag value is selected with jQuery from the HTML content of the item rather than from an attribute, e.g. TAG VALUE rather than TAG NAME. I want to be able to translate the TAG NAME, while keeping the TAG VALUE language independent.
The solution I have would require you guys to add an attribute containing the original tag value, so that the HTML content of the tag element can be modified/translated. Here’s how:
Change the tag cloud:
class-job-manager-job-tags-shortcodes.php:150public function job_manager_get_listings_result( $results ) { ... if ( ! empty( $include_tags ) ) { $atts = array( ... ); $html = wp_tag_cloud( apply_filters( 'job_filter_tag_cloud', $atts ) ); //UPDATE HERE $html = preg_replace( "/<a(.*)href='([^'']*)'(.*)>(.*)<\/a>/", "<a href='#'$1$3 data-tag='$4'>$4</a>", $html ); } $results['tag_filter'] = $html; return $results; }
Change the jQuery:
tag-filter.js:5.on( 'click', '.filter_by_tag a', function() { //UPDATE HERE var tag = $(this).attr('data-tag'); //rather than $(this).html(); ... }
- The topic ‘Need extra feature on Job Tags add-on’ is closed to new replies.