Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Why do developers make it so darn hard to use the tools they develop? Don't answer, I already know :)

Have had some success using this: https://github.com/bainternet/Admin-Page-Class ...to develop a plugin admin page.

BA Internet, plugin developer, offers repeater fields, where I created a set of three fields to create a list of video tutorials. Here is my code:

$options_panel->Title(__("Video Tutorials","apc"));  
$repeater_fields_videos[] = $options_panel->addText('re_text_field_video_title',array('name'=> __('Video Title ','apc')),true);
$repeater_fields_videos[] = $options_panel->addText('re_text_field_video_url',array('name'=> __('Video URL ','apc')),true);
$repeater_fields_videos[] = $options_panel->addTextarea('re_textarea_field_video_description',array('name'=> __('Video Description ','apc')),true);
//repeater block
$options_panel->addRepeaterBlock('re_',array('sortable' => true, 'inline' => true, 'name' => __('Add your YouTube, Vimeo, or Screencast videos.','apc'),'fields' => $repeater_fields_videos, 'desc' => __('Requires full url to video.','apc')));

Here is the data in my fdwp101_options field within the wp-options table

//What I see in fdwp101_options field in the wp-options table
s:3:"re_";a:1:{i:0;a:3:{
s:16:"re_text_field_video_title";s:32:"Video Title Here";
s:23:"re_text_field_video_url";
s:18:"http://youtube.com";
s:21:"re_textarea_field_video_description";s:98:"Video description here";}}

Finally, the code I use (that does not work) to display the data on my page:

   $data = get_option('fdwp101_options'); //name of options group 
   echo $data['re_text_field_video_title'];

BA Internet offers this code to pull data, though I can't get it to work for the repeater fields data:

//get the data to an array
$data = get_option('demo_options'); //my field is fdwp101_options
//access each field by its id
echo $data['text_field_id'];

Ideas?

share|improve this question
    
Are you sure you copied that "What I see in fdwp101_options field" part correctly? It looks like serialized data but I can't get it to unserialize correctly. –  s_ha_dum Nov 30 '13 at 1:31
    
That was a snippit of the DB. Here is the entire field: pastebin.com/UNBBwvcv –  user38891 Dec 1 '13 at 14:00
    
Also, here is admin-page-class.php that builds the repeater blocks: pastebin.com/uECE4uwL –  user38891 Dec 1 '13 at 14:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.