- This topic has 5 replies, 2 voices, and was last updated 11 months, 3 weeks ago by .
-
Topic
-
Hello,
I know thatrwmb_get_field_settings()
returns an array and in['storage']
” we get an instance ofRWMB_Table_Storage
. Is there a reason why the$table
property is protected? Can we get something likerwmb_get_field_custom_table()
?As of now I’m relying on the array casting trick.
function get_property(object $object, string $property) { $array = (array) $object; $propertyLength = strlen($property); foreach ($array as $key => $value) { if (substr($key, -$propertyLength) === $property) { return $value; } } }
So this is how I get the table name of a field.
var_dump( get_property ( rwmb_get_field_settings( $meta_key, '', $object_id )['storage'], 'table' ) );
This code smells though.
Thanks,
Nick
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- You must be logged in to reply to this topic.