最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

functions - query_vars treat as single var from URL

programmeradmin1浏览0评论

I want to use the link parameter from URL as one query_var. If I visit the page where [flipwoo] is in, for example:
/?link=/?download_file=1953&order=wc_order_zHOH4RI97k9mR&email=test%40gmail&key=91c44b50-6922-4976-ac57-6d499136eead
the following is echoed:
/?download_file=1953
but I want the whole URL after ?link= to be echoed:
/?download_file=1953&order=wc_order_zHOH4RI97k9mR&email=test%40gmail&key=91c44b50-6922-4976-ac57-6d499136eead
Where is the mistake?

function themeslug_query_vars( $qvars ) {
    $qvars[] = 'link';
    return $qvars;
}
add_filter( 'query_vars', 'themeslug_query_vars' );

function get_woolink() {
    $linked = get_query_var( 'link', 1 );
    echo $linked;
}

add_shortcode('flipwoo', 'get_woolink');
发布评论

评论列表(0)

  1. 暂无评论