Merge pull request #20406 from unfulvio/20404-custom-webhook-topic-dropdown-bug

[#20404] Fix custom webhook topic selection in dropdown
This commit is contained in:
Claudiu Lodromanean 2018-06-08 09:43:50 -07:00 committed by GitHub
commit 327401e4ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -85,8 +85,11 @@ if ( ! defined( 'ABSPATH' ) ) {
);
foreach ( $topics as $topic_slug => $topic_name ) :
$selected = $topic_slug === $topic_data['topic'] || $topic_slug === $topic_data['resource'] . '.' . $topic_data['event'];
?>
<option value="<?php echo esc_attr( $topic_slug ); ?>" <?php selected( $topic_data['topic'], $topic_slug, true ); ?>><?php echo esc_html( $topic_name ); ?></option>
<option value="<?php echo esc_attr( $topic_slug ); ?>" <?php selected( $selected, true, true ); ?>><?php echo esc_html( $topic_name ); ?></option>
<?php endforeach; ?>
</select>
</td>