'bln-twp', 'description' => __('Use this widget to display a Text Widget+ in your sidebar.', BLN_TEXTDOMAIN)); $control_ops = array('id_base' => 'bln-twp'); $this->WP_Widget('bln-twp', 'Text Widget +', $widget_ops, $control_ops); } // Display the widget public function widget($args, $instance) { extract($args); $id = $instance['id']; $page = get_post($id); if (!empty($page)) { $title = $page->post_title; echo $before_widget; echo $before_title . $title . $after_title; if (has_post_thumbnail($id)) { $widgets = wp_get_sidebars_widgets(); $count = (isset($widgets['sidebar3'])) ? count($widgets['sidebar3']) : 0; $thumb_id = get_post_thumbnail_id($id); $size = (2 > $count) ? array(400, 400) : 'full'; $literal_size = (is_array($size)) ? implode('x', $size) : 'full'; echo wp_get_attachment_image($thumb_id, $size, false, array( 'class' => 'attachment-' . $thumb_id . ' twplus-thumb-' . $literal_size . ' img-polaroid aligncenter', 'alt' => esc_attr($title), ) ); } $content = apply_filters('bln_twplus_content', $page->post_content); ?>
-1); $instance = wp_parse_args((array) $instance, $defaults); $options = array( 'post_type' => BLN_TPLUS_NAME, 'numberposts' => -1, 'post_parent' => null, 'post_status' => 'publish', ); $tplus_list = get_posts($options); if (!empty($tplus_list)) { ?>

here!', BLN_TEXTDOMAIN), esc_url('post-new.php?post_type=' . BLN_TPLUS_NAME)); } } // Update values public function update($new_instance, $old_instance) { $instance = $old_instance; $tplus = get_post(intval($new_instance['id'])); if (isset($tplus->post_type) && BLN_TPLUS_NAME == $tplus->post_type) { $instance['id'] = intval($new_instance['id']); } return $instance; } } }