{"id":3943,"date":"2017-05-31T05:15:09","date_gmt":"2017-05-31T05:15:09","guid":{"rendered":"http:\/\/musilda.cz\/?p=3943"},"modified":"2017-05-31T05:15:09","modified_gmt":"2017-05-31T05:15:09","slug":"nemuzete-prochazet-seznam-zdroju-woocommerce-rest-api","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/nemuzete-prochazet-seznam-zdroju-woocommerce-rest-api\/","title":{"rendered":"Nem\u016f\u017eete proch\u00e1zet seznam zdroj\u016f WooCommerce Rest API"},"content":{"rendered":"\n

Po del\u0161\u00ed dob\u011b p\u00ed\u0161i kr\u00e1tk\u00fd snippet, pro o\u0161klivou a nep\u0159\u00edjemnou chybu vol\u00e1n\u00ed WooCommerce Rest API, pomoc\u00ed jejich knihovny.<\/p>\n\n\n\n

V p\u0159\u00edpad\u011b, \u017ee v\u00e1m vyhazuje chybu woocommerce_rest_cannot_view, zm\u011b\u0148te:<\/p>\n\n\n\n

$woocommerce = new Client(\n     $shops[$shop_id]['shop_url'],\n     $consumer_key,\n     $consumer_secret,\n         array(\n           'wp_api' => true,\n           'version' => 'wc\/v1'\n        )\n     );<\/pre>\n\n\n\n

na<\/p>\n\n\n\n

$woocommerce = new Client(\n        $shops[$shop_id]['shop_url'],\n        $consumer_key,\n        $consumer_secret,\n             array(\n               'wp_api' => true,\n               'version' => 'wc\/v1',\n               'query_string_auth' => true\n             )\n );<\/pre>\n","protected":false},"excerpt":{"rendered":"

Po del\u0161\u00ed dob\u011b p\u00ed\u0161i kr\u00e1tk\u00fd snippet, pro o\u0161klivou a nep\u0159\u00edjemnou chybu vol\u00e1n\u00ed WooCommerce Rest API, pomoc\u00ed jejich knihovny. V p\u0159\u00edpad\u011b, \u017ee v\u00e1m vyhazuje chybu woocommerce_rest_cannot_view, zm\u011b\u0148te: $woocommerce = new Client( $shops[$shop_id][‚shop_url‘], $consumer_key, $consumer_secret, array( ‚wp_api‘ => true, ‚version‘ => ‚wc\/v1‘ ) ); na $woocommerce = new Client( $shops[$shop_id][‚shop_url‘], $consumer_key, $consumer_secret, array( ‚wp_api‘ => true, ‚version‘<\/p>\n","protected":false},"author":1,"featured_media":8732,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[25,28],"tags":[448],"class_list":["post-3943","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-woocommerce","category-woocommerce-reseni-problemu","tag-woocommerce-rest-api"],"_links":{"self":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/3943"}],"collection":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/comments?post=3943"}],"version-history":[{"count":0,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/3943\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media\/8732"}],"wp:attachment":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media?parent=3943"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/categories?post=3943"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/tags?post=3943"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}