這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

Post Editor Buttons Fork

描述

Add custom buttons to the TEXT mode editor toolbar.

This is a fork of Oren Yomtov’s plugin.

Unsure of the reason behind the poor rating and “doesn’t work” vote. Possibly the user didn’t realized this only adds tags to the HTML editor? If you use this plugin and it works for you, I’d appreciate it if you’d give my a good star rating and an “it works” vote.

Conversely, if you have trouble, please post to the forums, and/or ask me on twitter (@trepmal).

If you need this to work on WordPress < 3.3 download 2.2.1.

螢幕截圖

  • This is how the plugin's interface looks (in 3.2)
  • This is the output of the setting above (in 3.2)

安裝

  1. Upload the post-editor-buttons directory to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Visit the plugins page by clicking the Use link in the plugins description or from the Settings admin panel.

That’s it, now you can start adding your own buttons.

常見問題

I don’t see the buttons I’ve created. Where are they?

This plugin creates buttons for the TEXT editor only.

Can I put classes/styles or other attributes inside the tag?

Yes, but you must use single quotes. For example, this will work:

<

h2 style=’color:#ff0;’>
But this will not:

<

h3 class=”clear”>
As of version 2.1, will be replaced with automatically
As of version 2.3, quote marks should be preserved

Why are my inline styles are being removed?

Some styles are removed by WordPress while others aren’t. For example, this will work:

But this will not:

These styles are being removed when the provided tags are passed through one of WordPress’s sanitation filters.

Why isn’t this tag/attribute being saved?

When you save a custom button, the before/after pieces are filtered. No point in creating a button that adds something that’ll only be removed when you save a post, right?

To allow additional tags, you’ll need to add some code. (I recommend add it to your functions.php file so it will be preserved if you update the plugin).

Here’s how to allow the video tag

add_filter( 'admin_init', 'allowed_tags' );
function allowed_tags() {
    global $allowedposttags;
    $allowedposttags['video'] = array();
}

To add more attributes (in this case, src, type, poster):

add_filter( 'admin_init', 'allowed_tags' );
function allowed_tags() {
global $allowedposttags;
    $allowedposttags['video']['src'] = array();
    $allowedposttags['video']['type'] = array();
    $allowedposttags['video']['poster'] = array();
}

評價

2017年7月7日
When you have to edit content in HTML and insert a lot of the same classes, this plugin becomes precious, as it let's you customise your HTML editor buttons in a rather simple way. There are 2 things I miss, and that's why I'm giving it 4 stars: – a way to re-order the created buttons – a way to export and import the created buttons BTW, it seems to be working fine with 4.8.
2016年11月10日
This is just what I was looking for. I only use text editor but wanted to be able to make custom buttons for the tags I use most. I'm delighted. Thank you for your good work on this.
2016年9月3日
Doeas what it says. It is super useful for creating i.e. hX tags or shortcodes i.e. [button]. I don't like the visual editor, so this additions are great. PS. The code could be more tidy.
閱讀全部11個評價

貢獻者及開發者

“Post Editor Buttons Fork” 是一個開源的軟體。以下的人對這個外掛作出了貢獻。

貢獻者

將 Post Editor Buttons Fork 外掛本地化為台灣繁體中文版。

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

修改日誌

2.4

  • Core buttons can now be removed
  • General maintenance

2.3

  • Uses QTags API introduced in WordPress 3.3
  • Uses new Help Tabs method introduced in WordPress 3.3
  • Info on allowing additional tags/attributes added to help tab.
  • Better handling of quote marks in tags

2.2

  • Fixed issues for non-administrators

2.1

  • Rework of how custom javascript is saved
  • General cleanup and clarification

2.0

  • Initial fork release