* @license http://www.gnu.org/licenses/gpl-2.0.html
* @link https://github.com/maddisondesigns
*/
class Billow_Image_Checkbox_Custom_Control extends WP_Customize_Control {
/**
* The type of control being rendered
*/
public $type = 'image_checkbox';
/**
* Enqueue our scripts and styles
*/
public function enqueue() {
wp_enqueue_style( 'billow-custom-controls-css', trailingslashit( get_template_directory_uri() ) . 'inc/customizer/custom-controls/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 Billow_Text_Radio_Button_Custom_Control extends WP_Customize_Control {
/**
* The type of control being rendered
*/
public $type = 'text_radio_button';
/**
* Enqueue our scripts and styles
*/
public function enqueue() {
wp_enqueue_style( 'billow-custom-controls-css', trailingslashit( get_template_directory_uri() ) . 'inc/customizer/custom-controls/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 Billow_Image_Radio_Button_Custom_Control extends WP_Customize_Control {
/**
* The type of control being rendered
*/
public $type = 'image_radio_button';
/**
* Enqueue our scripts and styles
*/
public function enqueue() {
wp_enqueue_style( 'billow-custom-controls-css', trailingslashit( get_template_directory_uri() ) . 'inc/customizer/custom-controls/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 Billow_Slider_Custom_Control extends WP_Customize_Control {
/**
* The type of control being rendered
*/
public $type = 'slider_control';
/**
* Enqueue our scripts and styles
*/
public function enqueue() {
wp_enqueue_script( 'billow-custom-controls-js', trailingslashit( get_template_directory_uri() ) . 'inc/customizer/custom-controls/js/customizer.js', array( 'jquery', 'jquery-ui-core' ), '1.0.1', true );
wp_enqueue_style( 'billow-custom-controls-css', trailingslashit( get_template_directory_uri() ) . 'inc/customizer/custom-controls/css/customizer.css', array(), '1.0', 'all' );
}
/**
* Render the control in the customizer
*/
public function render_content() {
?>
label ); ?>link(); ?> />
description ) ) { ?>
description ); ?>
* @license http://www.gnu.org/licenses/gpl-2.0.html
* @link https://github.com/maddisondesigns
*/
class Billow_Toggle_Switch_Custom_control extends WP_Customize_Control {
/**
* The type of control being rendered
*/
public $type = 'toogle_switch';
/**
* Enqueue our scripts and styles
*/
public function enqueue(){
wp_enqueue_style( 'billow-custom-controls-css', trailingslashit( get_template_directory_uri() ) . 'inc/customizer/custom-controls/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 Billow_Dropdown_Select2_Custom_Control extends WP_Customize_Control {
/**
* The type of control being rendered
*/
public $type = 'dropdown_select2';
/**
* The type of Select2 Dropwdown to display. Can be either a single select dropdown or a multi-select dropdown. Either false for true. Default = false
*/
private $multiselect = false;
/**
* The Placeholder value to display. Select2 requires a Placeholder value to be set when using the clearall option. Default = 'Please select...'
*/
private $placeholder = 'Please select...';
/**
* Constructor
*/
public function __construct( $manager, $id, $args = array(), $options = array() ) {
parent::__construct( $manager, $id, $args );
// Check if this is a multi-select field
if ( isset( $this->input_attrs['multiselect'] ) && $this->input_attrs['multiselect'] ) {
$this->multiselect = true;
}
// Check if a placeholder string has been specified
if ( isset( $this->input_attrs['placeholder'] ) && $this->input_attrs['placeholder'] ) {
$this->placeholder = $this->input_attrs['placeholder'];
}
}
/**
* Enqueue our scripts and styles
*/
public function enqueue() {
wp_enqueue_script( 'billow-select2-js', trailingslashit( get_template_directory_uri() ) . 'inc/customizer/custom-controls/js/select2.min.js', array( 'jquery' ), '4.0.6', true );
wp_enqueue_script( 'billow-custom-controls-js', trailingslashit( get_template_directory_uri() ) . 'inc/customizer/custom-controls/js/customizer.js', array( 'billow-select2-js' ), '1.0.1', true );
wp_enqueue_style( 'billow-custom-controls-css', trailingslashit( get_template_directory_uri() ) . 'inc/customizer/custom-controls/css/customizer.css', array(), '1.1', 'all' );
wp_enqueue_style( 'billow-select2-css', trailingslashit( get_template_directory_uri() ) . 'inc/customizer/custom-controls/css/select2.min.css', array(), '4.0.6', 'all' );
}
/**
* Render the control in the customizer
*/
public function render_content() {
$defaultValue = $this->value();
if ( $this->multiselect ) {
$defaultValue = explode( ',', $this->value() );
}
?>
* @license http://www.gnu.org/licenses/gpl-2.0.html
* @link https://github.com/maddisondesigns
*/
class Billow_Dropdown_Posts_Custom_Control extends WP_Customize_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 Billow_Google_Font_Select_Custom_Control extends WP_Customize_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 Alternate Web Fonts
*/
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->billow_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 = is_object( $this->fontValues ) && property_exists( $this->fontValues, 'font' ) ? $this->billow_getFontIndex( $this->fontList, $this->fontValues->font ) : false;
}
/**
* Enqueue our scripts and styles
*/
public function enqueue() {
wp_enqueue_script( 'billow-select2-js', trailingslashit( get_template_directory_uri() ) . 'inc/customizer/custom-controls/js/select2.min.js', array( 'jquery' ), '4.0.6', true );
wp_enqueue_script( 'billow-custom-controls-js', trailingslashit( get_template_directory_uri() ) . 'inc/customizer/custom-controls/js/customizer.js', array( 'billow-select2-js' ), '1.0.1', true );
wp_enqueue_style( 'billow-custom-controls-css', trailingslashit( get_template_directory_uri() ) . 'inc/customizer/custom-controls/css/customizer.css', array(), '1.1', 'all' );
wp_enqueue_style( 'billow-select2-css', trailingslashit( get_template_directory_uri() ) . 'inc/customizer/custom-controls/css/select2.min.css', array(), '4.0.6', 'all' );
}
/**
* Export our List of Google Fonts to JavaScript
*/
public function to_json() {
parent::to_json();
$this->json['billowfontslist'] = $this->fontList;
}
/**
* Render the control in the customizer
*/
public function render_content() {
$fontCounter = 0;
$isFontInList = false;
$fontListStr = '';
if( !empty($this->fontList) ) {
?>