我对编码很新。因此,寻求帮助只有复选框'检查''无法找到字符'回声。我怀疑它有一些if / else类型的声明,但经过几次试验和错误后,我最终检查了所有复选框(这是不正确的)。非常失落......所以我在这里寻求专家的指导。附上我怀疑作为任何专家建议的相关原始行,非常感谢你:
echo '<tr>';
echo '<th valign="top" class="label" scope="row">';
echo '<input type="checkbox" class="chkLink alignleft">';
echo '<span class="alignleft"><label for="cartoon">';
_e('Source URL', 'cartoon');
echo '</label></span>';
echo '<span class="alignright"><abbr class="required" title="required">*</abbr></span>';
echo '</th>';
function cartoon_we_fetch_names_callback() {
$url = CARTOON_EMBED_IMP_UTILITIES::globalRequest('cartoon_we_url');
$html = cartoon_file_get_html($url);
if(!$html) {
echo '<div class="error notice-error notice-alt">Unable to find Character</div>';
wp_die();
}
$names = $html->find('#names > ul', 0);
if(!$names) {
echo '<div class="error notice-error notice-alt">Unable to find Character</div>';
wp_die();
}
foreach ($names->find('.namesnumber') as $e) {
$e->outertext = '<input type="checkbox">' . $e->outertext;
}
foreach($names->find('a') as $link){
if($link->href) {
$id = split('#', $link->href);
$id = $id[1];
$link->href = 'javascript:void(0);';
$link->outertext = $link->innertext;
$link->dataTarget = $id;
$link->parent()->datatarget = $id;
}
}
答案 0 :(得分:1)
您可以使用checked
属性:
echo '<input type="checkbox" class="chkLink alignleft" checked>';