重力形式获得SEO标题

时间:2014-07-06 13:59:56

标签: wordpress forms gravity

我正在尝试获取自动填充到重力形式的页面的SEO Meta标题,因此我知道表单是从哪个页面发送的。我正在使用sabidirectory插件,但重力表单不会从以下页面获取页面标题:

{embed_post:post_title} 

我在函数中添加的代码是:

    add_filter('gform_field_value_your_parameter', 'my_custom_population_function');
function my_custom_population_function($value){
    return $showCurrent;
}

我需要知道如何拿起SEO Meta标题。我想我必须改变这个:

return $showCurrent;

但是为了返回表单页面的SEO Meta标题,不知道要放在这里。

确定已解决此问题

add_filter('gform_field_value_your_parameter', 'my_custom_population_function');
function my_custom_population_function($value){
global $post;

$parent_title = get_the_title($post->post_parent);

return $parent_title;
}

0 个答案:

没有答案