* @license http://www.gnu.org/licenses/gpl-2.0.html
* @link https://github.com/maddisondesigns
*/
class Bizes_Text_Radio_Button_Custom_Control extends Bizes_Custom_Control {
/**
* The type of control being rendered
*/
public $type = 'text_radio_button';
/**
* Enqueue our scripts and styles
*/
public function enqueue() {
wp_enqueue_style( 'bizes-custom-controls-css', $this->get_bizes_resource_url() . 'assets/css/customizer.css', array(), '1.0', 'all' );
}
/**
* Render the control in the customizer
*/
public function render_content() {
?>
* @license http://www.gnu.org/licenses/gpl-2.0.html
* @link https://github.com/maddisondesigns
*/
class Bizes_Image_Radio_Button_Custom_Control extends Bizes_Custom_Control {
/**
* The type of control being rendered
*/
public $type = 'image_radio_button';
/**
* Enqueue our scripts and styles
*/
public function enqueue() {
wp_enqueue_style( 'bizes-custom-controls-css', $this->get_bizes_resource_url() . 'assets/css/customizer.css', array(), '1.0', 'all' );
}
/**
* Render the control in the customizer
*/
public function render_content() {
?>
* @license http://www.gnu.org/licenses/gpl-2.0.html
* @link https://github.com/maddisondesigns
*/
class Bizes_Slider_Custom_Control extends Bizes_Custom_Control {
/**
* The type of control being rendered
*/
public $type = 'slider_control';
/**
* Enqueue our scripts and styles
*/
public function enqueue() {
wp_enqueue_script( 'bizes-custom-controls-js', $this->get_bizes_resource_url() . 'assets/js/customizer.js', array( 'jquery', 'jquery-ui-core' ), '1.0', true );
wp_enqueue_style( 'bizes-custom-controls-css', $this->get_bizes_resource_url() . 'assets/css/customizer.css', array(), '1.0', 'all' );
}
/**
* Render the control in the customizer
*/
public function render_content() {
?>
* @license http://www.gnu.org/licenses/gpl-2.0.html
* @link https://github.com/maddisondesigns
*/
class Bizes_Toggle_Switch_Custom_control extends Bizes_Custom_Control {
/**
* The type of control being rendered
*/
public $type = 'toggle_switch';
/**
* Enqueue our scripts and styles
*/
public function enqueue(){
wp_enqueue_style( 'bizes-custom-controls-css', $this->get_bizes_resource_url() . 'assets/css/customizer.css', array(), '1.0', 'all' );
}
/**
* Render the control in the customizer
*/
public function render_content(){
?>
* @license http://www.gnu.org/licenses/gpl-2.0.html
* @link https://github.com/maddisondesigns
*/
class Bizes_Dropdown_Posts_Custom_Control extends Bizes_Custom_Control {
/**
* The type of control being rendered
*/
public $type = 'dropdown_posts';
/**
* Posts
*/
private $posts = array();
/**
* Constructor
*/
public function __construct( $manager, $id, $args = array(), $options = array() ) {
parent::__construct( $manager, $id, $args );
// Get our Posts
$this->posts = get_posts( $this->input_attrs );
}
/**
* Render the control in the customizer
*/
public function render_content() {
?>
* @license http://www.gnu.org/licenses/gpl-2.0.html
* @link https://github.com/maddisondesigns
*/
class Bizes_Google_Font_Select_Custom_Control extends Bizes_Custom_Control {
/**
* The type of control being rendered
*/
public $type = 'google_fonts';
/**
* The list of Google Fonts
*/
private $fontList = false;
/**
* The saved font values decoded from json
*/
private $fontValues = [];
/**
* The index of the saved font within the list of Google fonts
*/
private $fontListIndex = 0;
/**
* The number of fonts to display from the json file. Either positive integer or 'all'. Default = 'all'
*/
private $fontCount = 'all';
/**
* The font list sort order. Either 'alpha' or 'popular'. Default = 'alpha'
*/
private $fontOrderBy = 'alpha';
/**
* Get our list of fonts from the json file
*/
public function __construct($manager, $id, $args = array(), $options = array() ) {
parent::__construct( $manager, $id, $args );
// Get the font sort order
if ( isset( $this->input_attrs['orderby'] ) && strtolower( $this->input_attrs['orderby'] ) === 'popular' ) {
$this->fontOrderBy = 'popular';
}
// Get the list of Google fonts
if ( isset( $this->input_attrs['font_count'] ) ) {
if ( 'all' != strtolower( $this->input_attrs['font_count'] ) ) {
$this->fontCount = ( abs( (int) $this->input_attrs['font_count'] ) > 0 ? abs( (int) $this->input_attrs['font_count'] ) : 'all' );
}
}
$this->fontList = $this->bizes_getGoogleFonts( 'all' );
// Decode the default json font value
$this->fontValues = json_decode( $this->value() );
// Find the index of our default font within our list of Google fonts
$this->fontListIndex = $this->bizes_getFontIndex( $this->fontList, $this->fontValues->font );
}
/**
* Enqueue our scripts and styles
*/
public function enqueue() {
wp_enqueue_script( 'bizes-select2-js', $this->get_bizes_resource_url() . 'assets/js/select2.full.min.js', array( 'jquery' ), '4.0.13', true );
wp_enqueue_script( 'bizes-custom-controls-js', $this->get_bizes_resource_url() . 'assets/js/customizer.js', array( 'bizes-select2-js' ), '1.0', true );
wp_enqueue_style( 'bizes-custom-controls-css', $this->get_bizes_resource_url() . 'assets/css/customizer.css', array(), '1.1', 'all' );
wp_enqueue_style( 'bizes-select2-css', $this->get_bizes_resource_url() . 'assets/css/select2.min.css', array(), '4.0.13', 'all' );
}
/**
* Export our List of Google Fonts to JavaScript
*/
public function to_json() {
parent::to_json();
$this->json['bizesfontslist'] = $this->fontList;
}
/**
* Render the control in the customizer
*/
public function render_content() {
$fontCounter = 0;
$isFontInList = false;
$fontListStr = '';
if( !empty($this->fontList) ) {
?>
* @license http://www.gnu.org/licenses/gpl-2.0.html
* @link https://github.com/maddisondesigns
*/
class Bizes_Pill_Checkbox_Custom_Control extends Bizes_Custom_Control {
/**
* The type of control being rendered
*/
public $type = 'pill_checkbox';
/**
* Define whether the pills can be sorted using drag 'n drop. Either false or true. Default = false
*/
private $sortable = false;
/**
* The width of the pills. Each pill can be auto width or full width. Default = false
*/
private $fullwidth = false;
/**
* Constructor
*/
public function __construct( $manager, $id, $args = array(), $options = array() ) {
parent::__construct( $manager, $id, $args );
// Check if these pills are sortable
if ( isset( $this->input_attrs['sortable'] ) && $this->input_attrs['sortable'] ) {
$this->sortable = true;
}
// Check if the pills should be full width
if ( isset( $this->input_attrs['fullwidth'] ) && $this->input_attrs['fullwidth'] ) {
$this->fullwidth = true;
}
} /**
* Enqueue our scripts and styles
*/
public function enqueue() {
wp_enqueue_script( 'bizes-custom-controls-js', $this->get_bizes_resource_url() . 'assets/js/customizer.js', array( 'jquery', 'jquery-ui-core' ), '1.1', true );
wp_enqueue_style( 'bizes-custom-controls-css', $this->get_bizes_resource_url() . 'assets/css/customizer.css', array(), '1.0', 'all' );
}
/**
* Render the control in the customizer
*/
public function render_content() {
$reordered_choices = array();
$saved_choices = explode( ',', esc_attr( $this->value() ) );
// Order the checkbox choices based on the saved order
if( $this->sortable ) {
foreach ( $saved_choices as $key => $value ) {
if( isset( $this->choices[$value] ) ) {
$reordered_choices[$value] = $this->choices[$value];
}
}
$reordered_choices = array_merge( $reordered_choices, array_diff_assoc( $this->choices, $reordered_choices ) );
}
else {
$reordered_choices = $this->choices;
}
?>
* @license http://www.gnu.org/licenses/gpl-2.0.html
* @link https://github.com/maddisondesigns
*
*/
class Bizes_Upsell_Section extends Bizes_Custom_Section {
/**
* The type of control being rendered
*/
public $type = 'bizes-upsell';
/**
* The Upsell URL
*/
public $url = '';
/**
* The background color for the control
*/
public $backgroundcolor = '';
/**
* The text color for the control
*/
public $textcolor = '';
/**
* Enqueue our scripts and styles
*/
public function enqueue() {
wp_enqueue_script( 'bizes-custom-controls-js', $this->get_bizes_resource_url() . 'assets/js/customizer.js', array( 'jquery' ), '1.0', true );
wp_enqueue_style( 'bizes-custom-controls-css', $this->get_bizes_resource_url() . 'assets/css/customizer.css', array(), '1.0', 'all' );
}
/**
* Render the section, and the controls that have been added to it.
*/
protected function render() {
$bkgrndcolor = !empty( $this->backgroundcolor ) ? esc_attr( $this->backgroundcolor ) : '#fff';
$color = !empty( $this->textcolor ) ? esc_attr( $this->textcolor ) : '#555d66';
?>