Ejemplo n.º 1
0
 private function parse_args($args)
 {
     $args = $this->check_raw_args($args);
     $labels = $this->create_labels($args['label'], $args['name']);
     $wp_args = array('name' => $args['name'], 'labels' => $labels, 'slug' => $args['name'], 'show_ui' => true, 'query_var' => true, 'show_admin_column' => false, 'hierarchical' => true, 'rewrite' => array('slug' => H_Elper::to_slug($args['slug']), 'with_front' => 'false'));
     return $wp_args;
 }
Ejemplo n.º 2
0
 private function parse_args($name, $args)
 {
     $slug = H_Elper::to_slug($name);
     $labels = $this->create_labels($name);
     $menu_position = $this->get_menu_position();
     // if slug is defined
     if (isset($args['slug'])) {
         $slug = $args['slug'];
     }
     $wp_args = array('public' => true, 'labels' => $labels, 'capability_type' => 'post', 'supports' => array('title', 'editor', 'thumbnail', 'excerpt', 'revisions'), 'has_archive' => true, 'rewrite' => array('slug' => $slug, 'with_front' => false), 'menu_position' => $menu_position);
     // add icon if given
     if (isset($args['icon'])) {
         $icon = str_replace('dashicons-', '', $args['icon']);
         $wp_args['menu_icon'] = 'dashicons-' . $icon;
     }
     return $wp_args;
 }