duanbicheng3345 2010-11-18 17:11
浏览 39

如何在php中为变量分配一个变量用于Wordpress 3.0?

I am using a plugin called Post Snippets, which allows you to define a snippet of HTML and have it appears in the Wordpress post using shortcode [snippet].

It says that I can also pass a variable that will be assigned within the snippet, such as {url}.

I am unclear how to assign the value to the variable url. I have tried to use another plugin called exec-php to execute a php statement:

[exec]url = "domain.com"; [/exec]

But this yields a 'blank' value for {url}.

This is all in php within Wordpress, so only a quasi programming question, but I figured this would have the most knowledgeable people.

  • 写回答

1条回答 默认 最新

  • doudu22272099831 2010-11-18 17:19
    关注

    You define the value of the variable when you insert the snippet into a post. You set them up when you create the snippet, and when you insert the snippet into a post using the snippet widget in the editor toolbar, you should have a chance to fill in the value of the variables.

    Basically the snippet is a template and the variables are fields you can fill in any time you insert the snippet. You should end up assigning them at the time you insert the snippet.

    评论

报告相同问题?

悬赏问题

  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 linux驱动,linux应用,多线程