Changing tooltip for link buttons - tinymce-4

Does anyone know how to change the tooltip for the TinyMCE 4.x link buttons:
Thanks

Tooltips are defined when the button is created. For the button in question look in the link plugin code which is in the plugins/link folder within TinyMCE. You can find the addButton code there and change it as needed:
editor.addButton('unlink', {
icon: 'unlink',
tooltip: 'Remove link',
cmd: 'unlink',
stateSelector: 'a[href]'
});
....note that there are both minified and non-minified versions of the plugin code so change both to make sure your changes will work regardless of whether or not you load the minified or non-minified version of TinyMCE.

Related

Only CSS to open link in a new tab

Hello I have the following problem: I have my website made in Wordpress, and I have a 3D Cover Carousel plugin there, which shows me a gallery of photos in 3d. The thing is that when I click on the image I want the link to be opened in a NEW tab. In the plugin settings there are no such an option. The plugin html is a short code added to my page. So the only thing I can change is Additional css. So is there any options to make a link be opened in a new tab only with css?
As it was previously stated here, there is no way to do this with pure CSS.
If you can use JavaScript, you can target the item and add it the attribute target="_blank".
document.getElementById("element").setAttribute("target", "_blank");
document.getElementById("element").setAttribute("target", "_blank");
You can add this piece of js in your footer.php file.
Another method is to add a js file and include it using wp_enqueue_script function in your function.php file.

Wordpress menu can not be clicked in mobile site

I've tried all the solutions from stackoverflow and wordpress stack exchange, but havn't succeeded.
Problem :
I've updated my wordpress site to latest version word press 4.9.5, I don't know that after updating wordpress or what causes menu to not being clickable..checking in inspector, the ul of nav menu is there but it has css display:none..May be it should be any script or js issue?
What I've Tried:
Deactivates all the plugins
linking the script file of twentyeleven theme(if I've messed up with any script)
Installed the WDES Responsive Mobile Menu plugin
Updated all plugins and themes
Desktop site's Menu screenshot:
Mobile site's Menu screenshot: (menu is not clickable)
Any help would be appreciated. Thanks in advance
console shows these errors:
ReferenceError: lightbox_init is not defined
ReferenceError: omShortcodes is not defined
Try to add this script into your header or footer file.Hope this will help you
<script>
$(document).ready(function(){
$( ".mobile-header-menu-control" ).click(function() {
$( ".mobile-header-menu-container" ).toggle();
});
});
</script>

Need to hide tinymce menubar in wordpress

I am trying to remove the TinyMCE menubar below
from wordpress via the theme functions.php. I dont want to edit the core/script files. Is this possible? Removing button options is straight forward, but stripping this bar is proving difficult.
Thanks
Using tinyMCE 4 you can set the following in the tinymce init:
<script type="text/javascript">
tinymce.init({
menubar: false
});
</script>
Apologies. A colleague installed advanced TinyMCE without me knowing, so i thought this was wordpress default. I have removed it from there. Question can be disregarded.
You can disable menubar by adding following code in enqueue in your theme function.php , selector is option you can use without it as well as said by Milap.
<script language="javascript" type="text/javascript">
tinymce.init({
selector: "textarea",
menubar: false
});
</script>

Error when using tinyMCE in my wordpress settings page

I tried using tinyMCE directly from the package included with:
<script src="//tinymce.cachefly.net/4.0/tinymce.min.js"></script>
And then I just set this in my jQuery file:
tinymce.init({
selector: "textarea"
});
Now, for some reason that I can't understand, all my textareas are hidden (visibility:hidden) and nothing else is showing up. I am modifying the DOM in this file with jQuery but I tried to insert a non-modified textarea and still nothing shows up. Is there something with Wordpress that makes this error? I am writing this in the functions.php-file.
Or maybe you should simply use wp_editor() php function
http://codex.wordpress.org/Function_Reference/wp_editor

Wordpress - Adding TinyMCE on Frontend into jQuery UI widget

I'm creating a Wordpress App. It consists on using custom fields on custom type, for managing personal projects.
My issue: I want to add the admin editor (tinyMCE) on frontend. Considering that I can have many textareas that will begin TinyMCE editors. So, I used this code:
PHP (on theme functions.php):
// TINY-MCE EDITOR ON FRONTEND
add_filter('wp_head','add_tinymce_editor');
function add_tinymce_editor(){
wp_admin_css('thickbox');
wp_enqueue_script('wp-tinymce');
wp_enqueue_script('tinymce');
wp_enqueue_script('editor');
add_thickbox();
}
JS (on theme single-projects.php):
jQuery(document).ready(function(){
// EDITORS
tinyMCE.init({
mode : "specific_textareas",
theme : "simple",
editor_selector :"tinymce_enabled"
});
});
On JS I set the "editor_selector" with a Class for all textareas that will begin tinyMCE editors. I cannot assign a single ID for each textareas because these can be 4 or 5 or 6, or more!!!
HTML: (on theme single-projects.php):
<textarea name="new-task-description" id="new-task-description"
class="tinymce_enabled required"></textarea>
Each textarea is present on Jquery UI Accordions.
Now, my problem is, on Firebug (or browser console) I get this error:
tinyMCE is not defined
What's wrong?
thanks in advance!!!
With Wordpress 3.3 you can use wp_editor() which is a lot easier.
http://codex.wordpress.org/Function_Reference/wp_editor
The right way to include scripts is add_action('wp_enqueue_scripts', 'tinymce_editor');
If tinymce is not defined the file tiny_mce.js has not been loaded on the page. Make sure the file gets loaded eigther directly or with the means wordpress offers.

Resources