baltic_inherit = __( 'Inherit', 'baltic' );
parent::__construct( $manager, $id, $args );
}
/**
* Renders the content for a control based on the type
* of control specified when this class is initialized.
*
* @since 1.0.0
* @access protected
* @return void
*/
protected function render_content() {
switch ( $this->type ) {
case 'baltic-font-family':
$this->render_font( $this->baltic_inherit );
break;
case 'baltic-font-weight':
$this->render_font_weight( $this->baltic_inherit );
break;
}
}
/**
* Renders the title and description for a control.
*
* @return void
*/
protected function render_content_title() {
if ( ! empty( $this->label ) ) {
echo '' . esc_html( $this->label ) . '';
}
if ( ! empty( $this->description ) ) {
echo '' . esc_html( $this->description ) . '';
}
}
/**
* Renders the connect attribute for a connected control.
*
* @return void
*/
protected function render_connect_attribute() {
if ( $this->connect ) {
echo ' data-connected-control="' . esc_attr( $this->connect ) . '"';
echo ' data-inherit="' . esc_attr( $this->baltic_inherit ) . '"';
}
}
/**
* Renders a font control.
*
* @return void
*/
protected function render_font( $default ) {
echo '';
}
/**
* Renders a font weight control.
*
* @return void
*/
protected function render_font_weight( $default ) {
echo '';
}
public function check( $array, $prop, $default = null ) {
if ( ! is_array( $array ) && ! ( is_object( $array ) && $array instanceof ArrayAccess ) ) {
return $default;
}
if ( isset( $array[ $prop ] ) ) {
$value = $array[ $prop ];
} else {
$value = '';
}
return empty( $value ) && null !== $default ? $default : $value;
}
}