在编写文章、页面上的“添加媒体”按钮旁边添加新按钮

WORDPRESS在4.1版新推出了免打扰模式,即屏蔽左右选项,仅留编辑器部分,让写作者看到更加清爽的界面。

但对于一个排版按照像素来计算的人来说,编辑一些内容就希望预览一下,可预览按钮已经被屏蔽掉了~

今天就针对这类人群,提供一个可以将预览、或者其他按钮放在免打扰未屏蔽的区域的办法~

成品如下图所示~:

在编写文章、页面上的“添加媒体”按钮旁边添加新按钮

继续阅读在编写文章、页面上的“添加媒体”按钮旁边添加新按钮

WordPress 删除特色图像CLASS或添加、删除某个CLASS样式名

最近因为某些原因,给别人解答了几个关于WP的问题,由于问问题的人是一个完完全全的处女座(上升星座也是处女90%),所以特别抠细节。看到特色图像的wp-post-image以及其他地方都很不爽,希望去掉……

在百度、GOOGLE上搜索了一圈无果……发现原来就他有这个强迫症,网上根本没有人会希望解决这个问题……

所以没办法……帮他写的代码……而这个代码有扩展用法……就一起编辑出来吧。

一、完全去掉特色图像的CLASS或者其他属性

继续阅读WordPress 删除特色图像CLASS或添加、删除某个CLASS样式名

WordPress Ver 4.2絵文字表示を消去する方法

中國語Ver:https://www.uazoh.com/archives/1647.html

絵文字に関する記述を消したい場合は、functions.phpに以下のように記述します。

function disable_emoji_tinymce( $plugins ) {
	return array_diff( $plugins, array( 'wpemoji' ) );
}

function remove_emoji() {
	remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
	remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
	remove_action( 'wp_print_styles', 'print_emoji_styles' );
	remove_action( 'admin_print_styles', 'print_emoji_styles' );
	remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
	remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
	remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
	add_filter( 'tiny_mce_plugins', 'disable_emoji_tinymce' );
}

add_action( 'init', 'remove_emoji' );

以上。

wordpress 4.2版造成的顶部菜单无法打开解决办法

WordPress4.2版更新之后,又连续更新了4.2.1和4.2.2,但我发现之前因4.2版造成的后台外观→菜单选项卡里显示选项无法打开的问题,一直没有解决。

实在没办法,研究下代码,找到下面这个方法解决。说直观点就是关掉显示选项旁边的帮助选项卡即可(4.2以上版本的\wp-admin\nav-menus.php文件有问题)

继续阅读wordpress 4.2版造成的顶部菜单无法打开解决办法

WordPress于2015年5月7日更新4.2.2,修复若干BUG

In addition to the security fixes, WordPress 4.2.2 contains fixes for 13 bugs from 4.2.1, including:

  • Fixes an emoji loading error in IE9 and IE10
  • Fixes a keyboard shortcut for saving from the Visual editor on Mac
  • Fixes oEmbed for YouTube URLs to always expect https
  • Fixes how WordPress checks for encoding when sending strings to MySQL
  • Fixes a bug with allowing queries to reference tables in the dbname.tablename format
  • Lowers memory usage for a regex checking for UTF-8 encoding
  • Fixes an issue with trying change the wrong index in the wp_signups table on utf8mb4 conversion
  • Improves performance of loop detection in _get_term_children()
  • Fixes a bug where attachment URLs were incorrectly being forced to use https in some contexts

翻译:

  1. 修复IE9和IE10的表情符号加载错误
  2. 修复Mac上的可视化编辑器键盘快捷键保存错误
  3. 修复YouTube的视频地址总是采用HTTPS的错误
  4. 修复发送MySQL字符串时WordPress的检查编码BUG
  5. 修复允许在dbname.tablename格式查询参考表的BUG
  6. 降低了使用正则表达式检查UTF-8编码时的内存占用
  7. 修复wp_signups表索引utf8mb4转换错误的问题
  8. 改善循环检测_get_term_children的性能()
  9. 修复了在某些情况下使用https,附件URL的错误

受影响文件

wp-admin/js/editor-expand.js
wp-admin/about.php
wp-admin/includes/update-core.php
wp-admin/includes/upgrade.php
wp-includes/taxonomy.php
wp-includes/compat.php
wp-includes/version.php
wp-includes/post.php
wp-includes/js/wp-emoji.js
wp-includes/js/wp-emoji-loader.js
wp-includes/js/tinymce/tiny_mce_popup.js
wp-includes/js/tinymce/tinymce.min.js
wp-includes/js/tinymce/plugins/wordpress/plugin.js
wp-includes/js/tinymce/tinymce.js
wp-includes/comment.php
wp-includes/wp-db.php
wp-includes/pluggable.php
wp-content/themes/twentyfifteen/genericons/example.html (deleted)
wp-content/themes/twentythirteen/genericons/example.html (deleted)
wp-content/themes/twentyfourteen/genericons/example.html (deleted)
readme.html

一段代码搞定WordPress新版Emoji颜文字表情代码

WordPress在2015年4月24日更新了4.2版,但更新完,小伙伴们会发现代码wp_head加载了一段SCRIPT和一段CSS,如果不需要,可以彻底关闭

将下面代码放在主题的functions.php

function disable_emoji_tinymce( $plugins ) {
	return array_diff( $plugins, array( 'wpemoji' ) );
}

function remove_emoji() {
	remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
	remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
	remove_action( 'wp_print_styles', 'print_emoji_styles' );
	remove_action( 'admin_print_styles', 'print_emoji_styles' );
	remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
	remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
	remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
	add_filter( 'tiny_mce_plugins', 'disable_emoji_tinymce' );
}

add_action( 'init', 'remove_emoji' );