Comments (3)
I fixed this issue by adding 2 line to dynamic_get
function:
public function dynamic_get( $name, $desc, $filter_value = null ) {
if ( isset($desc['getter']) ) {
if ( is_string($desc['getter']))
$value = $this->{ $desc['getter'] }();
else if ( is_callable($desc['getter']))
$value = call_user_func($desc['getter'], $this, $name, $desc, $filter_value);
else
throw new \Exception( $desc['getter'] .' getter is not a function in this scope');
} else {
$value = $this->{ $name };
}
if ( isset($desc['default'])) {
$value = $desc['default'];
}
if ( isset($desc['type']) && $desc['type'] == 'array') {
$value = maybe_unserialize( $value );
}
if ( isset($desc['type']) && $desc['type'] == 'array' && empty($value) ) {
$value = array();
}
return $value;
}
It is working fine now but not sure this issue was fully fixed so could you make a try and give me your thought?
from woocommerce-json-api.
Hi,
Many thanks for the fix! I rewrote it as this and pushed it to the latest repository
<?php
if ( (!$value || empty($value) ) && (isset($desc['default']) && $desc['default'] && ! empty($desc['default']) ) ) {
$value = $desc['default'];
}
from woocommerce-json-api.
Some features are "in place" but not implemented, as until recently it was just me working on it. and for backend code it's still mainly me, while Mike is doing the whizbang test/example interface.
from woocommerce-json-api.
Related Issues (20)
- Issue With get_products HOT 1
- Issues With set_product HOT 1
- Support for delete product HOT 1
- Deleting Product Variation HOT 1
- How can I set featured image when set_products? HOT 1
- URL HOT 1
- How can i use this plugin?
- How can i use this plugin? HOT 2
- Product attribute 'attributes' is represented as array, map or string HOT 5
- invalid api user HOT 1
- Feature request: get_* include last modified time HOT 4
- Var not set HOT 2
- Plans To Support Filters HOT 6
- Issues With get_orders() and get_products
- Question regarding target url HOT 3
- Is it possible to test the plugin using cUrl method? HOT 4
- Plugin can not be activated after installation HOT 2
- TypeError HOT 2
- Create a Product and add it to a WooThemes Subscription HOT 1
- package management HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from woocommerce-json-api.