WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Change 'Quicktags' name in dropdown & Move row

[Resolved] Change 'Quicktags' name in dropdown & Move row

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Frank Bueltge

    @bueltge

    The string Quicktags is current hard inside the javascript.
    But you can change it with a custom plugin and jquery

    var value = $("#content_rmnlQuicktagSettings_tmce_text").val(); // value = 9.61 use $("#text").text() if you are not on select box...
        value = value.replace("Quicktags", "something else string");

    If you will change the position of the button, then deactive my default filter and add new, also in the custom plugin.

    if ( ! class_exists( 'Add_Quicktag_2_TinyMce' ) )
            return NULL;
    
        remove_filter( 'mce_buttons_2',        array( 'Add_Quicktag_2_TinyMce', 'extend_editor_buttons' ), 10, 2 );
        add_filter( 'mce_buttons_4',        array( 'Add_Quicktag_2_TinyMce', 'extend_editor_buttons' ), 10, 2 );

    The number on the button-Hook is the line inside the editor.

    * I have not tested the source, but I think it works.

    Hey Frank!

    Thanks for getting back to me so quickly.

    Having a little problem implementing your fixes, I’ve included both code snippets into a plugin and tried to activate but it says it triggers a fatal error…?

    Have I done something incorrectly? My plugin code:

    <?php
    /**
     * Plugin Name: QuickTags drop-down menu-reposition and change
     */
    
    var value = $("#content_rmnlQuicktagSettings_tmce_text").val(); // value = 9.61 use $("#text").text() if you are not on select box...
        value = value.replace("Quicktags", "something else string");
    
    if ( ! class_exists( 'Add_Quicktag_2_TinyMce' ) )
            return NULL;
    
        remove_filter( 'mce_buttons_2',        array( 'Add_Quicktag_2_TinyMce', 'extend_editor_buttons' ), 10, 2 );
        add_filter( 'mce_buttons_4',        array( 'Add_Quicktag_2_TinyMce', 'extend_editor_buttons' ), 10, 2 );
    
    ?>

    Thanks again for all your help,

    Regards,
    Paul

    Plugin Author Frank Bueltge

    @bueltge

    No.

    Check this.

    <?php
    	/**
    	 * Plugin Name: QuickTags drop-down menu-reposition and change
    	 */
    
    	if ( ! class_exists( 'Add_Quicktag_2_TinyMce' ) )
    		return NULL;
    
    	add_action( 'admin_footer-post-new.php', 'fb_change_quicktags_text' );
    	add_action( 'admin_footer-post.php', 'fb_change_quicktags_text' );
    	function fb_change_quicktags_text() {
    		?>
    		<script type="text/javascript">
    		jQuery(document).ready( function($) {
    			var value = $("#content_rmnlQuicktagSettings_tmce_text").val();
    			value = value.replace("Quicktags", "something else string");
    		} );
    		</script>
    		<?php
    	}
    
    	remove_filter( 'mce_buttons_2', array( 'Add_Quicktag_2_TinyMce', 'extend_editor_buttons' ), 10, 2 );
    	add_filter( 'mce_buttons_4',    array( 'Add_Quicktag_2_TinyMce', 'extend_editor_buttons' ), 10, 2 );

    Hey Frank,

    Thanks for sending that through. I’ve put into a plugin and activated, and although there are no errors coming up the drop-down menu does not seem to have moved position, neither has it been renamed…

    Any ideas?

    Thanks,
    Paul

    Plugin Author Frank Bueltge

    @bueltge

    Sorry, is it not so easy. WP init all this dynamicly and render the buttons. Also the string: I think the plugin is to early, why WP render the strings.

    Hey Frank,

    So does that mean there is no solution to this problem?

    Regards,
    Paul

    Hey Frank,

    No worries, I’ve just done core edits to plugin files and will do this on each update, changes made for other people who wish to do the same:

    /inc/class-tinymce.php – Changed line 49 from mce_buttons_2 to mce_buttons_4
    /inc/tinymce/editor_plugin.js – Changed line 10 from Quicktags to Whatever you want

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Resolved] Change 'Quicktags' name in dropdown & Move row’ is closed to new replies.