Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 自定义WordPress选项功能_Php_Wordpress_Function - Fatal编程技术网

Php 自定义WordPress选项功能

Php 自定义WordPress选项功能,php,wordpress,function,Php,Wordpress,Function,我的职能是什么: $var = get_option('to_twitter_feed'); array( "name" => "Twitter Username", "desc" => "Enter your Twitter username for the Twitter feed", "id" => $shortname."_twitter_feed", "type" => "text", "std" => ""), 在我的

我的职能是什么:

$var = get_option('to_twitter_feed');

array( "name" => "Twitter Username",
    "desc" => "Enter your Twitter username for the Twitter feed",
    "id" => $shortname."_twitter_feed",
    "type" => "text",
    "std" => ""),
在我的WordPress选项中,我有一个自定义的twitter小部件。我希望用户能够简单地在输入中键入自己的名称,并将其插入小部件代码中。这段代码大部分是完整的:基本上,我只需要知道如何将下面第一段代码中调用的内容放入第二段代码。

我如何称呼它:

<?php echo get_option('to_twitter_feed'); ?>

我需要将其放入的代码(其中显示用户名):


jQuery(函数($){
$(“.tweet”).tweet({
用户名:“THEUSERNAME”,
加入文本:“自动”,
头像大小:32,
计数:3,
自动加入文本默认值:“说,”,
自动加入文本:“我们”,
自动加入文本:“我们是”,
自动加入文本回复:“回复”,
自动加入\u文本\u url:“正在签出”,
正在加载文本:“正在加载推文…”
});
});

如果您通过

<?php echo get_option('to_twitter_feed'); ?>

然后

您可以像这样在java脚本中设置twitter用户名

<script type='text/javascript'>
    jQuery(function($){
        $(".tweet").tweet({
            username: "<?php echo get_option('to_twitter_feed'); ?>",
            join_text: "auto",
            avatar_size: 32,
            count: 3,
            auto_join_text_default: "said,", 
            auto_join_text_ed: "we",
            auto_join_text_ing: "we were",
            auto_join_text_reply: "replied to",
            auto_join_text_url: "was checking out",
            loading_text: "loading tweets..."
        });
    });
</script>

jQuery(函数($){
$(“.tweet”).tweet({
用户名:“”,
加入文本:“自动”,
头像大小:32,
计数:3,
自动加入文本默认值:“说,”,
自动加入文本:“我们”,
自动加入文本:“我们是”,
自动加入文本回复:“回复”,
自动加入\u文本\u url:“正在签出”,
正在加载文本:“正在加载推文…”
});
});

如果您通过

<?php echo get_option('to_twitter_feed'); ?>

然后

您可以像这样在java脚本中设置twitter用户名

<script type='text/javascript'>
    jQuery(function($){
        $(".tweet").tweet({
            username: "<?php echo get_option('to_twitter_feed'); ?>",
            join_text: "auto",
            avatar_size: 32,
            count: 3,
            auto_join_text_default: "said,", 
            auto_join_text_ed: "we",
            auto_join_text_ing: "we were",
            auto_join_text_reply: "replied to",
            auto_join_text_url: "was checking out",
            loading_text: "loading tweets..."
        });
    });
</script>

jQuery(函数($){
$(“.tweet”).tweet({
用户名:“”,
加入文本:“自动”,
头像大小:32,
计数:3,
自动加入文本默认值:“说,”,
自动加入文本:“我们”,
自动加入文本:“我们是”,
自动加入文本回复:“回复”,
自动加入\u文本\u url:“正在签出”,
正在加载文本:“正在加载推文…”
});
});

写入print_r($var)时的输出是什么?写入print_r($var)时的输出是什么?