0

我正在为 Wordpress 编写应用程序缓存插件。
我想知道如何将当前主题中的 <\html> 标签从我的插件修改为:

<\html manifest="Site_url().../plugin/bla.php?var1=foo&var2=bar">

我正在谷歌搜索并在 wordpress 的开发网站上查找东西,但还没有运气。

我感谢任何帮助(:

最好的,米

4

1 回答 1

1

你可以试试language_attributes。这假设他们遵循了 wordpress 主题标准,并且他们的标题包括以下内容:

<!--[if IE 6]>
<html id="ie6" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 7]>
<html id="ie7" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 8]>
<html id="ie8" <?php language_attributes(); ?>>
<![endif]-->
<!--[if !(IE 6) | !(IE 7) | !(IE 8)  ]><!-->
<html <?php language_attributes(); ?>>
<!--<![endif]-->

过滤器示例:

function jrod_add_html_manifest( $output ) {

    $output .= ' manfiest="Site_url().../plugin/bla.php?var1=foo&var2=bar"';

    return $output;
}

add_filter( 'language_attributes', 'jrod_add_html_manifest' );
于 2012-11-13T17:46:31.813 回答