Tell us what you are trying to do?
to use one selected meta field value in views query.
I ve custom meta:
_wcfm_affiliate_commission
with multiple values:
a:3:{s:4:"rule";s:8:"personal";s:12:"vendor_order";a:4:{s:4:"mode";s:0:"";s:7:"percent";s:0:"";s:5:"fixed";s:0:"";s:8:"cal_mode";s:7:"on_item";}s:5:"order";a:4:{s:4:"mode";s:7:"percent";s:7:"percent";s:2:"10";s:5:"fixed";s:0:"";s:8:"cal_mode";s:7:"on_item";}}
I want to display only selected value.
If I use shortcode
[wpv-post-field name='_wcfm_affiliate_commission']
I can see all values but I can't separate it.
Could you advise how to do this?
Thank you for contacting us and I'd be happy to assist.
The custom field value that you shared consists of the serialized data and it seems it was added by the "WCFM" plugin.
For the most efficient and future safe approach to extract individual values from this custom field, it would be best to consult the WCFM plugin's official support and documentation.
( these plugins normally offer built-in shortcodes or functions to safely get data from these custom fields )
If you'd like to use the custom PHP code, you can register a custom shortcode, that can extract the data from such a serialized field and show only the required part(s).
Note: The custom code examples from our forum are shared to get you started in the right direction. You're welcome to adjust them as needed and for more personalized customization assistance, you can consider hiring a professional from our list of recommended contractors: https://toolset.com/contractors/
regards,
Waqar
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.