在我的WP插件,我需要调用它的一些功能在不同的文件中, /wp-content/plugins/wolf-jplayer/includes/jplayer-show.php
具有public function head_script($id, $playlist_id, $songs, $in_popup, $autoplay = false) {
,我需要在/wp-content/themes/twentlytwelve/index.php
调用,然后删除函数从它原来的地方,因为它的然后在Index.php中。那可能吗?我尝试了一切,没有任何工作。在另一个文件WP PHP调用函数
@Niels我的用法:在WP-内容使用/主题/ twentytwelve/header.php文件
<?php
$Wolf_Jplayer_Show = new Wolf_Jplayer_Shows;
$Wolf_Jplayer_Show->head_script($id, $playlist_id, $songs, $in_popup, $autoplay = false);
?>
功能位于的wp-content /插件/狼jplayer /包括/ jplayer出现。 php
任何人,请吗?这是urgnet! – user3413809 2015-02-11 06:53:33
如何将所需功能定义为全局并在index.php中进行访问 – 2015-02-11 07:08:27
我是一名PHP新手,对它很熟悉。我不知道该怎么做,明确了我为什么要问这里。你能为我提供代码吗? – user3413809 2015-02-11 07:23:42