fiddle
对于我在代码库中使用的单选按钮。
开/关
<td valign="top">
<fieldset style="background-color:#EDADFF;">
<legend><strong>Homepage Tiles</strong></legend>
<input type="radio" id="toggle-on" value="3" name="toggle_status" <?php if($data->{"toggle_status"}==3){echo
'checked';}?>/>
<label for="toggle-on">On</label>
<input type="radio" id="toggle-off" value="0" name="toggle_status" <?php if($data->{"toggle_status"}==0){echo
'checked';}?> />
<label for="toggle-off">Off</label>
</fieldset>
</td>
我想知道
如果($data->{“切换状态”}==3)
(表示当切换为
在
我想集成的php代码片段
是:
<?php
$special_reports = new \WP_Query( [
'post_type' => 'current-special-report',
'orderby' => 'menu_order',
'order' => 'ASC',
'posts_per_page' => 2,
]);
switch(ICL_LANGUAGE_CODE){
case 'en':
$url = "http://www.current.ca/en/current-in-focus/";
$url_ess = "http://www.current.ca/en/programs/lessentiel-with-esther-begin/";
$url_ptp = "http://www.current.ca/en/programs/primetime-politics/";
$url_out = "http://www.current.ca/en/programs/outburst/";
$url_per = "http://www.current.ca/en/programs/perspective-with-alison-smith/";
$link_view = "View All";
break;
case 'fr':
$url = "http://www.current.ca/fr/dossiers-current/";
$url_ess = "http://www.current.ca/fr/programs/lessentiel-avec-esther-begin/";
$url_ptp = "http://www.current.ca/fr/programs/lheure-politique/";
$url_out = "http://www.current.ca/fr/programs/outburst/";
$url_per = "http://www.current.ca/fr/programs/perspective-avec-alison-smith/";
$link_view = "Toutes";
break;
}
$horizontal_class = ( get_query_var( 'current_in_depth_full', false ) ) ? '-horizontal': '';
// Mon-Thur Essentiel/PTP
// Fri-Sun Persp/Outburst
$arradate = strtolower(date('D'));
date_default_timezone_set('America/Toronto');
$nowtime = date('H:i:s');
$tue_thu = array('tue','wed','thu');
?>