Skip to content

Commit

Permalink
Fix current post id
Browse files Browse the repository at this point in the history
  • Loading branch information
ojopaul committed Dec 5, 2023
1 parent 59fbf38 commit 7987547
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/modules/author-boxes/author-boxes.php
Original file line number Diff line number Diff line change
Expand Up @@ -1202,6 +1202,10 @@ public static function get_rendered_author_boxes_editor_preview($args) {
$box_post = get_post($args['post_id']);
$box_post_id = (is_object($box_post) && isset($box_post->ID)) ? $box_post->ID : '1';
$li_style = (empty($args['author_inline_display']['value'])) ? true : false;
$current_post_id = 0;
if (!empty($args['short_code_args']['post']->ID)) {
$current_post_id = $args['short_code_args']['post']->ID;
}

$author_separator = $args['box_tab_layout_author_separator']['value']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped;
$author_counts = count($authors);
Expand Down Expand Up @@ -1230,7 +1234,7 @@ public static function get_rendered_author_boxes_editor_preview($args) {
if (!empty($args['author_categories_group']['value'])) {
$author_categories = \MA_Author_Categories::get_author_categories(['category_status' => 1]);
if (!empty($author_categories)) {
$author_relations = \MA_Author_Categories::get_author_relations(['post_id' => $args['post_id']]);
$author_relations = \MA_Author_Categories::get_author_relations(['post_id' => $current_post_id]);
$admin_preview_arg = $admin_preview || !empty($args['ajax_preview']);
$author_categories_data = Post_Editor::group_category_authors($author_categories, $author_relations, $authors, $admin_preview_arg);
$author_categories_group_option = !empty($args['author_categories_group_option']['value']) ? $args['author_categories_group_option']['value'] : 'inline';
Expand Down
2 changes: 1 addition & 1 deletion src/modules/author-categories/author-categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ public function manageAuthorCategories() {
echo '<span class="subtitle">';
printf(
/* translators: %s: Search query. */
__( 'Search results for: %s' ),
esc_html__( 'Search results for: %s' ),
'<strong>' . esc_html( wp_unslash( $_REQUEST['s'] ) ) . '</strong>'
);
echo '</span>';
Expand Down

0 comments on commit 7987547

Please sign in to comment.