Page MenuHomePhabricator

[Spike] Search and Preview feature in Classic Editor
Closed, ResolvedPublic

Event Timeline

after a few days of spike, extend the Classic Editor will require a lot of effort including modifying the core files

the full explaination with the help from ChatGPT

add a custom button directly to the native Classic Editor without relying on the TinyMCE editor or other plugins, it's important to clarify that the Classic Editor does not have an out-of-the-box feature for adding custom buttons to its toolbar like the block-based Gutenberg editor.

The Classic Editor's toolbar is not designed to be easily extended with custom buttons using standard WordPress APIs. Adding a custom button to the toolbar would involve complex modifications to the WordPress core files, which is generally not recommended as it can lead to compatibility issues, security vulnerabilities, and maintenance challenges.

Given this limitation, I strongly recommend considering using the block-based Gutenberg editor or exploring alternative methods to achieve your desired functionality. The Gutenberg editor provides a more structured and extensible approach for creating custom content blocks, and there are plugins available that allow you to create custom blocks without writing extensive code.

If we want to support the wikipedia links in classic editor, I recommend enable the auto detect links feature when user using the classic editor (this require some dev work on it),

then we need to document it and let the editor know the plugin works in this way.

image.png (1,834×909 px, 528 KB)

Don't trust everything chatGPT says. This other WP plugin (source) adds a custom button to the classic editor.

Don't trust everything chatGPT says. This other WP plugin (source) adds a custom button to the classic editor.

Thanks @SBisson, let me spike what i can do here.

Spike in-progress PR: https://github.com/wikimedia/wikipediapreview-wordpress/pull/93

I consider the spike part of this work to be finished. We already have an example of another plugin doing it that we could draw inspiration from.