Version Description
- database bug fix for v 1.1.0 and 1.1.1
Download this release
Release Info
Developer | krozero199 |
Plugin | WP Custom Widget area |
Version | 1.1.2 |
Comparing to | |
See all releases |
Code changes from version 1.1.0 to 1.1.2
- README.txt +17 -6
- admin/class-wp-custom-widget-area-admin.php +6 -6
- admin/partials/cwa-admin-display.php +1 -1
- admin/partials/cwa-menu-admin-display.php +1 -1
- includes/class-custom-widget-area.php +14 -14
- includes/class-wp-custom-widget-area-activator.php +9 -8
- includes/class-wp-custom-widget-area-deactivator.php +3 -3
- includes/class-wp-custom-widget-area-i18n.php +5 -5
- includes/class-wp-custom-widget-area-loader.php +8 -8
- includes/config.php +1 -1
- uninstall.php +1 -1
- wp-custom-widget-area.php +49 -3
README.txt
CHANGED
@@ -1,10 +1,9 @@
|
|
1 |
=== Plugin Name ===
|
2 |
Contributors: krozero
|
3 |
-
Donate link: http://kishorkhambu.com.np/donation
|
4 |
Tags: widget area, custom widget area, widget, simple widget area, custom sidebar, dynamic sidebar, menu, menus, custom menu, custom menu locations, menu location, menu area
|
5 |
Requires at least: 3.0.1
|
6 |
Tested up to: 4.2.2
|
7 |
-
Stable tag: 1.1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -14,7 +13,7 @@ A very simple way to create a custom widget area, sidebars and menu locations fo
|
|
14 |
|
15 |
== Description ==
|
16 |
|
17 |
-
A Wordpress Plugin that makes it very simple and easy to create a custom widget areas, sidebars and Menu locations. With the help of this plugin you can create multiple custom widget areas, menu locations and use it
|
18 |
|
19 |
It allows you to show custom widget areas and menu locations created with this plugin in any part of your site (i.e, as sidebars, bottom widget areas , in header and plus with this plugin now you can also show it in your pages and posts contents.) There's two way of using this plugins. To show it in posts or pages content use shortcode link "Get shortcode" and for other like to show as sidebars etc. use code link "Get code".
|
20 |
|
@@ -67,12 +66,18 @@ It allows you to show custom widget areas and menu locations created with this p
|
|
67 |
|
68 |
== Screenshots ==
|
69 |
|
70 |
-
1.
|
71 |
-
2.
|
72 |
-
3.
|
73 |
|
74 |
== Changelog ==
|
75 |
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
= 1.1.0 =
|
77 |
* added new menu location feature
|
78 |
* design update
|
@@ -98,6 +103,12 @@ It allows you to show custom widget areas and menu locations created with this p
|
|
98 |
|
99 |
== Upgrade Notice ==
|
100 |
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
= 1.1.0 =
|
102 |
* added new menu location feature
|
103 |
* design update
|
1 |
=== Plugin Name ===
|
2 |
Contributors: krozero
|
|
|
3 |
Tags: widget area, custom widget area, widget, simple widget area, custom sidebar, dynamic sidebar, menu, menus, custom menu, custom menu locations, menu location, menu area
|
4 |
Requires at least: 3.0.1
|
5 |
Tested up to: 4.2.2
|
6 |
+
Stable tag: 1.1.2
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
13 |
|
14 |
== Description ==
|
15 |
|
16 |
+
A Wordpress Plugin that makes it very simple and easy to create a custom widget areas, sidebars and Menu locations. With the help of this plugin you can create multiple custom widget areas, menu locations and use it wherever you want to show in your site.
|
17 |
|
18 |
It allows you to show custom widget areas and menu locations created with this plugin in any part of your site (i.e, as sidebars, bottom widget areas , in header and plus with this plugin now you can also show it in your pages and posts contents.) There's two way of using this plugins. To show it in posts or pages content use shortcode link "Get shortcode" and for other like to show as sidebars etc. use code link "Get code".
|
19 |
|
66 |
|
67 |
== Screenshots ==
|
68 |
|
69 |
+
1. Custom widget area basic view.
|
70 |
+
2. Custom widget area advance view.
|
71 |
+
3. ** Menu locations ** create and use menus anywhere.
|
72 |
|
73 |
== Changelog ==
|
74 |
|
75 |
+
= 1.1.2 =
|
76 |
+
* database bug fix for v 1.1.0 and 1.1.1
|
77 |
+
|
78 |
+
= 1.1.1 =
|
79 |
+
* database update fix for v 1.1.0
|
80 |
+
|
81 |
= 1.1.0 =
|
82 |
* added new menu location feature
|
83 |
* design update
|
103 |
|
104 |
== Upgrade Notice ==
|
105 |
|
106 |
+
= 1.1.2 =
|
107 |
+
* database bug fix for v 1.1.0 and 1.1.1
|
108 |
+
|
109 |
+
= 1.1.1 =
|
110 |
+
* database update fix for v 1.1.0
|
111 |
+
|
112 |
= 1.1.0 =
|
113 |
* added new menu location feature
|
114 |
* design update
|
admin/class-wp-custom-widget-area-admin.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* The dashboard-specific functionality of the plugin.
|
5 |
*
|
6 |
* @link http://example.com
|
7 |
-
* @since 1.1.
|
8 |
*
|
9 |
* @package Custom_Widget_Area
|
10 |
* @subpackage Custom_Widget_Area/admin
|
@@ -28,7 +28,7 @@ class Custom_Widget_Area_Admin {
|
|
28 |
/**
|
29 |
* The ID of this plugin.
|
30 |
*
|
31 |
-
* @since 1.1.
|
32 |
* @access private
|
33 |
* @var string $plugin_name The ID of this plugin.
|
34 |
*/
|
@@ -37,7 +37,7 @@ class Custom_Widget_Area_Admin {
|
|
37 |
/**
|
38 |
* The version of this plugin.
|
39 |
*
|
40 |
-
* @since 1.1.
|
41 |
* @access private
|
42 |
* @var string $version The current version of this plugin.
|
43 |
*/
|
@@ -46,7 +46,7 @@ class Custom_Widget_Area_Admin {
|
|
46 |
/**
|
47 |
* Initialize the class and set its properties.
|
48 |
*
|
49 |
-
* @since 1.1.
|
50 |
* @var string $plugin_name The name of this plugin.
|
51 |
* @var string $version The version of this plugin.
|
52 |
*/
|
@@ -355,7 +355,7 @@ class Custom_Widget_Area_Admin {
|
|
355 |
/**
|
356 |
* Register the stylesheets for the Dashboard.
|
357 |
*
|
358 |
-
* @since 1.1.
|
359 |
*/
|
360 |
public function enqueue_styles() {
|
361 |
|
@@ -378,7 +378,7 @@ class Custom_Widget_Area_Admin {
|
|
378 |
/**
|
379 |
* Register the JavaScript for the dashboard.
|
380 |
*
|
381 |
-
* @since 1.1.
|
382 |
*/
|
383 |
public function enqueue_scripts() {
|
384 |
|
4 |
* The dashboard-specific functionality of the plugin.
|
5 |
*
|
6 |
* @link http://example.com
|
7 |
+
* @since 1.1.2
|
8 |
*
|
9 |
* @package Custom_Widget_Area
|
10 |
* @subpackage Custom_Widget_Area/admin
|
28 |
/**
|
29 |
* The ID of this plugin.
|
30 |
*
|
31 |
+
* @since 1.1.2
|
32 |
* @access private
|
33 |
* @var string $plugin_name The ID of this plugin.
|
34 |
*/
|
37 |
/**
|
38 |
* The version of this plugin.
|
39 |
*
|
40 |
+
* @since 1.1.2
|
41 |
* @access private
|
42 |
* @var string $version The current version of this plugin.
|
43 |
*/
|
46 |
/**
|
47 |
* Initialize the class and set its properties.
|
48 |
*
|
49 |
+
* @since 1.1.2
|
50 |
* @var string $plugin_name The name of this plugin.
|
51 |
* @var string $version The version of this plugin.
|
52 |
*/
|
355 |
/**
|
356 |
* Register the stylesheets for the Dashboard.
|
357 |
*
|
358 |
+
* @since 1.1.2
|
359 |
*/
|
360 |
public function enqueue_styles() {
|
361 |
|
378 |
/**
|
379 |
* Register the JavaScript for the dashboard.
|
380 |
*
|
381 |
+
* @since 1.1.2
|
382 |
*/
|
383 |
public function enqueue_scripts() {
|
384 |
|
admin/partials/cwa-admin-display.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
* This file is used to markup the public-facing aspects of the plugin.
|
7 |
*
|
8 |
* @link http://example.com
|
9 |
-
* @since 1.1.
|
10 |
*
|
11 |
* @package Custom_Widget_Area
|
12 |
* @subpackage Custom_Widget_Area/admin/partials
|
6 |
* This file is used to markup the public-facing aspects of the plugin.
|
7 |
*
|
8 |
* @link http://example.com
|
9 |
+
* @since 1.1.2
|
10 |
*
|
11 |
* @package Custom_Widget_Area
|
12 |
* @subpackage Custom_Widget_Area/admin/partials
|
admin/partials/cwa-menu-admin-display.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
* This file is used to markup the public-facing aspects of the plugin.
|
7 |
*
|
8 |
* @link http://example.com
|
9 |
-
* @since 1.1.
|
10 |
*
|
11 |
* @package Custom_Widget_Area
|
12 |
* @subpackage Custom_Widget_Area/admin/partials
|
6 |
* This file is used to markup the public-facing aspects of the plugin.
|
7 |
*
|
8 |
* @link http://example.com
|
9 |
+
* @since 1.1.2
|
10 |
*
|
11 |
* @package Custom_Widget_Area
|
12 |
* @subpackage Custom_Widget_Area/admin/partials
|
includes/class-custom-widget-area.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* public-facing side of the site and the dashboard.
|
8 |
*
|
9 |
* @link http://example.com
|
10 |
-
* @since 1.1.
|
11 |
*
|
12 |
* @package Custom_Widget_Area
|
13 |
* @subpackage Custom_Widget_Area/includes
|
@@ -22,7 +22,7 @@
|
|
22 |
* Also maintains the unique identifier of this plugin as well as the current
|
23 |
* version of the plugin.
|
24 |
*
|
25 |
-
* @since 1.1.
|
26 |
* @package Custom_Widget_Area
|
27 |
* @subpackage Custom_Widget_Area/includes
|
28 |
* @author Your Name <email@example.com>
|
@@ -33,7 +33,7 @@ class Custom_Widget_Area {
|
|
33 |
* The loader that's responsible for maintaining and registering all hooks that power
|
34 |
* the plugin.
|
35 |
*
|
36 |
-
* @since 1.1.
|
37 |
* @access protected
|
38 |
* @var Custom_Widget_Area_Loader $loader Maintains and registers all hooks for the plugin.
|
39 |
*/
|
@@ -42,7 +42,7 @@ class Custom_Widget_Area {
|
|
42 |
/**
|
43 |
* The unique identifier of this plugin.
|
44 |
*
|
45 |
-
* @since 1.1.
|
46 |
* @access protected
|
47 |
* @var string $plugin_name The string used to uniquely identify this plugin.
|
48 |
*/
|
@@ -51,7 +51,7 @@ class Custom_Widget_Area {
|
|
51 |
/**
|
52 |
* The current version of the plugin.
|
53 |
*
|
54 |
-
* @since 1.1.
|
55 |
* @access protected
|
56 |
* @var string $version The current version of the plugin.
|
57 |
*/
|
@@ -64,12 +64,12 @@ class Custom_Widget_Area {
|
|
64 |
* Load the dependencies, define the locale, and set the hooks for the Dashboard and
|
65 |
* the public-facing side of the site.
|
66 |
*
|
67 |
-
* @since 1.1.
|
68 |
*/
|
69 |
public function __construct() {
|
70 |
|
71 |
$this->plugin_name = 'wp-custom-widget-area';
|
72 |
-
$this->version = '1.1.
|
73 |
|
74 |
$this->load_dependencies();
|
75 |
$this->set_locale();
|
@@ -91,7 +91,7 @@ class Custom_Widget_Area {
|
|
91 |
* Create an instance of the loader which will be used to register the hooks
|
92 |
* with WordPress.
|
93 |
*
|
94 |
-
* @since 1.1.
|
95 |
* @access private
|
96 |
*/
|
97 |
private function load_dependencies() {
|
@@ -125,7 +125,7 @@ class Custom_Widget_Area {
|
|
125 |
* Uses the Custom_Widget_Area_i18n class in order to set the domain and to register the hook
|
126 |
* with WordPress.
|
127 |
*
|
128 |
-
* @since 1.1.
|
129 |
* @access private
|
130 |
*/
|
131 |
private function set_locale() {
|
@@ -141,7 +141,7 @@ class Custom_Widget_Area {
|
|
141 |
* Register all of the hooks related to the dashboard functionality
|
142 |
* of the plugin.
|
143 |
*
|
144 |
-
* @since 1.1.
|
145 |
* @access private
|
146 |
*/
|
147 |
private function define_admin_hooks() {
|
@@ -188,7 +188,7 @@ class Custom_Widget_Area {
|
|
188 |
/**
|
189 |
* Run the loader to execute all of the hooks with WordPress.
|
190 |
*
|
191 |
-
* @since 1.1.
|
192 |
*/
|
193 |
public function run() {
|
194 |
$this->loader->run();
|
@@ -198,7 +198,7 @@ class Custom_Widget_Area {
|
|
198 |
* The name of the plugin used to uniquely identify it within the context of
|
199 |
* WordPress and to define internationalization functionality.
|
200 |
*
|
201 |
-
* @since 1.1.
|
202 |
* @return string The name of the plugin.
|
203 |
*/
|
204 |
public function get_plugin_name() {
|
@@ -208,7 +208,7 @@ class Custom_Widget_Area {
|
|
208 |
/**
|
209 |
* The reference to the class that orchestrates the hooks with the plugin.
|
210 |
*
|
211 |
-
* @since 1.1.
|
212 |
* @return Custom_Widget_Area_Loader Orchestrates the hooks of the plugin.
|
213 |
*/
|
214 |
public function get_loader() {
|
@@ -218,7 +218,7 @@ class Custom_Widget_Area {
|
|
218 |
/**
|
219 |
* Retrieve the version number of the plugin.
|
220 |
*
|
221 |
-
* @since 1.1.
|
222 |
* @return string The version number of the plugin.
|
223 |
*/
|
224 |
public function get_version() {
|
7 |
* public-facing side of the site and the dashboard.
|
8 |
*
|
9 |
* @link http://example.com
|
10 |
+
* @since 1.1.2
|
11 |
*
|
12 |
* @package Custom_Widget_Area
|
13 |
* @subpackage Custom_Widget_Area/includes
|
22 |
* Also maintains the unique identifier of this plugin as well as the current
|
23 |
* version of the plugin.
|
24 |
*
|
25 |
+
* @since 1.1.2
|
26 |
* @package Custom_Widget_Area
|
27 |
* @subpackage Custom_Widget_Area/includes
|
28 |
* @author Your Name <email@example.com>
|
33 |
* The loader that's responsible for maintaining and registering all hooks that power
|
34 |
* the plugin.
|
35 |
*
|
36 |
+
* @since 1.1.2
|
37 |
* @access protected
|
38 |
* @var Custom_Widget_Area_Loader $loader Maintains and registers all hooks for the plugin.
|
39 |
*/
|
42 |
/**
|
43 |
* The unique identifier of this plugin.
|
44 |
*
|
45 |
+
* @since 1.1.2
|
46 |
* @access protected
|
47 |
* @var string $plugin_name The string used to uniquely identify this plugin.
|
48 |
*/
|
51 |
/**
|
52 |
* The current version of the plugin.
|
53 |
*
|
54 |
+
* @since 1.1.2
|
55 |
* @access protected
|
56 |
* @var string $version The current version of the plugin.
|
57 |
*/
|
64 |
* Load the dependencies, define the locale, and set the hooks for the Dashboard and
|
65 |
* the public-facing side of the site.
|
66 |
*
|
67 |
+
* @since 1.1.2
|
68 |
*/
|
69 |
public function __construct() {
|
70 |
|
71 |
$this->plugin_name = 'wp-custom-widget-area';
|
72 |
+
$this->version = '1.1.2';
|
73 |
|
74 |
$this->load_dependencies();
|
75 |
$this->set_locale();
|
91 |
* Create an instance of the loader which will be used to register the hooks
|
92 |
* with WordPress.
|
93 |
*
|
94 |
+
* @since 1.1.2
|
95 |
* @access private
|
96 |
*/
|
97 |
private function load_dependencies() {
|
125 |
* Uses the Custom_Widget_Area_i18n class in order to set the domain and to register the hook
|
126 |
* with WordPress.
|
127 |
*
|
128 |
+
* @since 1.1.2
|
129 |
* @access private
|
130 |
*/
|
131 |
private function set_locale() {
|
141 |
* Register all of the hooks related to the dashboard functionality
|
142 |
* of the plugin.
|
143 |
*
|
144 |
+
* @since 1.1.2
|
145 |
* @access private
|
146 |
*/
|
147 |
private function define_admin_hooks() {
|
188 |
/**
|
189 |
* Run the loader to execute all of the hooks with WordPress.
|
190 |
*
|
191 |
+
* @since 1.1.2
|
192 |
*/
|
193 |
public function run() {
|
194 |
$this->loader->run();
|
198 |
* The name of the plugin used to uniquely identify it within the context of
|
199 |
* WordPress and to define internationalization functionality.
|
200 |
*
|
201 |
+
* @since 1.1.2
|
202 |
* @return string The name of the plugin.
|
203 |
*/
|
204 |
public function get_plugin_name() {
|
208 |
/**
|
209 |
* The reference to the class that orchestrates the hooks with the plugin.
|
210 |
*
|
211 |
+
* @since 1.1.2
|
212 |
* @return Custom_Widget_Area_Loader Orchestrates the hooks of the plugin.
|
213 |
*/
|
214 |
public function get_loader() {
|
218 |
/**
|
219 |
* Retrieve the version number of the plugin.
|
220 |
*
|
221 |
+
* @since 1.1.2
|
222 |
* @return string The version number of the plugin.
|
223 |
*/
|
224 |
public function get_version() {
|
includes/class-wp-custom-widget-area-activator.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Fired during plugin activation
|
5 |
*
|
6 |
* @link http://example.com
|
7 |
-
* @since 1.1.
|
8 |
*
|
9 |
* @package Custom_Widget_Area
|
10 |
* @subpackage Custom_Widget_Area/includes
|
@@ -15,7 +15,7 @@
|
|
15 |
*
|
16 |
* This class defines all code necessary to run during the plugin's activation.
|
17 |
*
|
18 |
-
* @since 1.1.
|
19 |
* @package Custom_Widget_Area
|
20 |
* @subpackage Custom_Widget_Area/includes
|
21 |
* @author Your Name <email@example.com>
|
@@ -27,7 +27,7 @@ class Custom_Widget_Area_Activator {
|
|
27 |
*
|
28 |
* Long Description.
|
29 |
*
|
30 |
-
* @since 1.1.
|
31 |
*/
|
32 |
public static function activate() {
|
33 |
|
@@ -36,10 +36,7 @@ class Custom_Widget_Area_Activator {
|
|
36 |
}
|
37 |
|
38 |
private function install_db(){
|
39 |
-
global $wpdb;
|
40 |
-
$kz_db_version = '1.0';
|
41 |
-
$table_name = $wpdb->prefix . 'cwa';
|
42 |
-
$charset_collate = '';
|
43 |
|
44 |
if ( ! empty( $wpdb->charset ) ) {
|
45 |
$charset_collate = "DEFAULT CHARACTER SET {$wpdb->charset}";
|
@@ -66,7 +63,11 @@ class Custom_Widget_Area_Activator {
|
|
66 |
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
67 |
dbDelta( $sql );
|
68 |
|
69 |
-
|
|
|
|
|
|
|
|
|
70 |
}
|
71 |
|
72 |
}
|
4 |
* Fired during plugin activation
|
5 |
*
|
6 |
* @link http://example.com
|
7 |
+
* @since 1.1.2
|
8 |
*
|
9 |
* @package Custom_Widget_Area
|
10 |
* @subpackage Custom_Widget_Area/includes
|
15 |
*
|
16 |
* This class defines all code necessary to run during the plugin's activation.
|
17 |
*
|
18 |
+
* @since 1.1.2
|
19 |
* @package Custom_Widget_Area
|
20 |
* @subpackage Custom_Widget_Area/includes
|
21 |
* @author Your Name <email@example.com>
|
27 |
*
|
28 |
* Long Description.
|
29 |
*
|
30 |
+
* @since 1.1.2
|
31 |
*/
|
32 |
public static function activate() {
|
33 |
|
36 |
}
|
37 |
|
38 |
private function install_db(){
|
39 |
+
global $wpdb, $kz_db_version, $table_name, $charset_collate;
|
|
|
|
|
|
|
40 |
|
41 |
if ( ! empty( $wpdb->charset ) ) {
|
42 |
$charset_collate = "DEFAULT CHARACTER SET {$wpdb->charset}";
|
63 |
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
64 |
dbDelta( $sql );
|
65 |
|
66 |
+
if ( get_option('kz_db_version') != $kz_db_version ) {
|
67 |
+
update_option( 'kz_db_version', $kz_db_version );
|
68 |
+
}else{
|
69 |
+
add_option( 'kz_db_version', $kz_db_version );
|
70 |
+
}
|
71 |
}
|
72 |
|
73 |
}
|
includes/class-wp-custom-widget-area-deactivator.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Fired during plugin deactivation
|
5 |
*
|
6 |
* @link http://example.com
|
7 |
-
* @since 1.1.
|
8 |
*
|
9 |
* @package Custom_Widget_Area
|
10 |
* @subpackage Custom_Widget_Area/includes
|
@@ -15,7 +15,7 @@
|
|
15 |
*
|
16 |
* This class defines all code necessary to run during the plugin's deactivation.
|
17 |
*
|
18 |
-
* @since 1.1.
|
19 |
* @package Custom_Widget_Area
|
20 |
* @subpackage Custom_Widget_Area/includes
|
21 |
* @author Your Name <email@example.com>
|
@@ -27,7 +27,7 @@ class Custom_Widget_Area_Deactivator {
|
|
27 |
*
|
28 |
* Long Description.
|
29 |
*
|
30 |
-
* @since 1.1.
|
31 |
*/
|
32 |
public static function deactivate() {
|
33 |
|
4 |
* Fired during plugin deactivation
|
5 |
*
|
6 |
* @link http://example.com
|
7 |
+
* @since 1.1.2
|
8 |
*
|
9 |
* @package Custom_Widget_Area
|
10 |
* @subpackage Custom_Widget_Area/includes
|
15 |
*
|
16 |
* This class defines all code necessary to run during the plugin's deactivation.
|
17 |
*
|
18 |
+
* @since 1.1.2
|
19 |
* @package Custom_Widget_Area
|
20 |
* @subpackage Custom_Widget_Area/includes
|
21 |
* @author Your Name <email@example.com>
|
27 |
*
|
28 |
* Long Description.
|
29 |
*
|
30 |
+
* @since 1.1.2
|
31 |
*/
|
32 |
public static function deactivate() {
|
33 |
|
includes/class-wp-custom-widget-area-i18n.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* so that its ready for translation.
|
8 |
*
|
9 |
* @link http://example.com
|
10 |
-
* @since 1.1.
|
11 |
*
|
12 |
* @package Custom_Widget_Area
|
13 |
* @subpackage Custom_Widget_Area/includes
|
@@ -19,7 +19,7 @@
|
|
19 |
* Loads and defines the internationalization files for this plugin
|
20 |
* so that its ready for translation.
|
21 |
*
|
22 |
-
* @since 1.1.
|
23 |
* @package Custom_Widget_Area
|
24 |
* @subpackage Custom_Widget_Area/includes
|
25 |
* @author Your Name <email@example.com>
|
@@ -29,7 +29,7 @@ class Custom_Widget_Area_i18n {
|
|
29 |
/**
|
30 |
* The domain specified for this plugin.
|
31 |
*
|
32 |
-
* @since 1.1.
|
33 |
* @access private
|
34 |
* @var string $domain The domain identifier for this plugin.
|
35 |
*/
|
@@ -38,7 +38,7 @@ class Custom_Widget_Area_i18n {
|
|
38 |
/**
|
39 |
* Load the plugin text domain for translation.
|
40 |
*
|
41 |
-
* @since 1.1.
|
42 |
*/
|
43 |
public function load_plugin_textdomain() {
|
44 |
|
@@ -53,7 +53,7 @@ class Custom_Widget_Area_i18n {
|
|
53 |
/**
|
54 |
* Set the domain equal to that of the specified domain.
|
55 |
*
|
56 |
-
* @since 1.1.
|
57 |
* @param string $domain The domain that represents the locale of this plugin.
|
58 |
*/
|
59 |
public function set_domain( $domain ) {
|
7 |
* so that its ready for translation.
|
8 |
*
|
9 |
* @link http://example.com
|
10 |
+
* @since 1.1.2
|
11 |
*
|
12 |
* @package Custom_Widget_Area
|
13 |
* @subpackage Custom_Widget_Area/includes
|
19 |
* Loads and defines the internationalization files for this plugin
|
20 |
* so that its ready for translation.
|
21 |
*
|
22 |
+
* @since 1.1.2
|
23 |
* @package Custom_Widget_Area
|
24 |
* @subpackage Custom_Widget_Area/includes
|
25 |
* @author Your Name <email@example.com>
|
29 |
/**
|
30 |
* The domain specified for this plugin.
|
31 |
*
|
32 |
+
* @since 1.1.2
|
33 |
* @access private
|
34 |
* @var string $domain The domain identifier for this plugin.
|
35 |
*/
|
38 |
/**
|
39 |
* Load the plugin text domain for translation.
|
40 |
*
|
41 |
+
* @since 1.1.2
|
42 |
*/
|
43 |
public function load_plugin_textdomain() {
|
44 |
|
53 |
/**
|
54 |
* Set the domain equal to that of the specified domain.
|
55 |
*
|
56 |
+
* @since 1.1.2
|
57 |
* @param string $domain The domain that represents the locale of this plugin.
|
58 |
*/
|
59 |
public function set_domain( $domain ) {
|
includes/class-wp-custom-widget-area-loader.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Register all actions and filters for the plugin
|
5 |
*
|
6 |
* @link http://example.com
|
7 |
-
* @since 1.1.
|
8 |
*
|
9 |
* @package Custom_Widget_Area
|
10 |
* @subpackage Custom_Widget_Area/includes
|
@@ -26,7 +26,7 @@ class Custom_Widget_Area_Loader {
|
|
26 |
/**
|
27 |
* The array of actions registered with WordPress.
|
28 |
*
|
29 |
-
* @since 1.1.
|
30 |
* @access protected
|
31 |
* @var array $actions The actions registered with WordPress to fire when the plugin loads.
|
32 |
*/
|
@@ -35,7 +35,7 @@ class Custom_Widget_Area_Loader {
|
|
35 |
/**
|
36 |
* The array of filters registered with WordPress.
|
37 |
*
|
38 |
-
* @since 1.1.
|
39 |
* @access protected
|
40 |
* @var array $filters The filters registered with WordPress to fire when the plugin loads.
|
41 |
*/
|
@@ -44,7 +44,7 @@ class Custom_Widget_Area_Loader {
|
|
44 |
/**
|
45 |
* Initialize the collections used to maintain the actions and filters.
|
46 |
*
|
47 |
-
* @since 1.1.
|
48 |
*/
|
49 |
public function __construct() {
|
50 |
|
@@ -56,7 +56,7 @@ class Custom_Widget_Area_Loader {
|
|
56 |
/**
|
57 |
* Add a new action to the collection to be registered with WordPress.
|
58 |
*
|
59 |
-
* @since 1.1.
|
60 |
* @var string $hook The name of the WordPress action that is being registered.
|
61 |
* @var object $component A reference to the instance of the object on which the action is defined.
|
62 |
* @var string $callback The name of the function definition on the $component.
|
@@ -70,7 +70,7 @@ class Custom_Widget_Area_Loader {
|
|
70 |
/**
|
71 |
* Add a new filter to the collection to be registered with WordPress.
|
72 |
*
|
73 |
-
* @since 1.1.
|
74 |
* @var string $hook The name of the WordPress filter that is being registered.
|
75 |
* @var object $component A reference to the instance of the object on which the filter is defined.
|
76 |
* @var string $callback The name of the function definition on the $component.
|
@@ -85,7 +85,7 @@ class Custom_Widget_Area_Loader {
|
|
85 |
* A utility function that is used to register the actions and hooks into a single
|
86 |
* collection.
|
87 |
*
|
88 |
-
* @since 1.1.
|
89 |
* @access private
|
90 |
* @var array $hooks The collection of hooks that is being registered (that is, actions or filters).
|
91 |
* @var string $hook The name of the WordPress filter that is being registered.
|
@@ -112,7 +112,7 @@ class Custom_Widget_Area_Loader {
|
|
112 |
/**
|
113 |
* Register the filters and actions with WordPress.
|
114 |
*
|
115 |
-
* @since 1.1.
|
116 |
*/
|
117 |
public function run() {
|
118 |
|
4 |
* Register all actions and filters for the plugin
|
5 |
*
|
6 |
* @link http://example.com
|
7 |
+
* @since 1.1.2
|
8 |
*
|
9 |
* @package Custom_Widget_Area
|
10 |
* @subpackage Custom_Widget_Area/includes
|
26 |
/**
|
27 |
* The array of actions registered with WordPress.
|
28 |
*
|
29 |
+
* @since 1.1.2
|
30 |
* @access protected
|
31 |
* @var array $actions The actions registered with WordPress to fire when the plugin loads.
|
32 |
*/
|
35 |
/**
|
36 |
* The array of filters registered with WordPress.
|
37 |
*
|
38 |
+
* @since 1.1.2
|
39 |
* @access protected
|
40 |
* @var array $filters The filters registered with WordPress to fire when the plugin loads.
|
41 |
*/
|
44 |
/**
|
45 |
* Initialize the collections used to maintain the actions and filters.
|
46 |
*
|
47 |
+
* @since 1.1.2
|
48 |
*/
|
49 |
public function __construct() {
|
50 |
|
56 |
/**
|
57 |
* Add a new action to the collection to be registered with WordPress.
|
58 |
*
|
59 |
+
* @since 1.1.2
|
60 |
* @var string $hook The name of the WordPress action that is being registered.
|
61 |
* @var object $component A reference to the instance of the object on which the action is defined.
|
62 |
* @var string $callback The name of the function definition on the $component.
|
70 |
/**
|
71 |
* Add a new filter to the collection to be registered with WordPress.
|
72 |
*
|
73 |
+
* @since 1.1.2
|
74 |
* @var string $hook The name of the WordPress filter that is being registered.
|
75 |
* @var object $component A reference to the instance of the object on which the filter is defined.
|
76 |
* @var string $callback The name of the function definition on the $component.
|
85 |
* A utility function that is used to register the actions and hooks into a single
|
86 |
* collection.
|
87 |
*
|
88 |
+
* @since 1.1.2
|
89 |
* @access private
|
90 |
* @var array $hooks The collection of hooks that is being registered (that is, actions or filters).
|
91 |
* @var string $hook The name of the WordPress filter that is being registered.
|
112 |
/**
|
113 |
* Register the filters and actions with WordPress.
|
114 |
*
|
115 |
+
* @since 1.1.2
|
116 |
*/
|
117 |
public function run() {
|
118 |
|
includes/config.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/*plugin configs*/
|
3 |
-
$kz_db_version = '1.1.
|
4 |
$table_name = $wpdb->prefix . 'cwa';
|
5 |
$charset_collate = '';
|
6 |
?>
|
1 |
<?php
|
2 |
/*plugin configs*/
|
3 |
+
$kz_db_version = '1.1.2';
|
4 |
$table_name = $wpdb->prefix . 'cwa';
|
5 |
$charset_collate = '';
|
6 |
?>
|
uninstall.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
* https://github.com/tommcfarlin/WordPress-Plugin-Boilerplate/pull/123#issuecomment-28541913
|
21 |
*
|
22 |
* @link http://example.com
|
23 |
-
* @since 1.1.
|
24 |
*
|
25 |
* @package Custom_Widget_Area
|
26 |
*/
|
20 |
* https://github.com/tommcfarlin/WordPress-Plugin-Boilerplate/pull/123#issuecomment-28541913
|
21 |
*
|
22 |
* @link http://example.com
|
23 |
+
* @since 1.1.2
|
24 |
*
|
25 |
* @package Custom_Widget_Area
|
26 |
*/
|
wp-custom-widget-area.php
CHANGED
@@ -16,7 +16,7 @@
|
|
16 |
* Plugin Name: WP Custom Widget area
|
17 |
* Plugin URI: http://kishorkhambu.com.np/plugins/
|
18 |
* Description: A wordpress plugin to create custom dynamic widget area.
|
19 |
-
* Version: 1.1.
|
20 |
* Author: Kishor Khambu
|
21 |
* Author URI: http://kishorkhambu.com.np
|
22 |
* License: GPL-2.0+
|
@@ -41,6 +41,8 @@ require_once plugin_dir_path( __FILE__ ) . 'includes/class-wp-custom-widget-area
|
|
41 |
*/
|
42 |
require_once plugin_dir_path( __FILE__ ) . 'includes/class-wp-custom-widget-area-deactivator.php';
|
43 |
|
|
|
|
|
44 |
/** This action is documented in includes/class-wp-custom-widget-area-activator.php */
|
45 |
register_activation_hook( __FILE__, array( 'Custom_Widget_Area_Activator', 'activate' ) );
|
46 |
|
@@ -60,7 +62,7 @@ require_once plugin_dir_path( __FILE__ ) . 'includes/class-custom-widget-area.ph
|
|
60 |
* then kicking off the plugin from this point in the file does
|
61 |
* not affect the page life cycle.
|
62 |
*
|
63 |
-
* @since 1.1.
|
64 |
*/
|
65 |
function run_plugin_name() {
|
66 |
$plugin = new Custom_Widget_Area();
|
@@ -71,4 +73,48 @@ run_plugin_name();
|
|
71 |
|
72 |
function cb(){
|
73 |
echo "welcome to first metabox showcase";
|
74 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
* Plugin Name: WP Custom Widget area
|
17 |
* Plugin URI: http://kishorkhambu.com.np/plugins/
|
18 |
* Description: A wordpress plugin to create custom dynamic widget area.
|
19 |
+
* Version: 1.1.2
|
20 |
* Author: Kishor Khambu
|
21 |
* Author URI: http://kishorkhambu.com.np
|
22 |
* License: GPL-2.0+
|
41 |
*/
|
42 |
require_once plugin_dir_path( __FILE__ ) . 'includes/class-wp-custom-widget-area-deactivator.php';
|
43 |
|
44 |
+
|
45 |
+
|
46 |
/** This action is documented in includes/class-wp-custom-widget-area-activator.php */
|
47 |
register_activation_hook( __FILE__, array( 'Custom_Widget_Area_Activator', 'activate' ) );
|
48 |
|
62 |
* then kicking off the plugin from this point in the file does
|
63 |
* not affect the page life cycle.
|
64 |
*
|
65 |
+
* @since 1.1.2
|
66 |
*/
|
67 |
function run_plugin_name() {
|
68 |
$plugin = new Custom_Widget_Area();
|
73 |
|
74 |
function cb(){
|
75 |
echo "welcome to first metabox showcase";
|
76 |
+
}
|
77 |
+
|
78 |
+
|
79 |
+
// db fix for new version
|
80 |
+
/*function db_update(){
|
81 |
+
global $wpdb;
|
82 |
+
$table_name = 'wp_cwa';
|
83 |
+
if( (phpversion() < 5.4 && !!! session_id()) || (phpversion() > 5.3 && !!!session_status() == PHP_SESSION_NONE))
|
84 |
+
session_start();
|
85 |
+
|
86 |
+
if(!isset($_SESSION['db_update'])){
|
87 |
+
$row = $wpdb->get_results( "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
|
88 |
+
WHERE table_name = '$table_name' AND column_name = 'cwa_type'" );
|
89 |
+
|
90 |
+
if(empty($row)){
|
91 |
+
$wpdb->query("ALTER TABLE $table_name ADD cwa_type varchar (10) ");
|
92 |
+
$updaterow = $wpdb->get_results( "SELECT id FROM $table_name");
|
93 |
+
foreach ($updaterow as $data) {
|
94 |
+
# code...
|
95 |
+
$up = $wpdb->update($table_name, array('cwa_type'=> 'widget'), array('id'=>$data->id));
|
96 |
+
}
|
97 |
+
}
|
98 |
+
$_SESSION['db_update'] = true;
|
99 |
+
}
|
100 |
+
|
101 |
+
}
|
102 |
+
|
103 |
+
db_update();*/
|
104 |
+
|
105 |
+
|
106 |
+
function myplugin_update_db_check() {
|
107 |
+
global $kz_db_version, $wpdb, $table_name;
|
108 |
+
if ( get_site_option( 'kz_db_version' ) != $kz_db_version ) {
|
109 |
+
Custom_Widget_Area_Activator::activate();
|
110 |
+
$x = $wpdb->query("ALTER TABLE $table_name ADD cwa_type varchar (10) ");
|
111 |
+
$updaterow = $wpdb->get_results( "SELECT id FROM $table_name");
|
112 |
+
foreach ($updaterow as $data) {
|
113 |
+
# code...
|
114 |
+
$up = $wpdb->update($table_name, array('cwa_type'=> 'widget'), array('id'=>$data->id));
|
115 |
+
}
|
116 |
+
}
|
117 |
+
}
|
118 |
+
add_action( 'plugins_loaded', 'myplugin_update_db_check' );
|
119 |
+
|
120 |
+
|