Hot answers tagged

14

Here's a way to test the core patch #33300.6 by Andew Ozz, through a test plugin in WP 4.5.2, to try out the text pattern filter. Demo Here's a strikethrough example using ~ $init['wpsetextpattern_inline_patterns'] = '{ strong: { start: "*", end: "*", format: "bold" }, strong2: { start: "**", end: "**", format: "bold" ...


6

I suggest using keywords for them. so you would do something like [shortcode attr="single_quote double_quote"]test[/shortcode]. Then, while parsing the shortcode you can change them back.


5

So, I may or may not go to hell for this, but I made a quickfix plugin that bypasses the inline part and just opens the link editor. You can find it here. I didn't spend much time testing it, if you find problems make issues in github and I will see if I can fix it. The way it works is that I removed wplink as a plugin from tinyMCE, then added wplinkc, ...


3

I was hunting for a way to do this, and no-one seems to mention the wp_editor_settings filter. This worked for me: function my_editor_settings($settings) { $settings['quicktags'] = false; return $settings; } add_filter('wp_editor_settings', 'my_editor_settings');


2

In theme options, I had to define wp_editor_settings. So, just in options.php, I used: //WP_editor settigs $wp_editor_settings = array( 'wpautop' => true, // Default 'textarea_rows' => 15, 'tinymce' => array( 'plugins' => 'fullscreen,wordpress,wplink, textcolor' )); Basically, I'm adding tinymce ...


2

I think you mean the font color inside the TinyMCE editor. The wp_editor() function have the settings parameter, there you reference to an var like ``. This parameter need a array and this array can use a lot of parameters. The follow example demonstrate this and the codex have also a documentation. $settings = array( 'wpautop' => true, '...


2

If you don't need wp_editor in front-end, I think its OK. Here a little bit different option settings with your tinymce init. I use this without wp_editor in front-end. <script> jQuery( document ).ready( function( $ ) { tinymce.init( { mode : "exact", elements : 'pre-details', theme: "modern", skin: "lightgray", ...


2

You can adjust the attachment query in the media library popup, through the ajax_query_attachments_args filter. Here are two PHP 5.4+ examples: Example #1: Show only attachments that where uploaded during the last 24 hours: /** * Media Library popup * - Only display attachments uploaded during the last 24 hours: */ add_filter( '...


1

After few days I got it to work. Gotta check those core files, now I know how. Anyways, here is the working code: function my_tiny_mce_tweaks( $first_init ) { $first_init['formats'] = '{' . 'alignleft: [' . '{selector: "p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li", styles: {textAlign:"left"}},' . '{selector: "img,table,dl.wp-caption", ...


1

In WordPress 4.2 the editor was removed on whichever page was assigned to show Latest Posts for whatever reason. The following function below ( original solution found here by crgeary ) will re-add the editor and remove the notification: You are currently editing the page that shows your latest posts. Here's some information on the hooks used: ...


1

I'm not a very good coder, I've only asked questions on here, but because no one was able to answer your question, I suppose I'll give it a shot. If I remember correctly, this should remove the toolbars on the tinyMCE: function my_format_TinyMCE( $in ) { $in['toolbar1'] = ''; $in['toolbar2'] = ''; $in['toolbar'] = false; return $in; } ...


1

Might be possible that your wp_editor is broken! According to codex you can not use numeric editor ID may only contain lowercase letters and underscores...hyphens will cause editor to not display properly Call wp_editor in this way wp_editor( $nga_textarea_field_1_invalid, 'nga_textarea_field_one' ); textarea_name is not required because by default ...


1

What a great question. Here is the function: function add_taxonomies_to_pages() { register_taxonomy_for_object_type( 'post_tag', 'page' ); register_taxonomy_for_object_type( 'category', 'page' ); } add_action( 'init', 'add_taxonomies_to_pages' ); Get back to winning, now.


1

Might be because you are using a depreciated function for updating/adding the user meta (update_usermeta). You need to use update_user_meta function. WP Codex: https://codex.wordpress.org/Function_Reference/update_user_meta


1

you're using : // only low case [a-z], no hyphens and underscores $editor = 'contenten'; and then trying to get it by different name: if(isset($_POST['content_en']) && $_POST['content_en'] != '') another thing is u using different keys like @vancoder said also remember to sanitize the data : https://codex.wordpress.org/Data_Validation this ...


1

After struggling with it, found the solution which works, in a callback after you add new element: tinymce.execCommand( 'mceAddEditor', true, element.id ); Its strange that there is zero documentation inside codex.


1

I was hunting for a way to disable the 'Text' tab for all users, and nowhere did I see the filter below mentioned. This worked for me: function my_editor_settings($settings) { $settings['quicktags'] = false; return $settings; } add_filter('wp_editor_settings', 'my_editor_settings');


1

Silly mistake, my custom page was missing the <?php wp_footer(); ?>


1

The hook is media_send_to_editor. From the source of core. apply_filters ( 'media_send_to_editor', string $html, int $send_id, array $attachment  ) Filter the HTML markup for a media item sent to the editor.


1

This is how the tinymce statusbar displays on my intsall: <div id="mceu_34" class="mce-statusbar mce-container mce-panel mce-stack-layout-item mce-last" hidefocus="1" tabindex="-1" role="group"> <div id="mceu_34-body" class="mce-container-body mce-flow-layout"> <div id="mceu_35" class="mce-path mce-flow-layout-item mce-first mce-...


1

I believe the helper you're looking for (assuming we're not dealing with a custom post type) is: <?php remove_post_type_support('page', 'editor'); ?> When dealing with a custom post type you can exclude 'editor' from the 'supports' parameter to initialize the post type without the editor window. Finally, if you are trying to disable the editor only ...


1

The wordpress editor is designed to work in wordpress enviroment and there is not much point in trying to somehow make it work "outside" of wordpress. You might hack it but any wordpress upgrade might break it. You need to use your php in the wordpress context by making a page template for your theme out of the your php.


1

You can pass an array of settings to the editor instance. For possible values please refer to the tinymce documentation, in your case 'init_instance_callback' might be helpful. https://www.tinymce.com/docs/configure/integration-and-setup/#init_instance_callback wp_editor('', 'sedemoeditor', array( 'tinymce' => array( '...


1

Add the filter "ajax_query_attachments_args" in this way and URLs variables are sent to the class WP_Query the default is to send array(7) { ["orderby"]=> string(4) "date" ["order"]=> string(4) "DESC" ["posts_per_page"]=> string(2) "40" ["paged"]=> string(1) "1" ["post_type"]=> string(10) "...



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