Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/280.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php $\u GET在wp customizer中不工作_Php_Wordpress_Get - Fatal编程技术网

Php $\u GET在wp customizer中不工作

Php $\u GET在wp customizer中不工作,php,wordpress,get,Php,Wordpress,Get,我正在使用wp\u footer操作在站点顶部显示一个栏 我使用并获取了自定义程序url中的条id,但它没有返回任何内容 下面是我的代码: add_action( 'wp_footer', 'jws_ob_content'); function jws_ob_content() { if( is_customize_preview() ) { $offer = get_post( $_GET['offer_id'] ); $offer_custom = get_po

我正在使用
wp\u footer
操作在站点顶部显示一个栏

我使用并获取了自定义程序url中的条id,但它没有返回任何内容

下面是我的代码:

add_action( 'wp_footer',  'jws_ob_content');
function jws_ob_content() {
  if( is_customize_preview() ) {
      $offer = get_post( $_GET['offer_id'] );
      $offer_custom = get_post_custom( $_GET['offer_id'] );
      echo "<pre>";
      print_r( $_GET['offer_id'] );
      exit();
  }
  else {
      $offer = get_post('505');
      $offer_custom = get_post_custom('505');
  }
}
add_action('wp_footer','jws_ob_content');
函数jws_ob_content(){
如果(是自定义预览()){
$offer=get_post($_get['offer_id']);
$offer\u custom=get\u post\u custom($u get['offer\u id']);
回声“;
打印($获取['offer\u id']);
退出();
}
否则{
$offer=get_post('505');
$offer_custom=get_post_custom('505');
}
}

我通过编写和自动聚焦[panel]=something对url进行了编码,url的结尾很好。

方法
is\u customize\u preview()
do?如果它是customizer,customize\u preview()是否返回true。检查
print\r($\u REQUEST)?vrajesh检查更新的代码返回此数组([页面id]=>519[自定义变更集uuid]=>47cffcc9-3a55-4b35-887c-4e8497ff9da9[自定义主题]=>217[自定义信使频道]=>preview-0)