【发布时间】:2016-03-05 10:34:38
【问题描述】:
我只想在我的 wordpress 自定义插件中为自定义字段 Driver_info 使用 curl 来自 http://developers.bringg.com/docs/users 的名称。
{
extract($_POST);
$url = 'http://parklee.loc/my-spaces-2/';
$url = 'http://api.bringg.com/partner_api/users';
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_POSTFIELDS, "id=2");
$result = curl_exec($ch);
echo "<pre>"; print_r($result);
curl_close($ch);
}
请告诉我这段代码有什么问题。我收到错误 404,未找到。 我在里面写了这行代码
{
function order_my_custom( $post ){
$shipping = get_post_meta( $post->ID, 'driver_info', true );
wp_nonce_field( 'save_BFM_shipping', 'BFM_shipping_nonce' );
woocommerce_wp_select( array( 'id' => 'driver_info', 'label' => __('Driver Info: ', 'woocommerce'), 'options' => array(
'OPTION1' => __('c1', 'woocommerce'),
'OPTION2' => __('c2', 'woocommerce')
) ) );
}
}
而我的名字不是 c1,c2。
【问题讨论】:
-
我认为你没有完全按照指令。
-
这个 api 需要一个
company_id并且你需要发送access_token和signature看起来也是如此