Skip to content

Commit 6e3402f

Browse files
authored
Merge pull request #840 from kprajapatii/master
Author actions not visible in listings tab when default tab is empty - FIXED
2 parents 1b97468 + 8550320 commit 6e3402f

3 files changed

Lines changed: 25 additions & 11 deletions

File tree

includes/class-profile.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,7 @@ public function get_users_extra( $user ) {
560560
* @return array
561561
*/
562562
public function get_tabs() {
563+
global $uwp_profile_doing_tab, $uwp_profile_first_tab;
563564

564565
// get the settings
565566
global $uwp_profile_tabs_array;
@@ -572,7 +573,12 @@ public function get_tabs() {
572573
// get the tab contents first so we can decide to output the tab head
573574
$tabs_content = array();
574575
foreach ( $tabs as $tab ) {
576+
$uwp_profile_doing_tab = $tab->tab_key;
575577
$tabs_content[ $tab->id . "tab" ] = $this->tab_content( $tab );
578+
579+
if ( ! ( isset( $tab->tab_level ) && $tab->tab_level > 0 ) && empty( $uwp_profile_first_tab ) && ! empty( $tabs_content[ $tab->id . "tab" ] ) ) {
580+
$uwp_profile_first_tab = $tab->tab_key;
581+
}
576582
}
577583

578584
// setup the array

includes/libraries/class-geodirectory-plugin.php

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,11 +1013,11 @@ class="uwp-profile-tab-sub-ul-count uwp-profile-sub-ul-gd-<?php echo esc_attr($t
10131013
'row_gap_class' => '',
10141014
'card_border_class' => 'border-0',
10151015
'card_shadow_class' => '',
1016-
'layout' => '2',
1016+
'layout' => '3',
10171017
);
10181018

1019-
$template_args = apply_filters('uwp_profile_tab_lists_args', $widget_args);
1020-
$gd_layout_class = geodir_convert_listing_view_class($widget_args['layout']);
1019+
$template_args = apply_filters( 'uwp_profile_tab_lists_args', $widget_args );
1020+
$gd_layout_class = geodir_convert_listing_view_class( $template_args['layout'] );
10211021
?>
10221022
<div class="container mb-1">
10231023
<div class="row">
@@ -1027,7 +1027,7 @@ class="uwp-profile-tab-sub-ul-count uwp-profile-sub-ul-gd-<?php echo esc_attr($t
10271027
</div>
10281028
</div>
10291029
<?php do_action('uwp_profile_posts_loop_wrap_start', $args, $found_posts); ?>
1030-
<div class="row row-cols-1 row-cols-sm-2 geodir-category-list-view <?php echo $gd_layout_class; ?>">
1030+
<div class="row row-cols-1 row-cols-sm-2 geodir-category-list-view <?php echo esc_attr( $gd_layout_class ); ?>">
10311031
<?php
10321032
while ($the_query->have_posts()) : $the_query->the_post();
10331033
echo geodir_get_template_html("bootstrap/content-listing.php", array(
@@ -1326,7 +1326,7 @@ public function get_bootstrap_listings( $user, $post_type ) {
13261326
'row_gap_class' => '',
13271327
'card_border_class' => 'border-0',
13281328
'card_shadow_class' => '',
1329-
'layout' => '2',
1329+
'layout' => '3',
13301330
);
13311331

13321332
$template_args = apply_filters( 'uwp_profile_tab_listings_args', $widget_args );
@@ -1789,11 +1789,11 @@ public function get_bootstrap_favorites($user, $post_type)
17891789
'row_gap_class' => '',
17901790
'card_border_class' => 'border-0',
17911791
'card_shadow_class' => '',
1792-
'layout' => '2',
1792+
'layout' => '3',
17931793
);
17941794

1795-
$template_args = apply_filters('uwp_profile_tab_favorites_args', $widget_args);
1796-
$gd_layout_class = geodir_convert_listing_view_class($widget_args['layout']);
1795+
$template_args = apply_filters('uwp_profile_tab_listings_args', $widget_args);
1796+
$gd_layout_class = geodir_convert_listing_view_class( $template_args['layout'] );
17971797
?>
17981798
<div class="container mb-1">
17991799
<div class="row">
@@ -1802,7 +1802,7 @@ public function get_bootstrap_favorites($user, $post_type)
18021802
</div>
18031803
</div>
18041804
</div>
1805-
<div class="row row-cols-1 row-cols-sm-2 geodir-category-list-view <?php echo $gd_layout_class; ?>">
1805+
<div class="row row-cols-1 row-cols-sm-2 geodir-category-list-view <?php echo esc_attr( $gd_layout_class ); ?>">
18061806
<?php
18071807
while ($the_query->have_posts()) : $the_query->the_post();
18081808
echo geodir_get_template_html("bootstrap/content-listing.php", array(
@@ -1948,11 +1948,16 @@ public function geodir_post_status_is_author_page( $value ) {
19481948
* @return bool
19491949
*/
19501950
public function gd_is_listings_tab() {
1951-
global $wp_query, $uwp_profile_tabs_array;
1951+
global $wp_query, $uwp_profile_doing_tab, $uwp_profile_first_tab, $uwp_profile_tabs_array;
19521952

1953-
if ( is_page() && class_exists( 'UsersWP' ) && isset( $wp_query->query_vars['uwp_profile'] ) && ( $profile_page = uwp_get_page_id( 'profile_page', false ) ) ) {
1953+
//if ( is_uwp_profile_page() ) {
1954+
if ( is_page() && isset( $wp_query->query_vars['uwp_profile'] ) && uwp_get_page_id( 'profile_page', false ) ) {
19541955
$active_tab = ! empty( $wp_query->query_vars['uwp_tab'] ) ? $wp_query->query_vars['uwp_tab'] : '';
19551956

1957+
if ( empty( $active_tab ) && empty( $uwp_profile_first_tab ) && $uwp_profile_doing_tab ) {
1958+
$active_tab = $uwp_profile_doing_tab;
1959+
}
1960+
19561961
if ( empty( $active_tab ) && ! empty( $uwp_profile_tabs_array ) && ! empty( $uwp_profile_tabs_array[0]->tab_key ) ) {
19571962
$active_tab = $uwp_profile_tabs_array[0]->tab_key;
19581963
}

readme.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ Yes, you can customize it with Elementor, but also with Gutenberg, Divi, Beaver
150150

151151
== Changelog ==
152152

153+
= 1.2.41 - 2025-08-TBD =
154+
* Author actions not visible in listings tab when default tab is empty - FIXED
155+
153156
= 1.2.40 - 2025-08-14 =
154157
* Assign default role to new user before user inserted - CHANGED
155158

0 commit comments

Comments
 (0)