function bb_init_news_shortcode() { // Map array $map = array('name' => 'Nyheter', 'base' => 'news', 'description' => 'Visa nyhetsartiklar', 'class' => '', 'show_settings_on_create' => true, 'weight' => 10, 'category' => 'Innehåll', 'params' => array(array('type' => 'dropdown', 'heading' => 'Urval av erbjudanden', 'param_name' => 'news_choice', 'value' => array('Alla nyheter' => 'all', 'Enskild nyhet' => 'single')), array('type' => 'cpt', 'post_type' => 'news', 'heading' => 'Välj nyhetsartikel', 'param_name' => 'news', 'placeholder' => 'Välj nyhetsartikel', 'value' => '', 'description' => 'Välj en existerande nyhetsartikel.', 'dependency' => array('element' => 'news_choice', 'value' => 'single')), array('type' => 'checkbox', 'heading' => 'Filtrera på kategori', 'param_name' => 'news_categories', 'value' => get_tax_terms('news_categories', 'kategorier'), 'dependency' => array('element' => 'news_choice', 'value' => 'all')), array('type' => 'dropdown', 'heading' => 'Kolumner per rad', 'param_name' => 'columns', 'placeholder' => 'Kolumner per rad', 'value' => array('En' => 12, 'Två' => 6, 'Tre' => 4, 'Fyra' => 3, 'Sex' => 2), 'dependency' => array('element' => 'news_choice', 'value' => 'all')), array('type' => 'integer', 'heading' => 'Poster per sida', 'param_name' => 'posts_per_page', 'placeholder' => 'Poster per rad', 'min' => 0, 'max' => 100, 'dependency' => array('element' => 'news_choice', 'value' => 'all')), array('type' => 'checkbox', 'heading' => 'Inkludera sidbläddring', 'param_name' => 'pagination', 'value' => array('Ja' => 1), 'dependency' => array('element' => 'news_choice', 'value' => 'all')))); // Alter params filter $map['params'] = apply_filters('bb_alter_news_params', $map['params']); $vcNews = new NewsShortcode($map); }
function create_posttypes_table($dept_id) { //used in taxes network admin page //create html and return $pid = get_posttypes_id($dept_id); $result = "<table class='seufolios'>\n\t\t<tr><th>Post Type Slug</th><th>Settings</th><th>Default Content</th><th></th></tr>"; $terms = get_tax_terms($pid); foreach ($terms as $term) { $settings = explode("\ndefault_content=", $term->term_settings, 2); $result .= "<tr id='post_row_{$term->id}'><td>{$term->term_slug}</td><td>" . $settings[0] . "</td><td>" . stripslashes(urldecode($settings[1])) . "</td><td><button id='edit_{$term->id}' class='edit_button' type='button' onclick='edit_post({$term->id})'>Edit</button></td></tr>\n"; } $result .= "</table>"; return $result; }