isabella232 / editor-templates Goto Github PK
View Code? Open in Web Editor NEWThis project forked from alleyinteractive/editor-templates
This project forked from alleyinteractive/editor-templates
=== Editor Templates === Contributors: mboynes, alleyinteractive Tags: editor, templates, layouts, tinymce Requires at least: 4.4 Tested up to: 4.8.1 Stable tag: 0.1.0 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Adds the TinyMCE Templates plugin to the visual editor in WordPress. == Description == This plugin adds the [TinyMCE Templates plugin](https://www.tinymce.com/docs/plugins/template/) and adds a WordPress filter (`tinymce_editor_templates`) to make adding templates very simple. Here's an example: ``` add_filter( 'tinymce_editor_templates', function( $templates ) { $templates[] = [ 'title' => 'Jumbotron', 'description' => 'Bootstrap jumbotron component', 'content' => '<div class="jumbotron"> <h1 class="display-3">Hello, world!</h1> <p class="lead">This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.</p> <hr class="my-4"> <p>It uses utility classes for typography and spacing to space content out within the larger container.</p> <p class="lead"><a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a></p> </div>', ]; return $templates; } ); ``` Most likely, you'll want to make sure you're using [custom editor styles](https://codex.wordpress.org/Editor_Style) so your template markup renders nicely in the editor. Keep in mind that the editor may strip out some HTML tags and attributes that aren't whitelisted, so you may need to add to that list if any parts of your content get stripped. See [`wp_kses_allowed_html`](https://codex.wordpress.org/Function_Reference/wp_kses_allowed_html) for more information. == Installation == 1. Add and activate the plugin through the 'Plugins' menu in WordPress 2. Add your custom templates using the `tinymce_editor_templates` filter (see Description section).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.