} self::echo_sub_options_html($post_type_object); break; } } public function get_options_from_posted_form($data) { $post_type = !empty($data['post_type']) ? $data['post_type'] : 'page'; $page_id = !empty($data['page_id']) ? $data['page_id'] : 0; $post_type_object = get_post_type_object($post_type); if ($post_type_object == null) { $post_type = ''; $page_id = 0; } $with_subtree = !empty($data['with_subtree']); $options = array('post_type' => $post_type, 'page' => $page_id, 'with_subtree' => $with_subtree); return $options; } protected static function get_hierarchical_post_types() { $post_types = get_post_types(array('hierarchical' => true), 'objects'); return $post_types; } protected static function hierachical_post_type_exists($post_type) { $post_types = get_post_types(array('hierarchical' => true), 'names'); return in_array($post_type, $post_types); } } WpakComponentsTypes::register_component_type('page', array('label' => __('WordPress page', WpAppKit::i18n_domain)));
$options = $component->options; $current_hook = $options['hook']; } ?> <div class="component-params"> <label><?php _e('Hook name', WpAppKit::i18n_domain); ?> : </label> <input type="text" name="hook" value="<?php echo $current_hook; ?> " /> </div> <?php } public function echo_form_javascript() { } public function get_ajax_action_html_answer($action, $params) { } public function get_options_from_posted_form($data) { $hook = !empty($data['hook']) ? $data['hook'] : ''; $options = array('hook' => $hook); return $options; } } WpakComponentsTypes::register_component_type('hooks', array('label' => __('Custom component, using hooks', WpAppKit::i18n_domain)));
} ?> <?php } ?> <?php } else { ?> <?php echo sprintf(__('No taxonomy found for post type %s', WpAppKit::i18n_domain), $current_post_type); ?> <?php } ?> <?php } ?> <?php } public function get_options_from_posted_form($data) { $post_type = !empty($data['post-type']) ? $data['post-type'] : ''; $taxonomy = !empty($data['taxonomy']) ? $data['taxonomy'] : ''; $term = !empty($data['term']) ? $data['term'] : ''; $hook = !empty($data['hook']) ? $data['hook'] : ''; $options = array('post-type' => $post_type, 'taxonomy' => $taxonomy, 'term' => $term, 'hook' => $hook); return $options; } } WpakComponentsTypes::register_component_type('posts-list', array('label' => __('Posts list', WpAppKit::i18n_domain)));