Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. Bug Reports
  3. TinyMCE - superscript button in backend text editor

TinyMCE - superscript button in backend text editor

Scheduled Pinned Locked Moved Bug Reports
4 Posts 3 Posters 103 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jtob
    wrote on last edited by jtob
    #1

    Hey there,

    I use quite a lot of superscript numbers in my texts. I can insert them using <sup> but it is time-consuming.

    I tried to activate the extra superscript buttons in the normal text editor bar. I added the following code to ThemeFunctions.php, which I was hoping would trigger the hidden TinyMCE button:

    function my_mce_buttons_2( $buttons ) {	
    	/**
    	 * Add in a core button that's disabled by default
    	 */
    	$buttons[] = 'superscript';
    	$buttons[] = 'subscript';
    
    	return $buttons;
    }
    add_filter( 'mce_buttons_2', 'my_mce_buttons_2' );
    

    This didn't have any impact on the backend text editor. I tried a few iterations of the same code, but same thing.

    After reading a few other posts on here talking about TinyMCE, I am guessing you are using a custom text editor and it's not possible to add these superscript buttons. Is that right? If there's a way to show them, please do let me know :)

    Thanks!
    Jonas

    1 Reply Last reply
    0
    • mariusjopenM Offline
      mariusjopenM Offline
      mariusjopen
      Global Moderator
      wrote on last edited by
      #2

      Dear @jtob
      this is probably true.

      Ok, thank you for writing. We will have a look also with Armin and hope to get back to you as soon as possible.
      Thank you for using LayTheme!
      Marius

      www.mariusjopen.world

      1 Reply Last reply
      0
      • arminunruhA Offline
        arminunruhA Offline
        arminunruh
        Global Moderator
        wrote on last edited by
        #3

        i change buttons like this too:

        	add_filter( 'mce_buttons' , array($this, 'add_textformats_button_if_textformats_everywhere'), 10, 2 );
        	add_filter( 'mce_buttons_2' , array($this, 'second_tinymce_button_row'), 10, 2 );
        

        and then

        function second_tinymce_button_row($buttons, $editor_id){
        	$everywhere = get_option('gridder_options_textformats_everywhere', '');
        	$minimal_buttons = get_option( 'gridder_options_minimal_wysiwyg_buttons', "" );
        	if($everywhere == "on" && $minimal_buttons == "on"){
        		return array();
        	}
        
        	return $buttons;
        }
        

        not sure why it doesnt work for u

        i cant really help u here

        1 Reply Last reply
        0
        • arminunruhA Offline
          arminunruhA Offline
          arminunruh
          Global Moderator
          wrote on last edited by
          #4

          ah lol

          maybe try the filter

          mce_buttons

          instead of

          mce_buttons_2

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          I also code custom websites or custom Lay features.
          šŸ’æ Email me here: šŸ’æ
          info@laytheme.com

          Before you post:
          1. When using a WordPress Cache plugin, disable it or clear your cache.
          2. Update Lay Theme and all Lay Theme Addons
          3. Disable all Plugins
          4. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"

          This often solves issues you might run into

          When you post:
          1. Post a link to where the problem is
          2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
          3. If the problem is difficult to explain, post screenshots / link to a video to explain it
          Online Users
          C
          craigfeldspar
          P
          panthera
          A
          aerotec
          A
          alasdair17
          Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
          laytheme.com
          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Recent
          • Tags
          • Popular
          • Users
          • Search