Version Description
New field in the Ocean Settings meta box to add an overlay to the background image title.
Download this release
Release Info
Developer | oceanwp |
Plugin | Ocean Extra |
Version | 1.0.3 |
Comparing to | |
See all releases |
Code changes from version 1.0.2 to 1.0.3
- includes/metabox/assets/ocean-metabox.css +1 -0
- includes/metabox/assets/ocean-metabox.js +1 -1
- includes/metabox/metabox.php +23 -3
- ocean-extra.php +2 -2
- readme.txt +4 -1
includes/metabox/assets/ocean-metabox.css
CHANGED
@@ -30,5 +30,6 @@
|
|
30 |
|
31 |
#ocean-metabox .inside .ocean-wrap input[type="text"],
|
32 |
#ocean-metabox .inside .ocean-wrap input[type="number"] { width: 100%; padding: 7px 15px; }
|
|
|
33 |
#ocean-metabox .inside .ocean-wrap textarea { width: 100% }
|
34 |
#ocean-metabox .inside .ocean-wrap select { display: block; width: 100%; min-width: 40%; height: auto; border: 1px solid #d9d9d9; color: #333333; font-size: 13px; outline: none; padding: 7px 15px; cursor: pointer; z-index: 5; }
|
30 |
|
31 |
#ocean-metabox .inside .ocean-wrap input[type="text"],
|
32 |
#ocean-metabox .inside .ocean-wrap input[type="number"] { width: 100%; padding: 7px 15px; }
|
33 |
+
#ocean-metabox .inside .ocean-wrap input.ocean-mb-color-field { width: 90px; padding: 3px 10px; }
|
34 |
#ocean-metabox .inside .ocean-wrap textarea { width: 100% }
|
35 |
#ocean-metabox .inside .ocean-wrap select { display: block; width: 100%; min-width: 40%; height: auto; border: 1px solid #d9d9d9; color: #333333; font-size: 13px; outline: none; padding: 7px 15px; cursor: pointer; z-index: 5; }
|
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,#
|
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'),
|
70 |
solidColorElements = $( '#ocean_post_title_background_color_tr');
|
71 |
|
72 |
if ( titleField.val() === 'on' ) {
|
includes/metabox/metabox.php
CHANGED
@@ -154,7 +154,14 @@ class Ocean_Post_Metaboxes {
|
|
154 |
$hidden = isset ( $setting['hidden'] ) ? $setting['hidden'] : false;
|
155 |
$type = isset ( $setting['type'] ) ? $setting['type'] : 'text';
|
156 |
$default = isset ( $setting['default'] ) ? $setting['default'] : '';
|
|
|
|
|
|
|
|
|
157 |
$description = isset ( $setting['description'] ) ? $setting['description'] : '';
|
|
|
|
|
|
|
158 |
$meta_value = get_post_meta( $post_id, $meta_id, true );
|
159 |
$meta_value = $meta_value ? $meta_value : $default; ?>
|
160 |
|
@@ -179,7 +186,7 @@ class Ocean_Post_Metaboxes {
|
|
179 |
// Number Field
|
180 |
if ( 'number' == $type ) { ?>
|
181 |
|
182 |
-
<div class="ocean-mb-field"><input name="<?php echo $meta_id; ?>" type="number" value="<?php echo $meta_value; ?>"></div>
|
183 |
|
184 |
<?php }
|
185 |
|
@@ -534,6 +541,19 @@ class Ocean_Post_Metaboxes {
|
|
534 |
'description' => esc_html__( 'Select your custom height for your title background. Default is 400px.', 'ocean-extra' ),
|
535 |
'hidden' => true,
|
536 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
537 |
),
|
538 |
);
|
539 |
|
@@ -618,7 +638,7 @@ class Ocean_Post_Metaboxes {
|
|
618 |
public static function metaboxes_css() { ?>
|
619 |
|
620 |
<style type="text/css">
|
621 |
-
#ocean-metabox .clr:after{content:"";display:block;height:0;clear:both;visibility:hidden;zoom:1}#ocean-metabox .inside{margin:0!important;padding:0}#ocean-metabox ul.ocean-tabs{float:left;width:17%;background-color:#f8f8f8;border-right:1px solid #e2dddb;margin:0;padding:0;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}#ocean-metabox ul.ocean-tabs li{display:block;font-size:13px;text-decoration:none;padding:0;margin:0;border:0;border-bottom:1px solid #e2dddb;word-wrap:break-word}#ocean-metabox ul.ocean-tabs li a{display:block;padding:13px;color:#222;text-decoration:none;-webkit-box-shadow:none;box-shadow:none}#ocean-metabox ul.ocean-tabs .wp-tab-active{margin-right:-1px}#ocean-metabox ul.ocean-tabs#ocean-mb-tab-1{display:block;background-color:#fff}#ocean-metabox .ocean-tab-panel{float:left;width:83%;padding:20px 30px;background-color:#fff;border:0;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}#ocean-metabox .wp-tab-panel{display:none;max-height:none!important;border:0;background-color:transparent}#ocean-metabox .wp-tab-panel#ocean-mb-tab-1{display:block}#ocean-metabox .wp-tab-panel .ocean-wrap{margin:0}#ocean-metabox .inside .ocean-wrap .ocean-field{border-top:1px solid #f1f1f1;padding:15px 0}#ocean-metabox .inside .ocean-wrap .ocean-field:first-child{border:none;padding-top:0}#ocean-metabox .inside .ocean-wrap .ocean-mb-desc{float:left;width:45%}#ocean-metabox .inside .ocean-wrap .ocean-mb-field{position:relative;float:right;width:50%}#ocean-metabox .inside .ocean-wrap label{display:block;font-size:13px;color:#222}#ocean-metabox .inside .ocean-wrap .ocean-mb-desc label span{margin-right:7px}#ocean-metabox .inside .ocean-wrap .ocean-mb-desc p.ocean-mb-description{font-size:12px;font-weight:400;margin:8px 0 0;padding:0;color:#939393}#ocean-metabox .inside .ocean-wrap .uploader input[type=text]{width:78%}#ocean-metabox .inside .ocean-wrap .uploader .ocean-mb-uploader{float:right;width:18%;height:35px;margin:1px;border-radius:0;outline:0;-webkit-box-shadow:none;box-shadow:none;vertical-align:middle}#ocean-metabox .inside .ocean-wrap .uploader .ocean-mb-uploader:hover{border-color:#bbb}#ocean-metabox .inside .ocean-wrap .uploader .ocean-mb-uploader:focus{border-color:#bbb;-webkit-box-shadow:none;box-shadow:none}#ocean-metabox .inside .ocean-wrap input[type=text],#ocean-metabox .inside .ocean-wrap input[type=number]{width:100%;padding:7px 15px}#ocean-metabox .inside .ocean-wrap textarea{width:100%}#ocean-metabox .inside .ocean-wrap select{display:block;width:100%;min-width:40%;height:auto;border:1px solid #d9d9d9;color:#333;font-size:13px;outline:0;padding:7px 15px;cursor:pointer;z-index:5}
|
622 |
</style>
|
623 |
|
624 |
<?php
|
@@ -634,7 +654,7 @@ class Ocean_Post_Metaboxes {
|
|
634 |
public static function metaboxes_js() { ?>
|
635 |
|
636 |
<script type="text/javascript">
|
637 |
-
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,#
|
638 |
</script>
|
639 |
|
640 |
<?php }
|
154 |
$hidden = isset ( $setting['hidden'] ) ? $setting['hidden'] : false;
|
155 |
$type = isset ( $setting['type'] ) ? $setting['type'] : 'text';
|
156 |
$default = isset ( $setting['default'] ) ? $setting['default'] : '';
|
157 |
+
// Add 0 number if nothing to the number type
|
158 |
+
if ( 'number' == $type ) {
|
159 |
+
$default = '0';
|
160 |
+
}
|
161 |
$description = isset ( $setting['description'] ) ? $setting['description'] : '';
|
162 |
+
$input_min = isset ( $setting['input_attrs']['min'] ) ? $setting['input_attrs']['min'] : '0';
|
163 |
+
$input_max = isset ( $setting['input_attrs']['max'] ) ? $setting['input_attrs']['max'] : '10';
|
164 |
+
$input_step = isset ( $setting['input_attrs']['step'] ) ? $setting['input_attrs']['step'] : '1';
|
165 |
$meta_value = get_post_meta( $post_id, $meta_id, true );
|
166 |
$meta_value = $meta_value ? $meta_value : $default; ?>
|
167 |
|
186 |
// Number Field
|
187 |
if ( 'number' == $type ) { ?>
|
188 |
|
189 |
+
<div class="ocean-mb-field"><input name="<?php echo $meta_id; ?>" type="number" value="<?php echo $meta_value; ?>" min="<?php echo $input_min; ?>" max="<?php echo $input_max; ?>" step="<?php echo $input_step; ?>"></div>
|
190 |
|
191 |
<?php }
|
192 |
|
541 |
'description' => esc_html__( 'Select your custom height for your title background. Default is 400px.', 'ocean-extra' ),
|
542 |
'hidden' => true,
|
543 |
),
|
544 |
+
'post_title_bg_overlay' => array(
|
545 |
+
'id' => $prefix . 'post_title_bg_overlay',
|
546 |
+
'type' => 'number',
|
547 |
+
'title' => esc_html__( 'Title: Background Overlay Opacity', 'ocean-extra' ),
|
548 |
+
'description' => esc_html__( 'Enter a number between 0.1 to 1 to add an overlay.', 'ocean-extra' ),
|
549 |
+
'default' => '0.5',
|
550 |
+
'input_attrs' => array(
|
551 |
+
'min' => 0,
|
552 |
+
'max' => 1,
|
553 |
+
'step' => 0.1,
|
554 |
+
),
|
555 |
+
'hidden' => true,
|
556 |
+
),
|
557 |
),
|
558 |
);
|
559 |
|
638 |
public static function metaboxes_css() { ?>
|
639 |
|
640 |
<style type="text/css">
|
641 |
+
#ocean-metabox .clr:after{content:"";display:block;height:0;clear:both;visibility:hidden;zoom:1}#ocean-metabox .inside{margin:0!important;padding:0}#ocean-metabox ul.ocean-tabs{float:left;width:17%;background-color:#f8f8f8;border-right:1px solid #e2dddb;margin:0;padding:0;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}#ocean-metabox ul.ocean-tabs li{display:block;font-size:13px;text-decoration:none;padding:0;margin:0;border:0;border-bottom:1px solid #e2dddb;word-wrap:break-word}#ocean-metabox ul.ocean-tabs li a{display:block;padding:13px;color:#222;text-decoration:none;-webkit-box-shadow:none;box-shadow:none}#ocean-metabox ul.ocean-tabs .wp-tab-active{margin-right:-1px}#ocean-metabox ul.ocean-tabs#ocean-mb-tab-1{display:block;background-color:#fff}#ocean-metabox .ocean-tab-panel{float:left;width:83%;padding:20px 30px;background-color:#fff;border:0;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}#ocean-metabox .wp-tab-panel{display:none;max-height:none!important;border:0;background-color:transparent}#ocean-metabox .wp-tab-panel#ocean-mb-tab-1{display:block}#ocean-metabox .wp-tab-panel .ocean-wrap{margin:0}#ocean-metabox .inside .ocean-wrap .ocean-field{border-top:1px solid #f1f1f1;padding:15px 0}#ocean-metabox .inside .ocean-wrap .ocean-field:first-child{border:none;padding-top:0}#ocean-metabox .inside .ocean-wrap .ocean-mb-desc{float:left;width:45%}#ocean-metabox .inside .ocean-wrap .ocean-mb-field{position:relative;float:right;width:50%}#ocean-metabox .inside .ocean-wrap label{display:block;font-size:13px;color:#222}#ocean-metabox .inside .ocean-wrap .ocean-mb-desc label span{margin-right:7px}#ocean-metabox .inside .ocean-wrap .ocean-mb-desc p.ocean-mb-description{font-size:12px;font-weight:400;margin:8px 0 0;padding:0;color:#939393}#ocean-metabox .inside .ocean-wrap .uploader input[type=text]{width:78%}#ocean-metabox .inside .ocean-wrap .uploader .ocean-mb-uploader{float:right;width:18%;height:35px;margin:1px;border-radius:0;outline:0;-webkit-box-shadow:none;box-shadow:none;vertical-align:middle}#ocean-metabox .inside .ocean-wrap .uploader .ocean-mb-uploader:hover{border-color:#bbb}#ocean-metabox .inside .ocean-wrap .uploader .ocean-mb-uploader:focus{border-color:#bbb;-webkit-box-shadow:none;box-shadow:none}#ocean-metabox .inside .ocean-wrap input[type=text],#ocean-metabox .inside .ocean-wrap input[type=number]{width:100%;padding:7px 15px}#ocean-metabox .inside .ocean-wrap input.ocean-mb-color-field{width: 90px;padding: 3px 10px}#ocean-metabox .inside .ocean-wrap textarea{width:100%}#ocean-metabox .inside .ocean-wrap select{display:block;width:100%;min-width:40%;height:auto;border:1px solid #d9d9d9;color:#333;font-size:13px;outline:0;padding:7px 15px;cursor:pointer;z-index:5}
|
642 |
</style>
|
643 |
|
644 |
<?php
|
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 }
|
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 |
* 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.
|
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.3
|
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.3';
|
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 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -33,6 +33,9 @@ This plugin will only work with the [Ocean](https://oceanwp.org/) theme.
|
|
33 |
|
34 |
== Changelog ==
|
35 |
|
|
|
|
|
|
|
36 |
= 1.0.2 =
|
37 |
New extension "Custom Sidebar" added in the extensions tab.
|
38 |
New field in the Main tab in the metabox to add shorcode to the top of the page.
|
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.3
|
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.3 =
|
37 |
+
New field in the Ocean Settings meta box to add an overlay to the background image title.
|
38 |
+
|
39 |
= 1.0.2 =
|
40 |
New extension "Custom Sidebar" added in the extensions tab.
|
41 |
New field in the Main tab in the metabox to add shorcode to the top of the page.
|