Customify – A Theme Customizer Booster - Version 1.2.7

Version Description

  • Added capability to control the Jetpack Sharing default options
Download this release

Release Info

Developer vlad.olaru
Plugin Icon Customify – A Theme Customizer Booster
Version 1.2.7
Comparing to
See all releases

Code changes from version 1.2.5 to 1.2.7

Files changed (3) hide show
  1. class-pixcustomify.php +75 -1
  2. customify.php +1 -1
  3. readme.txt +7 -1
class-pixcustomify.php CHANGED
@@ -20,7 +20,7 @@ class PixCustomifyPlugin {
20
  * @since 1.0.0
21
  * @const string
22
  */
23
- protected $version = '1.2.5';
24
  /**
25
  * Unique identifier for your plugin.
26
  * Use this value (not the variable name) as the text domain when internationalizing strings of text. It should
@@ -113,6 +113,10 @@ class PixCustomifyPlugin {
113
  'border-top-width'
114
  );
115
 
 
 
 
 
116
  /**
117
  * Initialize the plugin by setting localization, filters, and administration functions.
118
  * @since 1.0.0
@@ -127,6 +131,7 @@ class PixCustomifyPlugin {
127
 
128
  // Load plugin text domain
129
  add_action( 'init', array( $this, 'load_plugin_textdomain' ) );
 
130
  add_action( 'wp_loaded', array( $this, 'init_plugin_configs' ), 5 );
131
 
132
  add_action( 'admin_menu', array( $this, 'add_plugin_admin_menu' ) );
@@ -160,6 +165,11 @@ class PixCustomifyPlugin {
160
  add_action( 'admin_head', array( $this, 'add_customizer_settings_into_wp_editor' ) );
161
  }
162
 
 
 
 
 
 
163
  /**
164
  * Ajax Callbacks
165
  */
@@ -217,6 +227,70 @@ class PixCustomifyPlugin {
217
  include_once( self::get_base_path() . '/features/class-CSS_Editor.php' );
218
  }
219
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
220
  protected static function check_for_customizer_values() {
221
  if ( isset( $_POST['customized'] ) && $_POST['customized'] !== '{}' ) {
222
  $the_value = $_POST['customized'];
20
  * @since 1.0.0
21
  * @const string
22
  */
23
+ protected $version = '1.2.7';
24
  /**
25
  * Unique identifier for your plugin.
26
  * Use this value (not the variable name) as the text domain when internationalizing strings of text. It should
113
  'border-top-width'
114
  );
115
 
116
+ protected static $jetpack_default_modules = array();
117
+ protected static $jetpack_blocked_modules = array();
118
+ protected static $jetpack_sharing_default_options = array();
119
+
120
  /**
121
  * Initialize the plugin by setting localization, filters, and administration functions.
122
  * @since 1.0.0
131
 
132
  // Load plugin text domain
133
  add_action( 'init', array( $this, 'load_plugin_textdomain' ) );
134
+
135
  add_action( 'wp_loaded', array( $this, 'init_plugin_configs' ), 5 );
136
 
137
  add_action( 'admin_menu', array( $this, 'add_plugin_admin_menu' ) );
165
  add_action( 'admin_head', array( $this, 'add_customizer_settings_into_wp_editor' ) );
166
  }
167
 
168
+ add_action( 'init', array( $this, 'set_jetpack_modules_config') );
169
+ add_filter( 'default_option_jetpack_active_modules', array( $this, 'default_jetpack_active_modules' ), 10, 2 );
170
+ add_filter( 'jetpack_get_available_modules', array( $this, 'jetpack_hide_blocked_modules'), 10, 1 );
171
+ add_filter( 'default_option_sharing-options', array( $this, 'default_jetpack_sharing_options' ), 10, 2 );
172
+
173
  /**
174
  * Ajax Callbacks
175
  */
227
  include_once( self::get_base_path() . '/features/class-CSS_Editor.php' );
228
  }
229
 
230
+ function set_jetpack_modules_config() {
231
+ // We expect an array of string module names like array( 'infinite-scroll', 'widgets' )
232
+ // See jetpack/modules/modules-heading.php for module names
233
+ self::$jetpack_default_modules = apply_filters ( 'customify_filter_jetpack_default_modules', array(
234
+ 'shortcodes',
235
+ 'widget-visibility',
236
+ 'widgets',
237
+ ) );
238
+
239
+ // We expect an array of string module names like array( 'infinite-scroll', 'widgets' )
240
+ // See jetpack/modules/modules-heading.php for module names
241
+ self::$jetpack_blocked_modules = apply_filters ( 'customify_filter_jetpack_blocked_modules', array() );
242
+
243
+ self::$jetpack_sharing_default_options = apply_filters ( 'customify_filter_jetpack_sharing_default_options', array() );
244
+ }
245
+
246
+ /**
247
+ * Control the default modules that are activated in Jetpack.
248
+ * Use the `customify_filter_jetpack_default_modules` to set your's.
249
+ *
250
+ * @param array $default The default value to return if the option does not exist
251
+ * in the database.
252
+ * @param string $option Option name.
253
+ *
254
+ * @return array
255
+ */
256
+ function default_jetpack_active_modules( $default, $option ) {
257
+ if ( ! is_array( $default ) ) {
258
+ $default = array();
259
+ }
260
+
261
+ return array_merge( $default, self::$jetpack_default_modules );
262
+ }
263
+
264
+ /**
265
+ * Control the default Jetpack Sharing options.
266
+ * Use the `customify_filter_jetpack_sharing_default_options` to set your's.
267
+ *
268
+ * @param array $default The default value to return if the option does not exist
269
+ * in the database.
270
+ * @param string $option Option name.
271
+ *
272
+ * @return array
273
+ */
274
+ function default_jetpack_sharing_options( $default, $option ) {
275
+ if ( ! is_array( $default ) ) {
276
+ $default = array();
277
+ }
278
+
279
+ return array_merge( $default, self::$jetpack_sharing_default_options );
280
+ }
281
+
282
+ /**
283
+ * Control the modules that are available in Jetpack (hide some of them).
284
+ * Use the `customify_filter_jetpack_blocked_modules` filter to set your's.
285
+ *
286
+ * @param array $modules
287
+ *
288
+ * @return array
289
+ */
290
+ function jetpack_hide_blocked_modules( $modules ) {
291
+ return array_diff_key( $modules, array_flip( self::$jetpack_blocked_modules ) );
292
+ }
293
+
294
  protected static function check_for_customizer_values() {
295
  if ( isset( $_POST['customized'] ) && $_POST['customized'] !== '{}' ) {
296
  $the_value = $_POST['customized'];
customify.php CHANGED
@@ -10,7 +10,7 @@
10
  Plugin Name: Customify
11
  Plugin URI: http://pixelgrade.com
12
  Description: A Theme Customizer Booster
13
- Version: 1.2.5
14
  Author: PixelGrade
15
  Author URI: http://pixelgrade.com
16
  Author Email: contact@pixelgrade.com
10
  Plugin Name: Customify
11
  Plugin URI: http://pixelgrade.com
12
  Description: A Theme Customizer Booster
13
+ Version: 1.2.7
14
  Author: PixelGrade
15
  Author URI: http://pixelgrade.com
16
  Author Email: contact@pixelgrade.com
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: pixelgrade, euthelup, babbardel, vlad.olaru
3
  Tags: customizer, css, editor, live, preview, customise
4
  Requires at least: 4.3.0
5
  Tested up to: 4.7.0
6
- Stable tag: 1.2.5
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -33,6 +33,12 @@ With [Customify](https://github.com/pixelgrade/customify), developers can easily
33
 
34
  == Changelog ==
35
 
 
 
 
 
 
 
36
  = 1.2.5 =
37
  * Fixed WordPress 4.7 incompatibilities
38
 
3
  Tags: customizer, css, editor, live, preview, customise
4
  Requires at least: 4.3.0
5
  Tested up to: 4.7.0
6
+ Stable tag: 1.2.7
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
33
 
34
  == Changelog ==
35
 
36
+ = 1.2.7 =
37
+ * Added capability to control the Jetpack Sharing default options
38
+
39
+ = 1.2.6 =
40
+ * Added capability to define Jetpack default and hidden modules
41
+
42
  = 1.2.5 =
43
  * Fixed WordPress 4.7 incompatibilities
44