public static function wck_field_shortcode($atts, $content = null) { extract(shortcode_atts(array('metabox' => '', 'meta' => '', 'field' => '', 'name' => '', 'id' => '', 'shortcode' => 'false', 'image' => '', 'size' => 'full', 'icon' => '0', 'attr' => ''), $atts)); if (!empty($metabox)) { $meta = $metabox; } if (self::$state['is_wck_repeater']) { // Inside repeater field // Get meta key if (empty($meta)) { $meta = self::$state['wck_repeater_meta']; } $key = self::$state['wck_repeater_key']; if (!empty(self::$state['wck_repeater_id'])) { $id = self::$state['wck_repeater_id']; } } elseif (self::$state['is_wck_metabox_loop']) { // Inside metabox loop if (empty($meta)) { $meta = self::$state['current_wck_metabox']; } } if (!empty($name)) { $field = $name; } if (!empty($image)) { $field = $image; } if (empty($field) && isset($atts) && !empty($atts[0])) { $field = $atts[0]; // First parameter [field field_name] } $out = null; if (!empty($meta) && !empty($field)) { ob_start(); // Store output of the_cfc_field in buffer // Remove nl2br formatting if shortcode is enabled if ($shortcode) { remove_filter('wck_output_get_field_textarea', 'wck_preprocess_field_textarea'); } if (self::$state['is_wck_repeater']) { // In a repeater loop if (!empty($id)) { $out = get_cfc_field($meta, $field, $id, $key); } else { $out = get_cfc_field($meta, $field, false, $key); } } else { // Single meta and field if (!empty($id)) { $out = get_cfc_field($meta, $field, $id); } else { $out = get_cfc_field($meta, $field); } } /*--------------------------------------------- * * Process field value * */ if (!empty($image)) { if (isset($out['id'])) { // Image field $out = wp_get_attachment_image($out['id'], $size, $icon, $attr); } } if (is_a($out, 'WP_Post')) { // Post object $this_post = $out; $out = null; // Needs content: [post-field]...[/post-field] if (empty($content)) { return null; } self::$state['is_wck_post_field'] = true; self::$state['current_wck_post_id'] = $this_post->ID; $out = do_local_shortcode('ccs', $content, true); self::$state['is_wck_post_field'] = false; self::$state['current_wck_post_id'] = 0; } if (is_array($out)) { // Array $out = implode(', ', $out); } if ($shortcode == 'true') { $out = do_local_shortcode('ccs', $out, true); // Put back nl2br formatting add_filter('wck_output_get_field_textarea', 'wck_preprocess_field_textarea', 10); } } return $out; }
the_post(); the_content(); $core_archives = get_pages(array('parent' => get_the_ID(), 'post_type' => 'page', 'post_status' => 'publish', 'sort_column' => 'menu_order')); $num_col_xs = 1; $num_col_md = 2; $this_col_class = 'col-md-' . intval(12 / $num_col_md) . ' col-xs-' . intval(12 / $num_col_xs); $this_col = 0; if (!function_exists('get_cfc_meta')) { return; } ?> <div class="row"> <?php foreach ($core_archives as $this_core_page) { $cfc_glyph = strlen(get_cfc_field('page-meta', 'glyph', $this_core_page->ID)) ? "<span class='glyphicon " . get_cfc_field('page-meta', 'glyph', $this_core_page->ID) . " aria-hidden='true'></span> " : ''; $this_blurb = get_cfc_field('page-meta', 'blurb', $this_core_page->ID); if (empty($this_blurb)) { $this_blurb = wp_trim_words($this_core_page->post_content, 32); } if (++$this_col % $num_col_md == 1) { echo '<div class="col-xs-12">'; } ?> <div class="<?php echo $this_col_class; ?> "> <div class="well"> <article <?php post_class("core-functions"); ?>
<div class="row"> <?php foreach ($splash_teaser_ids as $this_teaser_id) { $this_teaser_post = get_post($this_teaser_id); //title $this_teaser_title = get_cfc_field('page-meta', 'display-name', $this_teaser_id); if (empty($this_teaser_title)) { $this_teaser_title = $this_teaser_post->post_title; } //glyph $this_teaser_glyph = get_cfc_field('page-meta', 'glyph', $this_teaser_id); if (!empty($this_teaser_glyph)) { $this_teaser_glyph = "<span class='glyphicon " . $this_teaser_glyph . "' aria-hidden='true'></span>"; } //blurb $this_teaser_blurb = get_cfc_field('page-meta', 'blurb', $this_teaser_id); if (empty($this_teaser_blurb)) { $this_teaser_blurb = wp_trim_words($this_teaser_post->post_content, 10); } ?> <div class="col-md-2 col-sm-4 col-xs-6"> <div class="panel panel-splash-teaser panel-splash-teaser-<?php echo $this_item; ?> "> <div class="panel-heading"><a href="<?php echo get_page_link($this_teaser_id); ?> "><?php echo $this_teaser_glyph; ?>