. */ // Functions to be used in templates include('more-fields-template-functions.php'); include('more-fields-object.php'); $mf0 = new more_fields_object; $mf0->init(); $mf0->init_field_types(); // Load admin components if (is_admin()) { include('more-fields-manage-object.php'); $mfo = new more_fields_manage; $mfo->init($mf0); } function mf_add_meta_box($title, $fields, $context = array(), $position = '') { global $more_fields_boxes; if (!$position) $position = 'left'; if (!is_array($context)) $context = array($context); $on_post = (in_array('post', $context) || !$context) ? true : false; $on_page = (in_array('page', $context) || !$context) ? true : false; $box = array('name' => $title, 'on_post' => $on_post, 'on_page' => $on_page, 'position' => $position); $box['field'] = $fields; $more_fields_boxes[$title] = $box; } function mf_add_post_type($title, $options) { global $more_fields_page_types; // if (!$position) $position = 'left'; // if (!is_array($context)) $context = array($context); // $on_post = (in_array('post', $context) || !$context) ? true : false; // $on_page = (in_array('page', $context) || !$context) ? true : false; // $type = array('name' => $title, 'on_post' => $on_post, 'on_page' => $on_page, 'position' => $position); // $box['field'] = $fields; $more_fields_page_type[$title] = $options; } ?>