Shortcode Widget - Version 0.2

Version Description

Download this release

Release Info

Developer gagan0123
Plugin Icon 128x128 Shortcode Widget
Version 0.2
Comparing to
See all releases

Code changes from version 0.1 to 0.2

Files changed (3) hide show
  1. class-shortcode-widget.php +4 -4
  2. index.php +8 -2
  3. readme.txt +3 -2
class-shortcode-widget.php CHANGED
@@ -7,9 +7,9 @@
7
  class Shortcode_Widget extends WP_Widget {
8
 
9
  function __construct() {
10
- $widget_ops = array('classname' => 'shortcode_widget', 'description' => __('Shortcode or HTML or Plain Text','shortcode-widget'));
11
  $control_ops = array('width' => 400, 'height' => 350);
12
- parent::__construct('shortcode-widget', __('Shortcode Widget','shortcode-widget'), $widget_ops, $control_ops);
13
  }
14
 
15
  function widget( $args, $instance ) {
@@ -39,12 +39,12 @@ class Shortcode_Widget extends WP_Widget {
39
  $title = strip_tags($instance['title']);
40
  $text = esc_textarea($instance['text']);
41
  ?>
42
- <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:','shortcode-widget'); ?></label>
43
  <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p>
44
 
45
  <textarea class="widefat" rows="16" cols="20" id="<?php echo $this->get_field_id('text'); ?>" name="<?php echo $this->get_field_name('text'); ?>"><?php echo $text; ?></textarea>
46
 
47
- <p><input id="<?php echo $this->get_field_id('filter'); ?>" name="<?php echo $this->get_field_name('filter'); ?>" type="checkbox" <?php checked(isset($instance['filter']) ? $instance['filter'] : 0); ?> />&nbsp;<label for="<?php echo $this->get_field_id('filter'); ?>"><?php _e('Automatically add paragraphs','shortcode-widget'); ?></label></p>
48
  <?php
49
  }
50
  }
7
  class Shortcode_Widget extends WP_Widget {
8
 
9
  function __construct() {
10
+ $widget_ops = array('classname' => 'shortcode_widget', 'description' => __('Shortcode or HTML or Plain Text', SHORTCODE_WIDGET_TEXT_DOMAIN));
11
  $control_ops = array('width' => 400, 'height' => 350);
12
+ parent::__construct('shortcode-widget', __('Shortcode Widget', SHORTCODE_WIDGET_TEXT_DOMAIN), $widget_ops, $control_ops);
13
  }
14
 
15
  function widget( $args, $instance ) {
39
  $title = strip_tags($instance['title']);
40
  $text = esc_textarea($instance['text']);
41
  ?>
42
+ <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', SHORTCODE_WIDGET_TEXT_DOMAIN); ?></label>
43
  <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p>
44
 
45
  <textarea class="widefat" rows="16" cols="20" id="<?php echo $this->get_field_id('text'); ?>" name="<?php echo $this->get_field_name('text'); ?>"><?php echo $text; ?></textarea>
46
 
47
+ <p><input id="<?php echo $this->get_field_id('filter'); ?>" name="<?php echo $this->get_field_name('filter'); ?>" type="checkbox" <?php checked(isset($instance['filter']) ? $instance['filter'] : 0); ?> />&nbsp;<label for="<?php echo $this->get_field_id('filter'); ?>"><?php _e('Automatically add paragraphs', SHORTCODE_WIDGET_TEXT_DOMAIN); ?></label></p>
48
  <?php
49
  }
50
  }
index.php CHANGED
@@ -1,15 +1,17 @@
1
  <?php
2
  /*
3
  Plugin Name: Shortcode Widget
4
- Plugin URI: http://www.IaMmE.in
5
  Description: Adds a text-like widget that allows you to write shortcode in it. (Just whats missing in the default text widget)
6
  Author: gagan0123
7
  Author URI: http://gagan.pro/
8
- Version: 0.1
9
  Text Domain: shortcode-widget
10
  License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11
  */
12
 
 
 
13
  require_once('class-shortcode-widget.php');
14
 
15
  function shortcode_widget_init(){
@@ -17,4 +19,8 @@ function shortcode_widget_init(){
17
  }
18
  add_action('widgets_init','shortcode_widget_init');
19
 
 
 
 
 
20
  ?>
1
  <?php
2
  /*
3
  Plugin Name: Shortcode Widget
4
+ Plugin URI: http://wordpress.org/extend/plugins/shortcode-widget/
5
  Description: Adds a text-like widget that allows you to write shortcode in it. (Just whats missing in the default text widget)
6
  Author: gagan0123
7
  Author URI: http://gagan.pro/
8
+ Version: 0.2
9
  Text Domain: shortcode-widget
10
  License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11
  */
12
 
13
+ define('SHORTCODE_WIDGET_TEXT_DOMAIN','shortcode_widget');
14
+
15
  require_once('class-shortcode-widget.php');
16
 
17
  function shortcode_widget_init(){
19
  }
20
  add_action('widgets_init','shortcode_widget_init');
21
 
22
+ function shortcode_widget_load_text_domain(){
23
+ load_plugin_textdomain( SHORTCODE_WIDGET_TEXT_DOMAIN, false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
24
+ }
25
+ add_action('plugins_loaded','shortcode_widget_load_text_domain');
26
  ?>
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: gagan0123
3
  Tags: Shortcode, Widget
4
  Requires at least: 3.3
5
- Tested up to: 3.5
6
- Stable tag: 0.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -21,3 +21,4 @@ Adds a text-like widget that allows you to write shortcode in it. (Just whats mi
21
 
22
  == Changelog ==
23
  0.1 Added the shortcode widget
 
2
  Contributors: gagan0123
3
  Tags: Shortcode, Widget
4
  Requires at least: 3.3
5
+ Tested up to: 3.5.1
6
+ Stable tag: 0.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
21
 
22
  == Changelog ==
23
  0.1 Added the shortcode widget
24
+ 0.2 Added translation support