Ocean Extra - Version 1.0.8

Version Description

  • New field in the Title tab in the metabox to add a custom color to the overlay title.
  • Improved style for the Import/Export tab.
Download this release

Release Info

Developer oceanwp
Plugin Icon 128x128 Ocean Extra
Version 1.0.8
Comparing to
See all releases

Code changes from version 1.0.7 to 1.0.8

includes/metabox/assets/ocean-metabox.js CHANGED
@@ -66,7 +66,7 @@
66
  titleMainSettings = $( '#ocean_disable_header_margin_tr, #ocean_post_title_tr, #ocean_post_subheading_tr,#ocean_post_title_style_tr'),
67
  titleStyleField = $( 'div#ocean-metabox select#ocean_post_title_style' ),
68
  titleStyleFieldVal = titleStyleField.val(),
69
- pageTitleBgSettings = $( '#ocean_post_title_background_tr,#ocean_post_title_height_tr,#ocean_post_title_bg_overlay_tr'),
70
  solidColorElements = $( '#ocean_post_title_background_color_tr');
71
 
72
  if ( titleField.val() === 'on' ) {
66
  titleMainSettings = $( '#ocean_disable_header_margin_tr, #ocean_post_title_tr, #ocean_post_subheading_tr,#ocean_post_title_style_tr'),
67
  titleStyleField = $( 'div#ocean-metabox select#ocean_post_title_style' ),
68
  titleStyleFieldVal = titleStyleField.val(),
69
+ pageTitleBgSettings = $( '#ocean_post_title_background_tr,#ocean_post_title_height_tr,#ocean_post_title_bg_overlay_tr,#ocean_post_title_bg_overlay_color_tr'),
70
  solidColorElements = $( '#ocean_post_title_background_color_tr');
71
 
72
  if ( titleField.val() === 'on' ) {
includes/metabox/metabox.php CHANGED
@@ -478,9 +478,9 @@ class Ocean_Post_Metaboxes {
478
  'on' => esc_html__( 'Disable', 'ocean-extra' ),
479
  ),
480
  ),
481
- 'add_shortcode' => array(
482
  'title' => esc_html__( 'Shortcode', 'ocean-extra' ),
483
- 'id' => $prefix . 'add_shortcode',
484
  'type' => 'text_html',
485
  'description' => esc_html__( 'Add your shortcode to be displayed before the page title.', 'ocean-extra' ),
486
  ),
@@ -554,6 +554,13 @@ class Ocean_Post_Metaboxes {
554
  ),
555
  'hidden' => true,
556
  ),
 
 
 
 
 
 
 
557
  ),
558
  );
559
 
@@ -654,7 +661,7 @@ class Ocean_Post_Metaboxes {
654
  public static function metaboxes_js() { ?>
655
 
656
  <script type="text/javascript">
657
- function calc_tab_height(){var e=jQuery("div#ocean-metabox ul.ocean-tabs");e.removeAttr("style");var t=jQuery(".ocean-tab-panel").outerHeight(),a=e.height();t>a&&e.css("height",t)}!function(e){"use strict";e(document).on("ready",function(){e("div#ocean-metabox ul.ocean-tabs a").click(function(){var t=e("#ocean-metabox ul.ocean-tabs li"),a=e(this).data("tab"),o=e("#ocean-metabox div.wp-tab-panel");return e(t).removeClass("wp-tab-active"),e(o).hide(),e(a).show(),e(this).parent("li").addClass("wp-tab-active"),!1}),e("div#ocean-metabox ul.ocean-tabs a").click(function(e){e.preventDefault(),calc_tab_height()}),e("#post-body #normal-sortables #ocean-metabox .handlediv, #post-body #normal-sortables #ocean-metabox .hndle").click(function(e){setTimeout(function(){calc_tab_height()},250)}),calc_tab_height(),e("div#ocean-metabox .ocean-mb-color-field").wpColorPicker();var t=!0,a=wp.media.editor.send.attachment;e("div#ocean-metabox .ocean-mb-uploader").click(function(o){var i=(wp.media.editor.send.attachment,e(this)),c=i.prev();return wp.media.editor.send.attachment=function(o,i){return t?void e(c).val(i.url):a.apply(this,[o,i])},wp.media.editor.open(i),!1}),e("div#ocean-metabox .add_media").on("click",function(){t=!1});var o=e("div#ocean-metabox select#ocean_disable_title"),i=e("#ocean_disable_header_margin_tr, #ocean_post_title_tr, #ocean_post_subheading_tr,#ocean_post_title_style_tr"),c=e("div#ocean-metabox select#ocean_post_title_style"),n=c.val(),l=e("#ocean_post_title_background_tr,#ocean_post_title_height_tr,#ocean_post_title_bg_overlay_tr"),r=e("#ocean_post_title_background_color_tr");"on"===o.val()?(i.hide(),l.hide(),r.hide()):i.show(),"background-image"===n?l.show():"solid-color"===n&&r.show(),o.change(function(){if("on"===e(this).val())i.hide(),l.hide(),r.hide();else{i.show();var t=c.val();"background-image"===t?l.show():"solid-color"===t&&r.show()}calc_tab_height()}),c.change(function(){l.hide(),r.hide(),"background-image"==e(this).val()?l.show():"solid-color"===e(this).val()&&r.show(),calc_tab_height()})})}(jQuery);
658
  </script>
659
 
660
  <?php }
478
  'on' => esc_html__( 'Disable', 'ocean-extra' ),
479
  ),
480
  ),
481
+ 'has_shortcode' => array(
482
  'title' => esc_html__( 'Shortcode', 'ocean-extra' ),
483
+ 'id' => $prefix . 'has_shortcode',
484
  'type' => 'text_html',
485
  'description' => esc_html__( 'Add your shortcode to be displayed before the page title.', 'ocean-extra' ),
486
  ),
554
  ),
555
  'hidden' => true,
556
  ),
557
+ 'post_title_bg_overlay_color' => array(
558
+ 'title' => esc_html__( 'Title: Background Overlay Color', 'ocean-extra' ),
559
+ 'description' => esc_html__( 'Select a color.', 'ocean-extra' ),
560
+ 'id' => $prefix .'post_title_bg_overlay_color',
561
+ 'type' => 'color',
562
+ 'hidden' => true,
563
+ ),
564
  ),
565
  );
566
 
661
  public static function metaboxes_js() { ?>
662
 
663
  <script type="text/javascript">
664
+ function calc_tab_height(){var e=jQuery("div#ocean-metabox ul.ocean-tabs");e.removeAttr("style");var t=jQuery(".ocean-tab-panel").outerHeight(),a=e.height();t>a&&e.css("height",t)}!function(e){"use strict";e(document).on("ready",function(){e("div#ocean-metabox ul.ocean-tabs a").click(function(){var t=e("#ocean-metabox ul.ocean-tabs li"),a=e(this).data("tab"),o=e("#ocean-metabox div.wp-tab-panel");return e(t).removeClass("wp-tab-active"),e(o).hide(),e(a).show(),e(this).parent("li").addClass("wp-tab-active"),!1}),e("div#ocean-metabox ul.ocean-tabs a").click(function(e){e.preventDefault(),calc_tab_height()}),e("#post-body #normal-sortables #ocean-metabox .handlediv, #post-body #normal-sortables #ocean-metabox .hndle").click(function(e){setTimeout(function(){calc_tab_height()},250)}),calc_tab_height(),e("div#ocean-metabox .ocean-mb-color-field").wpColorPicker();var t=!0,a=wp.media.editor.send.attachment;e("div#ocean-metabox .ocean-mb-uploader").click(function(o){var i=(wp.media.editor.send.attachment,e(this)),c=i.prev();return wp.media.editor.send.attachment=function(o,i){return t?void e(c).val(i.url):a.apply(this,[o,i])},wp.media.editor.open(i),!1}),e("div#ocean-metabox .add_media").on("click",function(){t=!1});var o=e("div#ocean-metabox select#ocean_disable_title"),i=e("#ocean_disable_header_margin_tr, #ocean_post_title_tr, #ocean_post_subheading_tr,#ocean_post_title_style_tr"),c=e("div#ocean-metabox select#ocean_post_title_style"),n=c.val(),l=e("#ocean_post_title_background_tr,#ocean_post_title_height_tr,#ocean_post_title_bg_overlay_tr,#ocean_post_title_bg_overlay_color_tr"),r=e("#ocean_post_title_background_color_tr");"on"===o.val()?(i.hide(),l.hide(),r.hide()):i.show(),"background-image"===n?l.show():"solid-color"===n&&r.show(),o.change(function(){if("on"===e(this).val())i.hide(),l.hide(),r.hide();else{i.show();var t=c.val();"background-image"===t?l.show():"solid-color"===t&&r.show()}calc_tab_height()}),c.change(function(){l.hide(),r.hide(),"background-image"==e(this).val()?l.show():"solid-color"===e(this).val()&&r.show(),calc_tab_height()})})}(jQuery);
665
  </script>
666
 
667
  <?php }
includes/panel/assets/css/{admin.css → extensions.css} RENAMED
File without changes
includes/panel/assets/css/import-export.css ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Import/Export page */
2
+ .ocean-import-export { margin: 25px 40px 0 20px; max-width: 1050px; }
3
+ .ocean-import-export > h2 { margin: 0 0 16px !important; }
4
+ .ocean-import-export p.submit { padding-bottom: 0; }
5
+ .ocean-import-export .clr:after { content: ''; display: block; height: 0; clear: both; visibility: hidden; zoom: 1; }
6
+ .ocean-import-export .ocean-bloc.col-2 { float: left; width: 49%; }
7
+ .ocean-import-export .ocean-bloc.col-2.second { float: right; clear: none; }
8
+ .ocean-import-export .hndle { cursor: initial !important; }
9
+ .ocean-import-export .ocean-export p:first-child { margin-bottom: 16px; }
10
+ .ocean-import-export .ocean-export p:last-child { margin-top: 0; }
11
+
12
+ /* Responsive */
13
+ @media only screen and (max-width: 767px) {
14
+ .ocean-import-export .ocean-bloc.col-2 { float: none; width: 100%; }
15
+ .ocean-import-export .ocean-bloc.col-2.second { float: none; clear: none; }
16
+ }
includes/panel/extensions.php CHANGED
@@ -52,7 +52,7 @@ class Ocean_Extensions {
52
  }
53
 
54
  // CSS
55
- wp_enqueue_style( 'ocean-extensions', plugins_url( '/assets/css/admin.css', __FILE__ ) );
56
 
57
  }
58
 
52
  }
53
 
54
  // CSS
55
+ wp_enqueue_style( 'ocean-extensions', plugins_url( '/assets/css/extensions.css', __FILE__ ) );
56
 
57
  }
58
 
includes/panel/import-export.php CHANGED
@@ -20,6 +20,7 @@ class Ocean_Import_Export {
20
  */
21
  public function __construct() {
22
  add_action( 'admin_menu', array( $this, 'add_page' ), 999 );
 
23
  add_filter( 'upload_mimes', array( $this, 'add_mime_types' ) );
24
  add_action( 'admin_init', array( $this, 'register_settings' ) );
25
  add_action( 'admin_notices', array( $this, 'register_notices' ) );
@@ -43,6 +44,23 @@ class Ocean_Import_Export {
43
  );
44
  }
45
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  /**
47
  * Add mime type for upload
48
  *
@@ -246,39 +264,57 @@ class Ocean_Import_Export {
246
  */
247
  public static function create_admin_page() { ?>
248
 
249
- <div class="wrap">
250
 
251
  <h2><?php esc_html_e( 'Ocean Importer & Exporter', 'ocean-extra' ); ?></h2>
252
 
253
- <p><?php esc_html_e( 'This will import/export all theme_mods that means if other plugins are adding settings in the Customizer it will import/export those as well.', 'ocean-extra' ); ?></p>
254
-
255
  <?php
256
  // Display notices
257
  settings_fields( 'ocean_import_setting' ); ?>
258
 
259
- <h3 class="title"><?php esc_html_e( 'Import Settings', 'ocean-extra' ); ?></h3>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
260
 
261
- <p><?php echo wp_kses( __( 'Please select a <b>.json</b> file generated by the export button.', 'ocean-extra' ), array( 'b' => array() ) ); ?></p>
262
 
263
- <form method="post" enctype="multipart/form-data">
264
 
265
- <?php wp_nonce_field( 'ocean_import', 'ocean_import_nonce' ); ?>
266
 
267
- <input type="file" name="ocean_import_file" id="ocean-import-file" />
 
268
 
269
- <p class="submit">
270
- <input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Import Settings', 'ocean-extra' ) ?>" />
271
- </p>
272
 
273
- </form>
 
 
274
 
275
- <h3 class="title"><?php echo esc_html_x( 'Export Settings', 'heading', 'ocean-extra' ); ?></h3>
276
 
277
- <p><?php echo wp_kses( __( 'Click below to generate a <b>.json</b> file for all settings.', 'ocean-extra' ), array( 'b' => array() ) ); ?></p>
278
 
279
- <p class="submit">
280
- <a href="<?php echo esc_url( admin_url( basename( $_SERVER['PHP_SELF'] ) . '?page=' . $_GET['page'] . '&export=1' ) ); ?>" id="ocean-export-button" class="button button-primary"><?php echo esc_html_x( 'Export Settings', 'button', 'ocean-extra' ); ?></a>
281
- </p>
282
 
283
  </div>
284
 
20
  */
21
  public function __construct() {
22
  add_action( 'admin_menu', array( $this, 'add_page' ), 999 );
23
+ add_action( 'admin_enqueue_scripts', array( $this, 'scripts' ) );
24
  add_filter( 'upload_mimes', array( $this, 'add_mime_types' ) );
25
  add_action( 'admin_init', array( $this, 'register_settings' ) );
26
  add_action( 'admin_notices', array( $this, 'register_notices' ) );
44
  );
45
  }
46
 
47
+ /**
48
+ * Load scripts
49
+ *
50
+ * @since 1.0.6
51
+ */
52
+ public static function scripts( $hook ) {
53
+
54
+ // Only load scripts when needed
55
+ if ( OE_ADMIN_PANEL_HOOK_PREFIX . '-import-export' != $hook ) {
56
+ return;
57
+ }
58
+
59
+ // CSS
60
+ wp_enqueue_style( 'ocean-import-export', plugins_url( '/assets/css/import-export.css', __FILE__ ) );
61
+
62
+ }
63
+
64
  /**
65
  * Add mime type for upload
66
  *
264
  */
265
  public static function create_admin_page() { ?>
266
 
267
+ <div class="wrap ocean-import-export">
268
 
269
  <h2><?php esc_html_e( 'Ocean Importer & Exporter', 'ocean-extra' ); ?></h2>
270
 
 
 
271
  <?php
272
  // Display notices
273
  settings_fields( 'ocean_import_setting' ); ?>
274
 
275
+ <div class="metabox-holder clr">
276
+
277
+ <div class="postbox ocean-import ocean-bloc col-2 clr">
278
+
279
+ <h3 class="hndle"><?php esc_html_e( 'Import Settings', 'ocean-extra' ); ?></h3>
280
+
281
+ <div class="inside">
282
+ <p><?php echo wp_kses( __( 'Please select a <b>.json</b> file generated by the export button.', 'ocean-extra' ), array( 'b' => array() ) ); ?></p>
283
+
284
+ <form method="post" enctype="multipart/form-data">
285
+
286
+ <?php wp_nonce_field( 'ocean_import', 'ocean_import_nonce' ); ?>
287
+
288
+ <input type="file" name="ocean_import_file" id="ocean-import-file" />
289
+
290
+ <p class="submit">
291
+ <input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Import Settings', 'ocean-extra' ) ?>" />
292
+ </p>
293
+
294
+ </form>
295
+
296
+ </div>
297
 
298
+ </div>
299
 
300
+ <div class="postbox ocean-export ocean-bloc col-2 second clr">
301
 
302
+ <h3 class="hndle"><?php esc_html_e( 'Export Settings', 'ocean-extra' ); ?></h3>
303
 
304
+ <div class="inside">
305
+ <p><?php esc_html_e( 'This will export all theme_mods that means if other plugins are adding settings in the customizer it will export those as well.', 'ocean-extra' ); ?></p>
306
 
307
+ <p><?php echo wp_kses( __( 'Click below to generate a <b>.json</b> file for all settings.', 'ocean-extra' ), array( 'b' => array() ) ); ?></p>
 
 
308
 
309
+ <p class="submit">
310
+ <a href="<?php echo esc_url( admin_url( basename( $_SERVER['PHP_SELF'] ) . '?page=' . $_GET['page'] . '&export=1' ) ); ?>" id="ocean-export-button" class="button button-primary"><?php echo esc_html_x( 'Export Settings', 'button', 'ocean-extra' ); ?></a>
311
+ </p>
312
 
313
+ </div>
314
 
315
+ </div>
316
 
317
+ </div>
 
 
318
 
319
  </div>
320
 
ocean-extra.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Ocean Extra
4
  * Plugin URI: https://oceanwp.org/extension/ocean-extra/
5
  * Description: Add extra features like metaboxes, custom CSS and a panel to activate the premium extensions.
6
- * Version: 1.0.7
7
  * Author: OceanWP
8
  * Author URI: https://oceanwp.org/
9
  * Requires at least: 4.0.0
@@ -86,7 +86,7 @@ final class Ocean_Extra {
86
  $this->token = 'ocean-extra';
87
  $this->plugin_url = plugin_dir_url( __FILE__ );
88
  $this->plugin_path = plugin_dir_path( __FILE__ );
89
- $this->version = '1.0.7';
90
 
91
  define( 'OE_ROOT', dirname( __FILE__ ) );
92
  define( 'OE_ADMIN_PANEL_HOOK_PREFIX', 'theme-panel_page_ocean-panel' );
3
  * Plugin Name: Ocean Extra
4
  * Plugin URI: https://oceanwp.org/extension/ocean-extra/
5
  * Description: Add extra features like metaboxes, custom CSS and a panel to activate the premium extensions.
6
+ * Version: 1.0.8
7
  * Author: OceanWP
8
  * Author URI: https://oceanwp.org/
9
  * Requires at least: 4.0.0
86
  $this->token = 'ocean-extra';
87
  $this->plugin_url = plugin_dir_url( __FILE__ );
88
  $this->plugin_path = plugin_dir_path( __FILE__ );
89
+ $this->version = '1.0.8';
90
 
91
  define( 'OE_ROOT', dirname( __FILE__ ) );
92
  define( 'OE_ADMIN_PANEL_HOOK_PREFIX', 'theme-panel_page_ocean-panel' );
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: oceanwp
3
  Tags: meta boxes, meta box, metaboxes, metabox, social sharing, ocean
4
  Requires at least: 3.5
5
  Tested up to: 4.6.1
6
- Stable tag: 1.0.7
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -33,11 +33,15 @@ This plugin will only work with the [Ocean](https://oceanwp.org/) theme.
33
 
34
  == Changelog ==
35
 
 
 
 
 
36
  = 1.0.7 =
37
  - New "Ocean Demo Import" extension added in the extensions tab.
38
 
39
  = 1.0.6 =
40
- - Improvement exporter.
41
 
42
  = 1.0.5 =
43
  - New import/export tab to easily import or export your settings.
3
  Tags: meta boxes, meta box, metaboxes, metabox, social sharing, ocean
4
  Requires at least: 3.5
5
  Tested up to: 4.6.1
6
+ Stable tag: 1.0.8
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
33
 
34
  == Changelog ==
35
 
36
+ = 1.0.8 =
37
+ - New field in the Title tab in the metabox to add a custom color to the overlay title.
38
+ - Improved style for the Import/Export tab.
39
+
40
  = 1.0.7 =
41
  - New "Ocean Demo Import" extension added in the extensions tab.
42
 
43
  = 1.0.6 =
44
+ - Improvement exporter settings.
45
 
46
  = 1.0.5 =
47
  - New import/export tab to easily import or export your settings.