Skip to content

fix: update author actions shortcode to display on all pages#2999

Merged
RachidBray merged 1 commit intoAyeCode:masterfrom
RachidBray:fix/archive-item-block-author-actions-visibility
Mar 5, 2026
Merged

fix: update author actions shortcode to display on all pages#2999
RachidBray merged 1 commit intoAyeCode:masterfrom
RachidBray:fix/archive-item-block-author-actions-visibility

Conversation

@RachidBray
Copy link
Copy Markdown
Contributor

GD > Simple Archive Item: Author action buttons (Edit/Delete) appear in the editor but are hidden on the frontend archive loop.

@RachidBray RachidBray merged commit 1b047f8 into AyeCode:master Mar 5, 2026
1 check was pending
@RachidBray RachidBray deleted the fix/archive-item-block-author-actions-visibility branch March 5, 2026 11:45
@kprajapatii
Copy link
Copy Markdown
Contributor

It does not make sense to show post author actions on all pages, so it was restricted to author page only. The option is still can be modified via hook $content = apply_filters( 'geodir_widget_simple_archive_item_shortcode', $content, $args, $instance, $widget_args, $is_preview );

@RachidBray
Copy link
Copy Markdown
Contributor Author

That makes sense from a general perspective.

The use case I had in mind is specifically for admins, they can't see other users' listings on the author page, so the Edit/Delete buttons are effectively invisible to them when browsing the frontend loop. The fix allows admin actions to appear wherever the card is rendered.

To clarify the behavior: normal users will only see author actions on their own listings, not on all listings. Only admins see author actions on all listings. So there's no risk of exposing actions to the wrong user.

This came from a real client concern, they expected to manage listings directly from the loop cards and couldn't figure out why the buttons weren't showing.

@kprajapatii
Copy link
Copy Markdown
Contributor

kprajapatii commented Mar 5, 2026

I will add option to set 1 / 0 via widget/block setting. Meantime try following PHP code snippet.

`
function gd_snippet_disable_author_page_only( $content, $args, $instance, $widget_args, $is_preview ) {
$content = str_replace( "author_page_only='1'", "author_page_only='0'", $content );

return $content;

}
add_filter( 'geodir_widget_simple_archive_item_shortcode', 'gd_snippet_disable_author_page_only', 10, 5 );
`

Modifing by default will affect all our existing customers.

@RachidBray
Copy link
Copy Markdown
Contributor Author

Thanks for the snippet, I'll use it for the client in the meantime. And glad the widget/block setting is coming, that's the right way to handle it 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants