简体   繁体   English

在Wordpress中用PHP嵌套在另一个简码内的已执行简码

[英]Executed shortcode nested inside another shortcode with PHP in Wordpress

I don't know if I'm anywhere close to getting this to work, but I've been working on it for 3 hours now and though I've made progress, it's not working completely. 我不知道我是否已经接近将其投入使用,但是我已经进行了3个小时的研究,尽管我已经取得了进展,但是它并未完全起作用。 I'm not that versed in PHP, so this has been a battle. 我不是很精通PHP,所以这是一场战斗。 Basically what I'm trying to do is this: 基本上我想做的是这样的:

I'm using the Formidable Pro to capture two numbers from a user about a goal. 我正在使用Formidable Pro从用户那里捕获有关目标的两个数字。 The ID of the beginning number is 104. The ID of the goal in the form is 107. 起始编号的ID为104。表单中目标的ID为107。

Then on a separate page I'm using the http://wordpress.org/extend/plugins/progress-bar/ plugin to measure progress on the goal. 然后在另一个页面上,我使用http://wordpress.org/extend/plugins/progress-bar/插件来衡量目标的进度。

I need to perform calculations on the beginning number and the goal number and have the result inputted into the progress-bar plugin. 我需要对起始数字和目标数字进行计算,并将结果输入到进度条插件中。

I can't even get a number to show up in the progress bar, so I don't know what else to do. 我什至无法在进度栏中显示数字,所以我不知道该怎么办。

This is what I have: 这就是我所拥有的:

[wppb option=red percent=inside progress="<?php echo do_shortcode('[frm-stats id=\"107\"]'); ?>"]

I figured that if I could at least get a number to show up in the progress bar then I could figure out the calculation part of the code... 我认为如果至少可以在进度条上显示一个数字,那么就可以算出代码的计算部分...

Any thoughts? 有什么想法吗?

There is no way to nest shortcodes right now. 目前无法嵌套简码。 Maybe in the future. 或许在将来。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM