Skip to content

Commit

Permalink
fixes #1017
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed Jun 4, 2016
1 parent 7d2da92 commit 35cfc10
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
15 changes: 0 additions & 15 deletions includes/controls/class-kirki-controls-code-control.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,6 @@ class Kirki_Controls_Code_Control extends Kirki_Customize_Control {
*/
public $type = 'kirki-code';

/**
* Refresh the parameters passed to the JavaScript via JSON.
*
* @access public
*/
public function to_json() {
if ( ! isset( $this->choices['language'] ) ) {
$this->choices['language'] = 'css';
}
if ( ! isset( $this->choices['theme'] ) ) {
$this->choices['theme'] = 'monokai';
}
parent::to_json();
}

/**
* Enqueue control related scripts/styles.
*
Expand Down
4 changes: 4 additions & 0 deletions includes/field/class-kirki-field-code.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@ protected function set_type() {
*/
protected function set_choices() {

// Get l10n strings
$l10n = Kirki_l10n::get_strings( $this->kirki_config );

// Make sure we have some defaults in case none are defined.
$defaults = array(
'language' => 'css',
'theme' => 'kirki-dark',
'label' => $l10n['open-editor'],
);
$this->choices = wp_parse_args( $this->choices, $defaults );

Expand Down

0 comments on commit 35cfc10

Please sign in to comment.