Tag Info

Hot answers tagged

3

It should be pretty straight-forward, copy the relevant pieces of code from the page you linked to into your existing TinyMCE plugin, update a few strings... done!.. Start with this for your TinyMCE plugin JS and see how you get on.. // JavaScript Document (function() { // Creates a new plugin class and a custom listbox ...


3

t31os answer is great. Just a side note: to obtain the path to the image add init : function(ed, url) { theurl = url; }, right before createControl: function... and now you can use it in var c = cm.createSplitButton('onehalf', { title : 'My split button', image : theurl + '/theicon.png', onclick : function() { ...


3

I copied your code into my functions.php, and added a simple admin panel ('Foo') to display the editor. Then I created a new directory inside my current theme for the editor button, and put the editor button JS into the relevant file: /wp-content/themes/[my-theme-dir]/tinymce_buttons/pH/editor_plugin.js. Result: when I went to Dashboard > Foo (the panel I'd ...


2

Go into Settings -> TinyMCE Advanced, and check the option Stop removing the <p> and <br /> tags when saving and show them in the HTML editor. This will allow you full control over those tags inside the HTML view. For a single line break without overriding the editor, use Shift+Enter. To override the editor and make Enter a single line break, ...


2

I'd say make the button--but not for performance reasons. I think if you benchmark it, you'll find that any performance overhead added by running a simple function like this (one that does some simple string concat) is quite minimal. Or, at least, down to fractions of fractions of a second on a decent server. If you're under very high load, and are worried ...


2

There is an existing WordPress plugin that does this http://wordpress.org/extend/plugins/tinymce-templates/


2

Try click the "show/hide kitchen sink" button that looks like this:


2

Assuming your resource is included in your Plugin: plugins_url() is the URL to \wp-content\plugins\ (Codex ref) So if you have a .js file in \wp-content\plugins\plugin-slug\file.js: <?php echo plugins_url() . '\plugin-slug\file.js'; ?> BUT WAIT!! If your purpose is actually to load a javascript file, you actually want to enqueue that file, using ...


2

You would need to place a globally namespaced javascript variable in your php code where you enqueue the script to be loaded for the editor pages. So, this code will enqueue a script function to be added to the "edit post/page" screens: add_action('admin_head','my_add_styles_admin'); function my_add_styles_admin() { global $current_screen; $type = ...


1

Something like this looks ot be what you are after http://wordpress.org/extend/plugins/rich-text-tags/


1

would this be heading in the right direction?.. See Mikes Code


1

@frabiacca: I'm not sure if you meant the toolbar menu, like Circle B showed or the height of the writing place. If it's the latter you can : do it easily by gragging the bottom right corner or the textarea or clicking on the fullscreen button of the editor :D do it programmatically codex.wordpress.org/TinyMCE function wptiny($initArray){ ...


1

There are multiple options: Use a real table: <table><tr><td> and so on. Use pre-formatted text: <pre>text</pre> Switch to the HTML editor and enter HTML entities or numerical references for preserved white-space: &#160;


1

The first few you listed are not WordPress specific, and information about them can be found as follows: inlinepopups tabfocus paste media fullscreen As for the WordPress specific plugins, their source code is here (trac). There are no comments, but here's my take based on a very cursory read through: wordpress: seems to setup the editor with default ...


1

Here's a solution. There's a slight problem as it does not recognize when images are added to the editor. 1: Create a folder with the name tinymce-autoresize in the plugins folder. 2. Create a file in tinymce-autoresize named tinymce_autoresize.php with this content: function intialize_autoresize_plugin() { // Check user permission if ( ! ...


1

I figured it out. The window which was opened had to call the tinyMCEPopup.close() in its own scope. Which also meant I had to include the tiny_mce_popup.js script as well.


1

A simple solution may be to download the Members Plugin and then give the subscriber permission to upload_files


1

Use a role editor plugin to give the "subscriber" role upload privildges (upload_files): http://wordpress.org/extend/plugins/user-role-editor/


1

Thanks to Boone's excellent answer, I found the exact problem. For some reason, when there are instances of wp_editor on the page set with teeny=true, custom buttons cannot be used on any instance of wp_editor. If you remove the teeny=true argument, the problem disappears.


1

Well, in terms of performance, I think is always better to avoid any "postmanipulation" to the post_content column in your database. THe problem here as only one solution: making a TinyMCE plugin, a total pain in the ass but affordable. That way you can edit directly your HTML and avoid that manipulation done by shorttags. It's like the hard but correct way ...



Only top voted, non community-wiki answers of a minimum length are eligible