Пример #1
0
 private function extract_args($args)
 {
     if (!is_array($args)) {
         return;
     }
     $id = '';
     $post_type = '';
     $post_types = array('post');
     $fields = array();
     $title = 'SB Meta Box';
     $callback = '';
     $context = 'advanced';
     $priority = 'default';
     $callback_args = null;
     extract($args, EXTR_OVERWRITE);
     $this->id = 'sb_meta_box_' . $id;
     $this->post_type = $post_type;
     $this->post_types = $post_types;
     $this->fields = array();
     $this->title = $title;
     $this->callback = $callback;
     $this->context = $context;
     $this->priority = $priority;
     $this->callback_args = $callback_args;
     foreach ($fields as $field) {
         $field['name'] = SB_Core::build_meta_box_field_name($field['name']);
         array_push($this->fields, $field);
     }
 }
Пример #2
0
function sb_build_meta_name($meta_name)
{
    return SB_Core::build_meta_box_field_name($meta_name);
}