I am using Word Press 5.4.2, Elementor 2.9.13 and Syntax Highlighter.
When editing the post in Elementor editor, the format is perfect. Back color black. Text with different colours. I use C++ (Arduino).
When you open de post in the browser (I tried Brave and Chrome), the text appears almost white, with white back. I guess I have a problem in the format. But I cannot find the solution. I tried changing the language, with no effect.
Please help. Thanks in Advance.
]]>Edit: sorry I had not realize this plugin was for the Plugins and Themes Editor, I thought it was for the pages/posts editor. My apologies.
============
Hi,
First of all thanks for sharing this plugin.
I tried it on three different installs with no success, all of them running WP 3.9.1.
Some help would be very much appreciated.
Best Regards,
Diego
Additional themes would be great I’m not really a fan of Chrome or Tomorrow Night. Since there are more themes included with the plugin you might as well let us choose from them o.O
syntax-highlight/class-sh-settings.php
public function theme_callback() {
?>
<select
id="theme"
name="<?php echo $this->option_name; ?>[theme]"
value="<?php esc_attr_e( $this->options['theme'] ); ?>">
<option value="ambiance" <?php selected( 'ambiance' == $this->options['theme'] ); ?> >Ambiance</option>
<option value="chaos" <?php selected( 'chaos' == $this->options['theme'] ); ?> >Chaos</option>
<option value="chrome" <?php selected( 'chrome' == $this->options['theme'] ); ?> >Chrome</option>
<option value="clouds" <?php selected( 'clouds' == $this->options['theme'] ); ?> >Clouds</option>
<option value="clouds_midnight" <?php selected( 'clouds_midnight' == $this->options['theme'] ); ?> >Clouds Midnight</option>
<option value="cobalt" <?php selected( 'cobalt' == $this->options['theme'] ); ?> >Cobalt</option>
<option value="crimson_editor" <?php selected( 'crimson_editor' == $this->options['theme'] ); ?> >Crimson Editor</option>
<option value="dawn" <?php selected( 'dawn' == $this->options['theme'] ); ?> >Dawn</option>
<option value="dreamweaver" <?php selected( 'dreamweaver' == $this->options['theme'] ); ?> >Dreamweaver</option>
<option value="idle_fingers" <?php selected( 'idle_fingers' == $this->options['theme'] ); ?> >Idle Fingers</option>
<option value="katzenmilch" <?php selected( 'katzenmilch' == $this->options['theme'] ); ?> >Katzenmilch</option>
<option value="kr" <?php selected( 'kr' == $this->options['theme'] ); ?> >Kr</option>
<option value="kuroir" <?php selected( 'kuroir' == $this->options['theme'] ); ?> >Kuroir</option>
<option value="merbivore" <?php selected( 'merbivore' == $this->options['theme'] ); ?> >Merbivore</option>
<option value="mono_industrial" <?php selected( 'mono_industrial' == $this->options['theme'] ); ?> >Mono Industrial</option>
<option value="monokai" <?php selected( 'monokai' == $this->options['theme'] ); ?> >Monokai</option>
<option value="pastel_on_dark" <?php selected( 'pastel_on_dark' == $this->options['theme'] ); ?> >Pastel on Dark</option>
<option value="solarized_dark" <?php selected( 'solarized_dark' == $this->options['theme'] ); ?> >Solarized Dark</option>
<option value="solarized_light" <?php selected( 'solarized_light' == $this->options['theme'] ); ?> >Solarized Light</option>
<option value="terminal" <?php selected( 'terminal' == $this->options['theme'] ); ?> >Terminal</option>
<option value="textmate" <?php selected( 'textmate' == $this->options['theme'] ); ?> >Textmate</option>
<option value="tomorrow_night" <?php selected( 'tomorrow_night' == $this->options['theme'] ); ?> >Tomorrow Night</option>
<option value="tomorrow_night_blue" <?php selected( 'tomorrow_night_blue' == $this->options['theme'] ); ?> >Tomorrow Night - Blue</option>
<option value="tomorrow_night_bright" <?php selected( 'tomorrow_night_bright' == $this->options['theme'] ); ?> >Tomorrow Night - Bright</option>
<option value="tomorrow_night_eighties" <?php selected( 'tomorrow_night_eighties' == $this->options['theme'] ); ?> >Tomorrow Night - Eighties</option>
<option value="twilight" <?php selected( 'twilight' == $this->options['theme'] ); ?> >Twilight</option>
<option value="vibrant_ink" <?php selected( 'vibrant_ink' == $this->options['theme'] ); ?> >Vibrant Ink</option>
<option value="xcode" <?php selected( 'xcode' == $this->options['theme'] ); ?> >xCode</option>
</select>
<?php
}
If you could add drag and drop support for theme files it would be even better but I’m not really sure how to accomplish that since you’d have to regex to grab only “theme-” tagged files from the directory o.O
]]>I am wondering if this is perhaps intentional but I would love support for the post/page editor.
]]>Does not match the data type, the second argument wp_localize_script:
$sh_settings = array_merge( array(
'unsaved_changes_txt' => __('Some changes have not been saved.', 'syntax-highlight')
), $sh_settings);
wp_localize_script( $this->js_handle, 'shSettings', $sh_settings);
Fix:
if(is_array($sh_settings)) {
$sh_settings = array_merge(array(
'unsaved_changes_txt' => __('Some changes have not been saved.', 'syntax-highlight')
), $sh_settings);
}else{
$sh_settings= array();
}
]]>
I′m using Windows with XAMPP (PHP Version: 5.4.16 and Web Server: Apache).
I tryed with FireFox and Chrome (latest versions), same error on both.
After install i go to the editor (plugin or theme) and one warning is showed all the time:
Warning: array_merge(): Argument #2 is not an array in C:\xampp\htdocs\wp\wp-content\plugins\syntax-highlight\syntax-highlight.php on line 165
And i think that the plugin not works as expected, because i hit Ctrl+S and appears the browser dialog to save and not save the edits.
Hope it can helps. Nice plugin.
]]>How would I be able to enable this plugin in the backend of my theme’s custom CSS editor?
]]>Hey!
Congrats for the awesome plugin!
How can I help you to translate it to pt_BR?
Is there a repository in Github?
Cheers!
]]>