Skip to content

Commit

Permalink
V1.5.9 and 1.5.10
Browse files Browse the repository at this point in the history
  • Loading branch information
gwin committed May 18, 2022
1 parent 517565e commit de5f7eb
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
17 changes: 17 additions & 0 deletions includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -3916,4 +3916,21 @@ function adverts_default_comments_status( $post_type ) {
} else {
return "closed";
}
}

function adverts_get_taxonomy_path( $term, $glue = false ) {

$a = array();
$path = advert_term_path( $term );

foreach( $path as $term_id => $term_name ) {
$link = new Adverts_Html( "a", array( "href" => get_term_link( $term_id ) ), $term_name );
$a[] = $link->render();
}

if( $glue === false ) {
return $a;
}

return implode( $glue, $a );
}
9 changes: 7 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Plugin URI: https://wpadverts.com/
Contributors: gwin
Tags: classifieds, classified, classified ads, classified script, classifieds script, wp classified, wp classifieds
Requires PHP: 5.3
Requires at least: 4.0
Requires PHP: 5.6
Requires at least: 5.7
Tested up to: 5.9
Stable tag: 1.5.9
License: GNU Version 2 or Any Later Version
Expand Down Expand Up @@ -124,8 +124,13 @@ Most likely rewrite rules were not registered properly for some reason. Go to wp

== Changelog ==

= 1.5.10 - 2022-06-20 =

* FEATURE: Category display on Ad details pages (each category in the path is now a link).

= 1.5.9 - 2022-05-18 =

* API: WPAdverts now requires WP 5.7 or newer and PHP 5.6 or newer
* FEATURE: Authors can preview the expired or pending Ad from the [adverts_manage] page.
* FIXED: When deleting Ads from the wp-admin not always all the media library items attached to the Ad were deleted.
* FIXED: Warning when submitting [adverts_add] with skip_preview param
Expand Down
2 changes: 1 addition & 1 deletion templates/single.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
</div>
<div class="adverts-grid-col adverts-col-65">
<?php foreach($advert_category as $c): ?>
<a href="<?php echo esc_attr( get_term_link( $c ) ) ?>"><?php echo join( " / ", advert_category_path( $c ) ) ?></a><br/>
<div><?php echo adverts_get_taxonomy_path( $c, " / " ) ?></div>
<?php endforeach; ?>
</div>
</div>
Expand Down

0 comments on commit de5f7eb

Please sign in to comment.