【发布时间】:2016-02-26 16:09:28
【问题描述】:
如何在 JS 文件中获取 post meta
<?php $values = get_post_custom_values("Nalbums"); echo $values[0]; ?>
通过 $post_id 发布元数据
我的 Js 文件
var idurl = get_post_meta($post->ID, 'nalbums', true);
var settings = $.extend({
xmlPath: "http://localhost/wp/wp-content/plugins/myplayer/play.php?cat="+idurl+"",
autoStart: true,
shuffleStart: false,
replayStart: false,
playList: "hide",
blurLevel: 10,
colorRGBA:"168,24,58,0.3"
}, options );
【问题讨论】:
标签: javascript php wordpress meta