wordpress javascript回显数字
我的剧本:wordpress javascript回显数字,javascript,php,wordpress,jquery-ui,Javascript,Php,Wordpress,Jquery Ui,我的剧本: <script> $(function() { var availableZtour = [<?php query_posts('category_name=ztour&showposts=5&orderby=date'); if (have_posts()) { while (have_posts()) { the_post(); ?>"<?php the_title(); ?>",<?php }} wp_reset_que
<script>
$(function() {
var availableZtour = [<?php query_posts('category_name=ztour&showposts=5&orderby=date'); if (have_posts()) { while (have_posts()) { the_post(); ?>"<?php the_title(); ?>",<?php }} wp_reset_query(); ?>];
$( "#ztour" ).autocomplete({
source: availableZtour
});
如果我是add–weird hyphen=>script echo–weird hyphen
但是:我是add-normalhyphen=>scriptecho&8211
在文章标题中,我添加了:This-is-post in html source:var availableZtour=[This&8211;is&8211;post,]
怎么做?当我添加-normalhyphen=>scriptecho时-
感谢WordPress内部注册了几个函数来自动处理标题挂钩。其中之一是,它将引号转换为智能引号,并将一些特殊字符转换为各自的HTML实体 在循环之前,您应该能够使用类似于“删除过滤器”“标题”“wptexturize”的方法删除它。否则,您可以直接访问$post->post_title,但您需要自己对其进行消毒