Skip to content

Fix selected template not showing.#7

Open
vmanthos wants to merge 2 commits into
wp-media:masterfrom
vmanthos:patch-3
Open

Fix selected template not showing.#7
vmanthos wants to merge 2 commits into
wp-media:masterfrom
vmanthos:patch-3

Conversation

@vmanthos
Copy link
Copy Markdown
Contributor

@vmanthos vmanthos commented May 16, 2023

Fixes the issue of the selected template not being displayed in the meta-boxe's form.

@vmanthos vmanthos requested a review from engahmeds3ed June 22, 2023 13:11
Comment thread MetaBox.php
: '<option value="' . $selected . '">' . $selected . '</option>';
/*
$filenames_flipped = array_flip( $filenames);
unset( $filenames_flipped[$selected] );
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commenting this line and the previous echo means that we will duplicate the selected option, correct?
as $remainingTemplates now will have the selected value inside and we echo it already above.

Comment thread MetaBox.php
}
echo ( ! $selected )
? '<option value="">' . __( 'Theme default page.') . '</option>'
: '<option value="' . $selected . '">' . $selected . '</option>';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to add the selected helper function here?

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