【发布时间】:2020-02-13 16:18:53
【问题描述】:
我正在使用 WordPress 重力表单和 Dropbox 插件在 Dropbox 上上传文件 我正在尝试使用 PHP 提交表单后检索 Dropbox 链接 正如文档所说,我应该能够在条目对象中找到链接 https://docs.gravityforms.com/gf_field_dropbox/#-entry-value 但是我只找到了 WordPress 上传链接,尽管当我查看我的条目时,保管箱链接就在那里 这是我在当前主题的functions.php中使用的代码
add_action( 'gform_after_submission', 'post_to_third_party', 10, 2 );
function post_to_third_party( $entry, $form ) {
$value = rgar( $entry, '158' ); // id of the field that holds the dropbox link
$files = json_decode( $value, true );
foreach ( $files as $file ) {
print_r($file);
}
foreach($entry as $child) { // also trying to print all entry properties but found nothing
echo $child . "<br>";
}
$value1 = GF_Field_Dropbox::get_value_export( $entry, '158' ); // trying export function in the docs but gives the same as first $value
print_r($value1);
}
有什么方法可以在表单提交后访问 Dropbox 生成的链接?
【问题讨论】:
标签: php wordpress gravity-forms-plugin