Tag Info

New answers tagged

0

Here is an example of How to Update kses and TinyMCE to allow select data-* attributes in WordPress. Reference add_action( 'after_setup_theme', 'x_kses_allow_data_attributes_on_links' ); function x_kses_allow_data_attributes_on_links() { global $allowedposttags; $tags = array( 'a' ); $new_attributes = array( 'data-foo' => array(), ...


0

I tried to get my head around this yesterday and I came pretty close solving this issue. But i gave up in the end, cause it was getting too complicated, when start thinking about all the tools, that you want to include/exclude. If you still wanna do this on your own, these two filters are your friend: attachment_fields_to_edit & ...


2

You asked the question a long ago but I was looking for something similar and found a solution. Enqueue an admin side script on post edit screens(where we have tinyMCE). Then use the code below: (function($) { 'use strict'; $(document).ready(function() { $(document).on( 'click', '#mce-modal-block', function() { ...


0

This worked for me: function hide_editor() { if(isset($_REQUEST['post'])){ $post_id = $_REQUEST['post']; $template_file = get_post_meta($post_id, '_wp_page_template', true); if($template_file == 'page-home.php'){ // template name here remove_post_type_support('page', 'editor'); } } } add_action( 'load-post.php', 'hide_editor' ); ...


1

Better solution if you want to disable this: use a plugin. Same code as from Christine's comments: https://wordpress.org/plugins/disable-emojis/ Same code that also fixes the smilies to be the older ones: https://wordpress.org/plugins/classic-smilies/ Source: Me, since I wrote that code in the first place. ...


15

We will hook into init and remove actions as followed: function disable_wp_emojicons() { // all actions related to emojis remove_action( 'admin_print_styles', 'print_emoji_styles' ); remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); remove_action( ...



Top 50 recent answers are included