我正在尝试创建一个短代码来显示团队之间的得分。我已经做到了这一点,但我似乎无法将变量引入到这该死的事情中。我认为数组用于此,但显然它不是这样工作的。
function get_gamecentre($atts, $content = null) {
extract(shortcode_atts(array(
"HOME-IMG" => \'\',
"AWAY-IMG" => \'\',
"HOME-NAME" => \'\',
"AWAY-NAME" => \'\',
"HOME-POINTS" => \'\',
"AWAY-POINTS" => \'\',
), $atts));
return \'<div style="background-color: #360000;width: 670px; height: 250px; color: white; padding: 10px;">\';
return \'<table style="color: white;" width="100%">\';
return \'<tbody>\';
return \'<tr>\';
return \'<td style="text-align: center;" width="340"><img class="size-full wp-image-32 alignnone aligncenter" title="tribes-pp" src="\'.$HOME-IMG.\'" alt="" width="140" height="140" /></td>\';
return \'<td width="34"></td>\';
return \'<td width="350"><img class="alignnone size-full wp-image-32 aligncenter" src="\'.$AWAY-IMG.\'" alt="" width="140" height="140" /></a></td>\';
return \'</tr>\';
return \'<tr>\';
return \'<td style="text-align: center;">[box color=red]\'.$HOME-NAME.\'[/box]</td>\';
return \'<td style="text-align: center;">VS</td>\';
return \'<td style="text-align: center;">[box color=red]\'.$AWAY-NAME.\'[/box]</td>\';
return \'</tr>\';
return \'<tr>\';
return \'<td style="text-align: center;">[box color=green]\'.$HOME-POINTS.\'[/box]</td>\';
return \'<td style="text-align: center;">VS</td>\';
return \'<td style="text-align: center;">[box color=red]\'.$AWAY-POINTS.\'[/box]</td>\';
return \'</tr>\';
return \'</tbody>\';
return \'</table>\';
}
add_shortcode("gamecentre", "get_gamecentre");