Exemplo n.º 1
0
 /**
  * Displays the widget control options in the Widgets admin screen.
  *
  * @since 0.0.1
  */
 public function form($instance)
 {
     /** Set up the default form values. */
     $defaults = array('title' => 'Agent', 'name' => true, 'name_custom' => '', 'email' => true, 'email_custom' => '', 'phone' => true, 'phone_custom' => '', 'description' => false, 'description_custom' => '', 'photo' => true, 'image_uri' => '');
     /** Merge the user-selected arguments with the defaults. */
     $instance = wp_parse_args((array) $instance, $defaults);
     /** Print the backend widget form. */
     echo pls_h_div(pls_h_p(pls_h_label('Title' . ':' . pls_h('input', array('type' => 'text', 'class' => 'widefat', 'id' => $this->get_field_id('title'), 'name' => $this->get_field_name('title'), 'value' => esc_attr($instance['title']), 'style' => 'font-weight:normal')), $this->get_field_id('title'), array('style' => 'font-weight:bold'))) . pls_h_p(pls_h_label(pls_h_checkbox(checked($instance['name'], true, false), array('id' => $this->get_field_id('name'), 'name' => $this->get_field_name('name'))) . ' ' . 'Include Name', $this->get_field_id('name'))) . pls_h_p(pls_h_label('Override Name:' . pls_h('input', array('type' => 'text', 'class' => 'widefat', 'id' => $this->get_field_id('name_custom'), 'name' => $this->get_field_name('name_custom'), 'value' => esc_attr($instance['name_custom']), 'style' => 'font-weight:normal')), $this->get_field_id('name_custom'), array('style' => 'font-weight:bold'))) . pls_h_p(pls_h_label(pls_h_checkbox(checked($instance['email'], true, false), array('id' => $this->get_field_id('email'), 'name' => $this->get_field_name('email'))) . ' ' . 'Include Email', $this->get_field_id('email'))) . pls_h_p(pls_h_label('Override Email:' . pls_h('input', array('type' => 'text', 'class' => 'widefat', 'id' => $this->get_field_id('email_custom'), 'name' => $this->get_field_name('email_custom'), 'value' => esc_attr($instance['email_custom']), 'style' => 'font-weight:normal')), $this->get_field_id('email_custom'), array('style' => 'font-weight:bold'))) . pls_h_p(pls_h_label(pls_h_checkbox(checked($instance['phone'], true, false), array('id' => $this->get_field_id('phone'), 'name' => $this->get_field_name('phone'))) . ' ' . 'Include Phone', $this->get_field_id('phone'))) . pls_h_p(pls_h_label('Override Phone:' . pls_h('input', array('type' => 'text', 'class' => 'widefat', 'id' => $this->get_field_id('phone_custom'), 'name' => $this->get_field_name('phone_custom'), 'value' => esc_attr($instance['phone_custom']), 'style' => 'font-weight:normal')), $this->get_field_id('phone_custom'), array('style' => 'font-weight:bold'))) . pls_h_p(pls_h_label(pls_h_checkbox(checked($instance['description'], true, false), array('id' => $this->get_field_id('description'), 'name' => $this->get_field_name('description'))) . ' ' . 'Include Description', $this->get_field_id('description'))) . pls_h_p(pls_h_label('Override Description:' . pls_h('input', array('type' => 'text', 'class' => 'widefat', 'id' => $this->get_field_id('description_custom'), 'name' => $this->get_field_name('description_custom'), 'value' => esc_attr($instance['description_custom']), 'style' => 'font-weight:normal;height:')), $this->get_field_id('description_custom'), array('style' => 'font-weight:bold'))) . pls_h_p(pls_h_label(pls_h_checkbox(checked($instance['photo'], true, false), array('id' => $this->get_field_id('photo'), 'name' => $this->get_field_name('photo'))) . ' ' . 'Photo', $this->get_field_id('photo'))) . pls_h_p(pls_h_label('Image') . pls_h('input', array('name' => $this->get_field_name('image_uri'), 'type' => 'text', 'id' => "image-" . esc_attr($this->get_field_id('image_uri')), 'value' => $instance['image_uri'], 'class' => '.agent-widget-img-text-input')) . pls_h('img', array('id' => "image_tag-" . esc_attr($this->get_field_id("image_uri")), 'src' => $instance['image_uri'], 'class' => '.agent-widget-img-tag')) . pls_h('input', array('type' => 'button', 'id' => 'select-img-' . $this->get_field_id("image_uri"), 'value' => 'Select Image', 'class' => 'agent-widget-img-button'))));
 }
Exemplo n.º 2
0
 /**
  * Displays the widget control options in the Widgets admin screen.
  *
  * @since 0.0.1
  */
 public function form($instance)
 {
     /** Set up the default form values. */
     $defaults = array('title' => 'Latest Blog Posts', 'post_title' => true, 'author' => true, 'date' => true, 'excerpt' => true, 'read_more' => true, 'number' => 5, 'cat' => '');
     /** Merge the user-selected arguments with the defaults. */
     $instance = wp_parse_args($instance, $defaults);
     /** Print the backend widget form. */
     echo pls_h_div(pls_h_p(pls_h_label('Title' . ':' . pls_h('input', array('type' => 'text', 'class' => 'widefat', 'id' => $this->get_field_id('title'), 'name' => $this->get_field_name('title'), 'value' => esc_attr($instance['title']))), $this->get_field_id('title'))) . pls_h_p(pls_h_label(pls_h_checkbox(checked($instance['post_title'], true, false), array('id' => $this->get_field_id('post_title'), 'name' => $this->get_field_name('post_title'))) . ' ' . 'Post Title', $this->get_field_id('post_title'))) . pls_h_p(pls_h_label("Category:\n" . wp_dropdown_categories(array('show_option_all' => "From All Categories", 'name' => $this->get_field_name("cat"), 'selected' => $instance['cat'], 'hide_empty' => 0, 'echo' => 0)))) . pls_h_p(pls_h_label(pls_h_checkbox(checked($instance['author'], true, false), array('id' => $this->get_field_id('author'), 'name' => $this->get_field_name('author'))) . ' ' . 'Author', $this->get_field_id('author'))) . pls_h_p(pls_h_label(pls_h_checkbox(checked($instance['date'], true, false), array('id' => $this->get_field_id('date'), 'name' => $this->get_field_name('date'))) . ' ' . 'Post Date', $this->get_field_id('date'))) . pls_h_p(pls_h_label(pls_h_checkbox(checked($instance['excerpt'], true, false), array('id' => $this->get_field_id('excerpt'), 'name' => $this->get_field_name('excerpt'))) . ' ' . 'Excerpt', $this->get_field_id('excerpt'))) . pls_h_p(pls_h_label(pls_h_checkbox(checked($instance['read_more'], true, false), array('id' => $this->get_field_id('read_more'), 'name' => $this->get_field_name('read_more'))) . ' ' . 'Read more link', $this->get_field_id('read_more'))) . pls_h_p(pls_h_label('Number of posts' . ': ' . pls_h('input', array('type' => 'text', 'size' => 4, 'id' => $this->get_field_id('number'), 'name' => $this->get_field_name('number'), 'value' => esc_attr($instance['number']))), $this->get_field_id('number'))));
 }