Hi,
I am developing a plugin and trying to get access to the values of s2members options-array. In s2member i have created custom registration/profile fields. When i do this in my php-function:
$options = get_option('ws_plugin__s2member_options');
print_r($options['custom_reg_fields']);
I get this:
[{"section":"no","sectitle":"","id":"mobile_phone","label":"Mobilnummer","type":"text","deflt":"","options":"","expected":"numerics-1","required":"yes","levels":"all","editable":"yes","classes":"","styles":"","attrs":""},{"section":"yes","sectitle":"Reserver analyser","id":"reservation_box","label":"Velg en eller flere analyser du ønsker deg i fremtiden","type":"checkboxes","deflt":"","options":"targovax | Targovax
\nserodus | Serodus
\npci_biotech | PCI Biotech holding
\nstrongbridge | Strongbridge
\nphotocure | Photocure
\nbionor_pharma | Bionor Pharma
\nbiotec_pharmacon | Biotec Pharmacon
\nnavamedic | Navamedic
\nnatto_pharma | Natto Pharma
\nmedistim | Medistim
\nhofseth_biocare | Hofseth Biocare
\nserendex | Serendex
\ncellcura | Cellcura
\naqua_bio_tech | Aqua Bio Technology
\nbors _vps | OSLO Børs VPS
\nb2holding | B2Holding
\nainmt | AINMT
\nskiens_aktiemolle | Skiens Aktiemølle
\narendals_fossekomp | Arendals Fossekompani
\nbouvet | Bouvet
\ndata_respons | Data respons
\npolaris_media | Polaris Media
\nrenonorden | RenoNorden
","expected":"","required":"no","levels":"all","editable":"yes","classes":"","styles":"text-align: left;","attrs":""},{"section":"yes","sectitle":"Nyheter","id":"nyheter_checkbox","label":"Ja, jeg vil få nyheter om at mine reserverte analyser har blitt tilgjengelig (du vil få en epost av signup@norskeanalyser.no)","type":"pre_checkbox","deflt":"","options":"","expected":"","required":"yes","levels":"all","editable":"no-invisible","classes":"","styles":"","attrs":""}]
This looks to me like that the key custom_reg_fields
has an array with three arrays as value (not sure if im right here?). What i need: in the second array (id: reservation_box) i need the value of the key options
. That means I need the string:
targovax | Targovax \nserodus | Serodus \npci_biotech | PCI Biotech holding \nstrongbridge | Strongbridge \nphotocure | Photocure \nbionor_pharma | Bionor Pharma \nbiotec_pharmacon | Biotec Pharmacon \nnavamedic | Navamedic \nnatto_pharma | Natto Pharma \nmedistim | Medistim \nhofseth_biocare | Hofseth Biocare \nserendex | Serendex \ncellcura | Cellcura \naqua_bio_tech | Aqua Bio Technology \nbors _vps | OSLO Børs VPS \nb2holding | B2Holding \nainmt | AINMT \nskiens_aktiemolle | Skiens Aktiemølle \narendals_fossekomp | Arendals Fossekompani \nbouvet | Bouvet \ndata_respons | Data respons \npolaris_media | Polaris Media \nrenonorden | RenoNorden
How can i achieve this with php? I have tried it with some foreach-loop but it didnt work.
Thanks for your help!