0
$checkbox_field = "<select name='subscribe-reloaded' id='subscribe-reloaded'>
                <option value='none'>".__("Don't subscribe",'subscribe-reloaded')."</option>
                <option value='yes'".((get_option('subscribe_reloaded_checked_by_default', 'no') == 'yes')?" selected='selected'":'').">".__('All','subscribe-reloaded')."</option>
                <option value='replies'>".__('Replies to my comments','subscribe-reloaded')."</option>
                <!-- option value='digest'>".__('Daily digest','subscribe-reloaded')."</option -->
            </select>";

这是我正在使用的一个插件,它默认设置为“全部”,我不太清楚如何将“仅回复我的评论”设置为默认设置。

4

4 回答 4

2

尝试这个:

$checkbox_field = "<select name='subscribe-reloaded' id='subscribe-reloaded'>
                <option value='none'>".__("Don't subscribe",'subscribe-reloaded')."</option>
                <option value='yes'>".__('All','subscribe-reloaded')."</option>
                <option value='replies'".((get_option('subscribe_reloaded_checked_by_default', 'no') == 'replies')?" selected='selected'":'').">".__('Replies to my comments','subscribe-reloaded')."</option>
                <!-- option value='digest'>".__('Daily digest','subscribe-reloaded')."</option -->
            </select>";
于 2012-09-17T12:55:09.213 回答
1
$checkbox_field = "<select name='subscribe-reloaded' id='subscribe-reloaded'> 
            <option value='none'>".__("Don't subscribe",'subscribe-reloaded')."</option> 
            <option value='yes'>".__('All','subscribe-reloaded')."</option> 
            <option value='replies'".((get_option('subscribe_reloaded_checked_by_default', 'no') == 'yes')?" selected='selected'":'').">".__('Replies to my comments','subscribe-reloaded')."</option> 
            <!-- option value='digest'>".__('Daily digest','subscribe-reloaded')."</option --> 
        </select>"; 

只是将选定的逻辑向下移动了一步,假设其他一切都正确并按预期工作

于 2012-09-17T12:57:29.130 回答
0
$checkbox_field = "<select name='subscribe-reloaded' id='subscribe-reloaded'>
            <option value='none'>".__("Don't subscribe",'subscribe-reloaded')."</option>
            <option value='yes'".((get_option('subscribe_reloaded_checked_by_default', 'no') == 'yes')?" selected='selected'":'').">".__('All','subscribe-reloaded')."</option>
            <option value='replies' selected>".__('Replies to my comments','subscribe-reloaded')."</option>
            <!-- option value='digest'>".__('Daily digest','subscribe-reloaded')."</option -->
        </select>";
于 2012-09-17T12:55:52.587 回答
0

只需将您在 ALL 行上的代码放在另一行上...

$checkbox_field = "<select name='subscribe-reloaded' id='subscribe-reloaded'>
                <option value='none'>".__("Don't subscribe",'subscribe-reloaded')."</option>
                <option value='yes'>".__('All','subscribe-reloaded')."</option>
                <option value='replies'".((get_option('subscribe_reloaded_checked_by_default', 'no') == 'yes')?" selected='selected'":'').">".__('Replies to my comments','subscribe-reloaded')."</option>
                <!-- option value='digest'>".__('Daily digest','subscribe-reloaded')."</option -->
            </select>";
于 2012-09-17T12:56:12.197 回答