WordPress plugin intelligence profile

WP Colored Coding

Syntax highlighting with Rainbow.js.

WP PlugIndex snapshot

Current directory snapshot

Tested up to WordPress 4.0
Current version2014.08.19
WordPress coverageTested up to WordPress 4.0
Minimum stackWP 3.9.2 · PHP —
Directory statusactive
Last directory update5 Sept 201412y ago
Active installations10Adoption metric — not a quality score
WordPress.org ratingNo WordPress.org ratings yet
Official packageDirect from WordPress.org

Repository metrics are context, not quality scores. Active installations measure adoption and can strongly reflect a plugin’s age and historical popularity. Ratings, recent updates and “Tested up to” metadata also do not guarantee modern code, error-free operation, security, feature completeness or suitability for a particular site. Why active installs don’t tell the whole story →

WP PlugIndex currently records WP Colored Coding version 2014.08.19 as active, updated 12y ago and tested up to WordPress 4.0.

Overview

About this plugin

js to your WordPress-Blog and allows you to manage code snippets independend from the text editor.

IMPORTANT! 2!

Quick Start

  • Download the plugin from this page
  • Follow the instructions on the WordPress Codex to install the plugin.

By default, the plugin is ready for use after activation. Some options can be changed on Settings → Writing.

For a detailed usage manual refer to the Usage section, or – better than a thousand words – to the screenshots.

If you want to change the behaviour of the plugin see the API-Documentation

Settings

By default, the plugin is ready for use after activation. Some options can be changed on Settings → Writing.

Raw output

This option enables an additional checkbox for each codeblock of a post which allows you to disable the esc_attr() filter for that code snippet. That means, every HTML and Javascript inside this textarea will be parsed by the browser as those. So be carefull with this option.

Usage

Codeblocks

A single Codeblock is identified (in the posts context) by its name. If you don’t want to specify a name for each block, leave it empty, it will be generated automatically.

The language field is also optional. To use syntax highlighting, write in a rainbow supported language. ) Currently these are

* C

* Coffeescript

* C#

* CSS

* Go

* HTML

* Java

* JavaScript

* Lua

* PHP

* Python

* R

* Ruby

* Shell

* Smalltalk

Each codeblock can be placed anywhere in the text by using the shortcode [cc name="{name}"]. You can use the TinyMCE button »CC« for that.

Shortcode (in-text code)

For just a few lines of code you may want to use the shortcode like this:

[cc lang="javascript"] var str = 'Hello World'; alert( str ); [/cc]

Contribution & Bug-Report

For bug reports or ideas for new features, please use the issue tracker on gitub.

API

The following filters are provided:

  • wp_cc_rainbow_themes
  • wp_cc_rainbow_scripts
  • wp_cc_rainbow_languages

Adding a new Theme is quite easy. Just expend the themes-array by a key like this

/** * @param array $themes * @return array */ function my_new_rainbow_theme( $themes ) { $themes[ 'my_theme' ] = array( 'src' => //the absolute URI to the stylesheet 'name' => 'My Theme' );

return $themes; } add_filter( 'wp_cc_rainbow_themes', 'my_new_rainbow_theme' );

To add a supported language use

/** * @param array $scripts * @return array */ function my_new_rainbow_script( $scripts ) { $scripts[ 'my_new_lang' ] = array( 'src' => //the absolute URI to the script 'depth' => array( 'rainbow' ), 'lang' => 'my_new_lang', 'in_footer' => TRUE # this must be equal with the script it depends on );

# to override the built-in rainbow version use the key 'rainbow'

return $scripts; } add_filter( 'wp_cc_rainbow_scripts', 'my_new_rainbow_script' );

/** * @param array $langs * @return array */ function my_new_lang( $langs ) {

$langs[ 'my_new_lang' ] = 'My new lang';

return $langs; } add_filter( 'wp_cc_rainbow_languages', 'my_new_lang' );

Deactivation/Uninstallation

If you deactivate the plugin all settings and codes will be preserved. On uninstallation (delete), all settings and codes will be deleted finally. If this is triggered from the network-admin page, all blogs will be cleaned up.

Acknowledgement

  • Thanks to sparanoid for chinese translation
  • Thanks to @volleyballfisch for spanish translation
  • Thanks to yonjah for JS Bugfixing
WordPress.org metadata

Plugin tags

Topics listed for this plugin in the WordPress.org directory.

  • code samples
  • rainbow js
  • syntax highlighting
  • rainbow.js
Compatibility & maintenance

Compatibility & maintenance

Tested up to WordPress 4.0

Not yet marked as tested with WordPress 7.1. WordPress.org currently lists Tested up to 4.0.

Current WordPress releaseWordPress 7.1
WordPress.org Tested up to4.0
Minimum requirementsWordPress 3.9.2 · PHP not listed
Update activity5 Sept 201412y ago

“Tested up to” is directory metadata supplied by the plugin author. WP PlugIndex does not turn an older declaration into a claim that the plugin is incompatible.

Changes recorded by WP PlugIndex

Recent tracked changes

No tracked version or compatibility changes have been recorded by WP PlugIndex yet.

Tracking & source

WP PlugIndex tracks public WordPress.org directory metadata and records selected version, compatibility and availability changes as they are detected.

Plugin watchlist

Watch this plugin

Sign in to your WP PlugIndex account or create a free account. Free accounts can watch up to 5 plugins and see what changed.

Watch limit

Watchlist limit reached

You have reached your current active watch limit.