From 0e69c8f412ac1d67ccd7c477868e36355502beab Mon Sep 17 00:00:00 2001 From: Jeff Starr Date: Thu, 15 Nov 2018 00:59:47 +0000 Subject: [PATCH] Update plugin to version 1.8 git-svn-id: https://plugins.svn.wordpress.org/prismatic/trunk@1974529 b8457f37-d9ea-0310-8a92-e5e31aec5664 --- inc/resources-enqueue.php | 10 +++++++--- prismatic.php | 17 ++++++++++++----- readme.txt | 37 +++++++++++++++++++++++++++++++------ 3 files changed, 50 insertions(+), 14 deletions(-) diff --git a/inc/resources-enqueue.php b/inc/resources-enqueue.php index db9ba05..a3a65d9 100644 --- a/inc/resources-enqueue.php +++ b/inc/resources-enqueue.php @@ -264,11 +264,15 @@ function prismatic_active_languages($library) { } - foreach($langs_array as $key => $value) { + if (!empty($langs_array) && is_array($langs_array)) { - foreach ($value as $k => $v) { + foreach($langs_array as $key => $value) { - $languages[] = $v; + foreach ($value as $k => $v) { + + $languages[] = $v; + + } } diff --git a/prismatic.php b/prismatic.php index aa093d9..8024846 100644 --- a/prismatic.php +++ b/prismatic.php @@ -9,9 +9,9 @@ Author URI: https://plugin-planet.com/ Donate link: https://monzillamedia.com/donate.html Requires at least: 4.1 - Tested up to: 4.9 - Stable tag: 1.7 - Version: 1.7 + Tested up to: 5.0 + Stable tag: 1.8 + Version: 1.8 Requires PHP: 5.2 Text Domain: prismatic Domain Path: /languages @@ -137,7 +137,7 @@ if (!class_exists('Prismatic')) { private function constants() { - if (!defined('PRISMATIC_VERSION')) define('PRISMATIC_VERSION', '1.7'); + if (!defined('PRISMATIC_VERSION')) define('PRISMATIC_VERSION', '1.8'); if (!defined('PRISMATIC_REQUIRE')) define('PRISMATIC_REQUIRE', '4.1'); if (!defined('PRISMATIC_NAME')) define('PRISMATIC_NAME', 'Prismatic'); if (!defined('PRISMATIC_AUTHOR')) define('PRISMATIC_AUTHOR', 'Jeff Starr'); @@ -178,16 +178,23 @@ if (!class_exists('Prismatic')) { if ($file == plugin_basename(__FILE__)) { + $home_href = 'https://perishablepress.com/prismatic/'; + $home_title = esc_attr__('Plugin Homepage', 'prismatic'); + $home_text = esc_html__('Homepage', 'prismatic'); + + $links[] = ''. $home_text .''; + $rate_href = 'https://wordpress.org/support/plugin/'. PRISMATIC_SLUG .'/reviews/?rate=5#new-post'; $rate_title = esc_attr__('Click here to rate and review this plugin on WordPress.org', 'prismatic'); $rate_text = esc_html__('Rate this plugin', 'prismatic') .' »'; + $links[] = ''. $rate_text .''; + $pro_href = 'https://plugin-planet.com/prismatic-pro/?plugin'; $pro_title = esc_attr__('Get Prismatic Pro!', 'prismatic'); $pro_text = esc_html__('Go Pro', 'prismatic'); $pro_style = 'padding:1px 5px;color:#eee;background:#333;border-radius:1px;'; - $links[] = ''. $rate_text .''; // $links[] = ''. $pro_text .''; } diff --git a/readme.txt b/readme.txt index b0bf073..c897eef 100644 --- a/readme.txt +++ b/readme.txt @@ -9,9 +9,9 @@ Contributors: specialk Author URI: https://plugin-planet.com/ Donate link: https://monzillamedia.com/donate.html Requires at least: 4.1 -Tested up to: 4.9 -Stable tag: 1.7 -Version: 1.7 +Tested up to: 5.0 +Stable tag: 1.8 +Version: 1.8 Requires PHP: 5.2 Text Domain: prismatic Domain Path: /languages @@ -29,7 +29,7 @@ Display beautiful code snippets with Prism.js, Highlight.js, or plain code escap * __Prism.js__ - Code escape + syntax highlight using [Prism.js](http://prismjs.com/) * __Highlight.js__ - Code escape + syntax highlight using [Highlight.js](https://highlightjs.org/) -* __Plain Flavor__ - Code escape without syntax highlight (for custom styles) +* __Plain Flavor__ - Code escape without syntax highlight **Prism.js Features** @@ -63,6 +63,7 @@ Display beautiful code snippets with Prism.js, Highlight.js, or plain code escap * Enable code escaping for post content, excerpts, and/or comments * Enable code escaping on the frontend, Admin Area, or both * Escapes single-line and multi-line code snippets +* Escapes `` tags based on configuration **General Features** @@ -113,6 +114,12 @@ _[More info on installing WP plugins](http://codex.wordpress.org/Managing_Plugin +**Like the plugin?** + +If you like Prismatic, please take a moment to [give a 5-star rating](https://wordpress.org/support/plugin/prismatic/reviews/?rate=5#new-post). It helps to keep development and support going strong. Thank you! + + + **Uninstalling** Prismatic cleans up after itself. All plugin settings will be removed from your database when the plugin is uninstalled via the Plugins screen. @@ -311,7 +318,9 @@ So for example, to specify a code block as C++, you would write: Multi-line:
...
- Alternate:
...
+ Alternate:
+	                ...
+	           
To disable Prism.js syntax highlighting for any snippet, simply omit the language class. @@ -380,7 +389,9 @@ So for example, to specify a code block as C++, you would write: Multi-line:
...
- Alternate:
...
+ Alternate:
+	                ...
+	           
To disable Highlight.js syntax highlighting for any code block, add a class of `nohighlight`, like so: @@ -405,6 +416,13 @@ __Note:__ uninstalling the plugin from the WP Plugins screen results in the remo Yes, feel free to [suggest a language](https://perishablepress.com/contact/) +**Does this work with Gutenberg Block Editor?** + +As of now, WP 5.0 beta, Gutenberg does not support `
` and `` tags. Currently with the Gutenberg Block Editor, if you try to add for example `
` to your post content, Gutenberg will transform it into `
`. Even switching to "Edit as HTML" and transforming the block into "Preformatted", the result is the same: mangled `
` and `` tags. So until this is fixed in WP, it is impossible to add syntax-highlighted code. Thus, highlighting plugins like Prismatic simply cannot do their jobs.
+
+NOTE: If you need to work with pre/code snippets, you can disable Gutenberg Block Editor using my free plugin, [Disable Gutenberg](https://wordpress.org/plugins/disable-gutenberg/). It restores the Classic Editor so you can work easily with code snippets and other elements in your post content. This is how I roll for all the code I share over at [Perishable Press](https://perishablepress.com/), [Digging Into WordPress](https://digwp.com/), and elsewhere.
+
+
 **Got a question?**
 
 Send any questions or feedback via my [contact form](https://perishablepress.com/contact/)
@@ -433,6 +451,13 @@ Links, tweets and likes also appreciated. Thank you! :)
 
 == Changelog ==
 
+**1.8 (2018/11/14)**
+
+* Fixes bug: Invalid argument foreach() resources-enqueue.php line 267
+* Adds homepage link to Plugins screen
+* Updates default translation template
+* Tests on WordPress 5.0 (beta)
+
 **1.7 (2018/08/17)**
 
 * Adds `rel="noopener noreferrer"` to all [blank-target links](https://perishablepress.com/wordpress-blank-target-vulnerability/)