按钮里面怎么加php代码,如何在单选按钮中集成php代码?

fiddle

对于我在代码库中使用的单选按钮。

开/关

Homepage Tiles

{"toggle_status"}==3){echo

'checked';}?>/>

On

{"toggle_status"}==0){echo

'checked';}?> />

Off

我想知道

如果($data->{“切换状态”}==3)

(表示当切换为

我想集成的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');

?>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值