first commit
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
/**
|
||||
* Customizer Control: oceanwp-upsell.
|
||||
*
|
||||
* @package OceanWP WordPress theme
|
||||
* @subpackage Controls
|
||||
* @since 1.0
|
||||
*/
|
||||
|
||||
// Exit if accessed directly.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Upsell control
|
||||
*/
|
||||
class OceanWP_Customizer_Upsell_Section_Control extends WP_Customize_Section {
|
||||
|
||||
/**
|
||||
* The control type.
|
||||
*
|
||||
* @access public
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'oceanwp-upsell';
|
||||
public $url = '';
|
||||
public $id = '';
|
||||
|
||||
/**
|
||||
* JSON.
|
||||
*/
|
||||
public function json() {
|
||||
$json = parent::json();
|
||||
$json['url'] = esc_url( $this->url );
|
||||
$json['id'] = $this->id;
|
||||
return $json;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render template
|
||||
*
|
||||
* @access protected
|
||||
*/
|
||||
protected function render_template() {
|
||||
?>
|
||||
<li id="accordion-section-{{ data.id }}" class="accordion-section control-section control-section-{{ data.type }} cannot-expand">
|
||||
<h3>
|
||||
<a href="{{{ data.url }}}" target="_blank">{{ data.title }}</a>
|
||||
</h3>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue control related scripts/styles.
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function oceanwp_upsell_enqueue() {
|
||||
wp_enqueue_script( 'oceanwp-upsell', OCEANWP_INC_DIR_URI . 'customizer/assets/min/js/upsell.min.js', array( 'customize-controls' ), false, true );
|
||||
wp_enqueue_style( 'oceanwp-upsell', OCEANWP_INC_DIR_URI . 'customizer/assets/min/css/upsell.min.css', null );
|
||||
}
|
||||
add_action( 'customize_controls_enqueue_scripts', 'oceanwp_upsell_enqueue' );
|
||||
@@ -0,0 +1,59 @@
|
||||
#customize-theme-controls #accordion-section-oceanwp_upsell_section {
|
||||
display: block !important;
|
||||
border-top: 1px solid #5277fe;
|
||||
border-bottom: 1px solid #5277fe;
|
||||
}
|
||||
|
||||
#accordion-section-oceanwp_upsell_section h3 {
|
||||
background-color: #5277fe;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border-left: 4px solid #5277fe;
|
||||
transition: .15s background-color ease-in-out,.15s border-color ease-in-out;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
#accordion-section-oceanwp_upsell_section h3:hover {
|
||||
background-color: #3d5ac3;
|
||||
border-left-color: #000c65;
|
||||
}
|
||||
|
||||
#accordion-section-oceanwp_upsell_section h3 a {
|
||||
display: block;
|
||||
position: relative;
|
||||
color: #fff;
|
||||
padding: 10px 10px 11px 14px;
|
||||
line-height: 21px;
|
||||
text-decoration: none;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
#accordion-section-oceanwp_upsell_section h3 a:after {
|
||||
content: '\f345';
|
||||
color: #fff;
|
||||
position: absolute;
|
||||
top: 12px;
|
||||
right: 10px;
|
||||
z-index: 1;
|
||||
font: 400 20px/1 dashicons;
|
||||
speak: none;
|
||||
display: block;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
.rtl #accordion-section-oceanwp_upsell_section h3 {
|
||||
border-left: none;
|
||||
border-right: 4px solid #5277fe;
|
||||
}
|
||||
|
||||
.rtl #accordion-section-oceanwp_upsell_section h3:hover {
|
||||
border-right-color: #000c65;
|
||||
}
|
||||
|
||||
.rtl #accordion-section-oceanwp_upsell_section h3 a:after {
|
||||
content: '\f341';
|
||||
right: auto;
|
||||
left: 10px;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
( function( $, api ) {
|
||||
api.sectionConstructor['oceanwp-upsell'] = api.Section.extend( {
|
||||
|
||||
// No events for this type of section.
|
||||
attachEvents: function () {},
|
||||
|
||||
// Always make the section active.
|
||||
isContextuallyActive: function () {
|
||||
return true;
|
||||
}
|
||||
} );
|
||||
} )( jQuery, wp.customize );
|
||||
Reference in New Issue
Block a user