您可以使用get_option
获取选项值。下面是一个示例
<?php
$selected_name = get_post_meta( get_the_ID(), \'your_meta_key\', true );
$options = get_option( \'your_options\' );
// If your names are separeated with comma
$names = explode( PHP_EOL, $options);
?>
<select name="your-select-name">
<?php foreach ( $names as $name ) {
printf(
\'<option value="%s" %s>%s</option>\',
$name,
selected( $name, $selected_name, false ),
$name
);
} ?>
</select>