
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
wp-classic-editor
Advanced tools
A React component for integrating WordPress' classic editor using wp.editor API
WpClassicEditor is a React component that seamlessly integrates the WordPress Classic Editor using the wp.editor API. This component provides a fully customizable TinyMCE editor for your React applications, enabling rich text editing capabilities.
To install the wp-classic-editor package, run:
npm install wp-classic-editor
You can use the WpClassicEditor component in your React application as follows:
import { useState } from '@wordpress/element';
import WpClassicEditor from 'wp-classic-editor';
const MyComponent = () => {
const [content, setContent] = useState('Initial content here');
return (
<div>
<h2>My Custom Editor</h2>
<WpClassicEditor
value={content}
onChange={(newContent) => setContent(newContent)}
height={300} // Optional, default is 250
hasMedia={true} // Optional, allows media buttons
useExtendStyles={true} // Optional, use extended CSS styles
/>
</div>
);
};
export default MyComponent;
The WpClassicEditor component accepts the following props:
value (string): The initial content of the editor.onChange (function): Callback function that is called when the content changes. It receives the updated content as an argument.height (number): The height of the TinyMCE editor in pixels. Defaults to 250.useExtendStyles (boolean): If true, applies extended styles to the editor. Defaults to false.hasMedia (boolean): If true, includes media buttons in the editor. Defaults to true.To use the WordPress Classic Editor in your custom theme or plugin, add the following PHP code to your functions.php file or the main plugin file:
<?php
/**
* Enqueue WordPress Classic Editor and Media for custom usage.
*/
// Ensure this code runs in the correct context
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
// Add filter to allow rich text editor
add_filter( 'user_can_richedit', '__return_true' );
// Function to enqueue the editor and media scripts
function enqueue_wp_classic_editor_and_media() {
// Enqueue the WordPress editor scripts
wp_enqueue_editor();
// Enqueue the WordPress media scripts
wp_enqueue_media();
}
// Hook the function to an appropriate action
add_action( 'admin_enqueue_scripts', 'enqueue_wp_classic_editor_and_media' );
This component requires react. Ensure that your project includes this dependency.
Contributions are welcome! Please open an issue or submit a pull request if you'd like to contribute to the project.
FAQs
A React component for integrating WordPress' classic editor using wp.editor API
We found that wp-classic-editor demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.