Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// Plugin version.
if ( ! defined( 'ATBDP_VERSION' ) ) {
define( 'ATBDP_VERSION', '8.9.3' );
define( 'ATBDP_VERSION', '8.9.4' );
}
// Plugin Folder Path.
if ( ! defined( 'ATBDP_DIR' ) ) {
Expand Down
2 changes: 1 addition & 1 deletion directorist-base.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Directorist - Business Directory Solution
* Plugin URI: https://wpwax.com
* Description: A comprehensive solution to create professional looking directory site of any kind. Like Yelp, Foursquare, etc.
* Version: 8.9.3
* Version: 8.9.4
* Requires PHP: 7.4
* Author: wpWax
* Author URI: https://wpwax.com
Expand Down
20 changes: 16 additions & 4 deletions includes/classes/class-permalink.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,26 @@ public static function get_listing_permalink( $post_id = 0, $permalink = '' ) {
$permalink = get_the_permalink( $post_id );
}

$directory_slug = self::get_listing_directory_type_slug( $post_id );

$permalink = str_replace( '%' . ATBDP_DIRECTORY_TYPE . '%', $directory_slug, $permalink );

return $permalink;
}

/**
* Get the directory type slug for a listing.
*
* @param int $post_id Listing ID.
* @return string
*/
public static function get_listing_directory_type_slug( $post_id = 0 ) {
$directory_slug = '';
$directory_id = directorist_get_listing_directory( $post_id );

if ( $directory_id ) {
$directory_term = get_term( $directory_id, ATBDP_DIRECTORY_TYPE );
$directory_slug = $directory_term ? $directory_term->slug : '';
$directory_slug = ( $directory_term && ! is_wp_error( $directory_term ) ) ? $directory_term->slug : '';
}

if ( empty( $directory_slug ) ) {
Expand All @@ -49,9 +63,7 @@ public static function get_listing_permalink( $post_id = 0, $permalink = '' ) {
}
}

$permalink = str_replace( '%' . ATBDP_DIRECTORY_TYPE . '%', $directory_slug, $permalink );

return $permalink;
return $directory_slug;
}

public static function get_listing_slug() {
Expand Down
4 changes: 3 additions & 1 deletion includes/enums/order/status.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

class Status {
const PENDING = 'pending';
const PREPAID = 'prepaid';
const PAID = 'paid';
const FAILED = 'failed';
const CANCELLED = 'cancelled';
Expand All @@ -16,6 +17,7 @@ class Status {
public static function all() {
return [
self::PENDING,
self::PREPAID,
self::PAID,
self::FAILED,
self::CANCELLED,
Expand All @@ -24,4 +26,4 @@ public static function all() {
self::UNPAID,
];
}
}
}
3 changes: 2 additions & 1 deletion includes/model/SingleListing.php
Original file line number Diff line number Diff line change
Expand Up @@ -1590,12 +1590,13 @@ public function user_avatar() {
$user_pro_pic = get_user_meta( $this->author_id, 'pro_pic', true );
$u_pro_pic = ! empty( $u_pro_pic ) ? wp_get_attachment_image_src( $u_pro_pic, 'thumbnail' ) : '';
$author_data = get_userdata( $this->author_id );
$directory_type = ATBDP_Permalink::get_listing_directory_type_slug( $this->id );

$author_first_name = ! empty( $author_data ) ? $author_data->first_name : '';
$author_last_name = ! empty( $author_data ) ? $author_data->last_name : '';

$args = [
'author_link' => ATBDP_Permalink::get_user_profile_page_link( $this->author_id ),
'author_link' => ATBDP_Permalink::get_user_profile_page_link( $this->author_id, $directory_type ),
'u_pro_pic' => $u_pro_pic,
'avatar_img' => get_avatar( $this->author_id, apply_filters( 'atbdp_avatar_size', 32 ) ),
'author_full_name' => $author_first_name . ' ' . $author_last_name,
Expand Down
1 change: 1 addition & 0 deletions includes/payments/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ function atbdp_get_payment_statuses() {
$statuses = [
'created' => __( "Created", 'directorist' ),
'pending' => __( "Pending", 'directorist' ),
'prepaid' => __( "Prepaid", 'directorist' ),
'completed' => __( "Completed", 'directorist' ),
'failed' => __( "Failed", 'directorist' ),
'cancelled' => __( "Cancelled", 'directorist' ),
Expand Down
3 changes: 2 additions & 1 deletion includes/repositories/order-repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Directorist\Helpers\DateTime;
use Directorist\DTO\Order\DTO;
use Directorist\Enums\Order\Status as OrderStatus;
use Directorist\Enums\Payment\Status as PaymentStatus;
use Directorist\Enums\Order\TaxType as OrderTaxType;
use Directorist\Enums\Order\DiscountType as OrderDiscountType;
use Directorist\DTO\Order\Read;
Expand Down Expand Up @@ -169,7 +170,7 @@ public function update( \Directorist\Utils\DTO $dto ) {

do_action( 'directorist_after_order_update', $this->to_dto( $updated_order ), $old_order );

if ( $dto->is_initialized( 'status' ) ) {
if ( $dto->is_initialized( 'status' ) && in_array( $dto->get_status(), PaymentStatus::all(), true ) ) {
( new PaymentRepository )->update_status_by_order_id( $dto->get_id(), $dto->get_status() );
}

Expand Down
2 changes: 2 additions & 0 deletions includes/rest-api/Version1/class-orders-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ protected function legacy_status_to_current_status( string $status ): string {
$map = array(
'created' => OrderStatus::PENDING,
'pending' => OrderStatus::PENDING,
'prepaid' => OrderStatus::PREPAID,
'completed' => OrderStatus::PAID,
'failed' => OrderStatus::FAILED,
'cancelled' => OrderStatus::CANCELLED,
Expand All @@ -317,6 +318,7 @@ protected function legacy_status_to_current_status( string $status ): string {
protected function current_status_to_legacy_status( string $status ): string {
$map = array(
OrderStatus::PENDING => 'pending',
OrderStatus::PREPAID => 'prepaid',
OrderStatus::PAID => 'completed',
OrderStatus::FAILED => 'failed',
OrderStatus::CANCELLED => 'cancelled',
Expand Down
24 changes: 23 additions & 1 deletion includes/setup/activation.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public static function register_hooks() {
public static function run() {
// Run the activation tasks.
self::create_tables();
self::sync_order_status_enum();
}

public static function create_tables() {
Expand Down Expand Up @@ -77,4 +78,25 @@ public static function create_tables() {
}
);
}
}

private static function sync_order_status_enum() {
global $wpdb;

$table_name = $wpdb->prefix . 'directorist_orders';

if ( $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $table_name ) ) !== $table_name ) {
return;
}

$statuses = array_map(
function( $status ) {
return "'" . esc_sql( $status ) . "'";
},
OrderStatus::all()
);

$wpdb->query(
"ALTER TABLE {$table_name} MODIFY status ENUM(" . implode( ',', $statuses ) . ") NOT NULL DEFAULT '" . esc_sql( OrderStatus::PENDING ) . "'"
);
}
}
10 changes: 9 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: business directory, listings, classifieds, directory plugin, directory
Requires at least: 4.6
Tested up to: 7.0
Requires PHP: 7.0
Stable tag: 8.9.3
Stable tag: 8.9.4
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -300,6 +300,14 @@ Directorist comes with an AI-powered directory builder. Use the Create with AI o

== Changelog ==

= 8.9.4 - Aug 18, 2026 =

**Improved**
- Added prepaid order status support across order management and REST API status mapping. (#2955)

**Fixed**
- Author profile links missing directory type slug in multi-directory listings. (#2957)

= 8.9.3 - Aug 9, 2026 =

**Security**
Expand Down
15 changes: 8 additions & 7 deletions templates/single/section-author_info.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@

if ( ! defined( 'ABSPATH' ) ) exit;

$id = $listing->id;
$author_id = $listing->author_id;
$u_pro_pic = get_user_meta( $author_id, 'pro_pic', true );
$u_pro_pic = ! empty( $u_pro_pic ) ? wp_get_attachment_image_src( $u_pro_pic, 'thumbnail' ) : '';
$author_img = ! empty( $u_pro_pic ) ? $u_pro_pic[0] : '';
$avatar_img = get_avatar( $author_id, 32 );
$id = $listing->id;
$author_id = $listing->author_id;
$directory_type = ATBDP_Permalink::get_listing_directory_type_slug( $id );
$u_pro_pic = get_user_meta( $author_id, 'pro_pic', true );
$u_pro_pic = ! empty( $u_pro_pic ) ? wp_get_attachment_image_src( $u_pro_pic, 'thumbnail' ) : '';
$author_img = ! empty( $u_pro_pic ) ? $u_pro_pic[0] : '';
$avatar_img = get_avatar( $author_id, 32 );
?>

<section class="directorist-card directorist-card-author-info <?php echo esc_attr( $class );?>" <?php $listing->section_id( $id ); ?>>
Expand Down Expand Up @@ -112,7 +113,7 @@

<?php endif; ?>

<a class="directorist-btn directorist-btn-light directorist-btn-md diretorist-view-profile-btn" href="<?php echo esc_url( ATBDP_Permalink::get_user_profile_page_link( $author_id ) ); ?>"><?php esc_html_e( 'View Profile', 'directorist' ); ?></a>
<a class="directorist-btn directorist-btn-light directorist-btn-md diretorist-view-profile-btn" href="<?php echo esc_url( ATBDP_Permalink::get_user_profile_page_link( $author_id, $directory_type ) ); ?>"><?php esc_html_e( 'View Profile', 'directorist' ); ?></a>

</div>
</div>
Expand Down
17 changes: 9 additions & 8 deletions templates/widgets/author-info.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@

<div class="directorist-single-author-info">
<?php
$listing_id = get_the_ID();
$author_id = get_post_field( 'post_author', $listing_id );
$author_name = get_the_author_meta( 'display_name', $author_id );
$listing_id = get_the_ID();
$author_id = get_post_field( 'post_author', $listing_id );
$directory_type = ATBDP_Permalink::get_listing_directory_type_slug( $listing_id );
$author_name = get_the_author_meta( 'display_name', $author_id );
$user_registered = get_the_author_meta( 'user_registered', $author_id );
$u_pro_pic = get_user_meta( $author_id, 'pro_pic', true );
$u_pro_pic = ! empty( $u_pro_pic ) ? wp_get_attachment_image_src( $u_pro_pic, 'thumbnail' ) : '';
$avatar_img = get_avatar( $author_id, apply_filters( 'atbdp_avatar_size', 32 ) );
$u_pro_pic = get_user_meta( $author_id, 'pro_pic', true );
$u_pro_pic = ! empty( $u_pro_pic ) ? wp_get_attachment_image_src( $u_pro_pic, 'thumbnail' ) : '';
$avatar_img = get_avatar( $author_id, apply_filters( 'atbdp_avatar_size', 32 ) );
?>
<div class="directorist-single-author-avatar">
<figure class="directorist-single-author-avatar-inner">
Expand Down Expand Up @@ -124,8 +125,8 @@ class="directorist-single-author-contact-info-text" <?php echo is_directoria_act

<?php endif; ?>

<a href="<?php echo esc_url( ATBDP_Permalink::get_user_profile_page_link( $author_id ) ); ?>"
<a href="<?php echo esc_url( ATBDP_Permalink::get_user_profile_page_link( $author_id, $directory_type ) ); ?>"
class="<?php echo esc_attr( atbdp_directorist_button_classes( 'light' ) ); ?> diretorist-view-profile-btn"><?php esc_html_e( 'View Profile', 'directorist' ); ?>
</a>

</div>
</div>
Loading