This page is generated from HOOKS.md in the Typography Stylist source. Edit it there — edits made here are kept, but they stop this page from being updated until the conflict is resolved.
A minimal extension plugin structure:
my-typost-extension/
├── my-typost-extension.php # Plugin header, dependency check, hook registrations
├── assets/
│ ├── js/
│ │ └── editor.js # Block editor UI
│ └── css/
│ └── admin.css # Admin styles (optional)
└── readme.txt
<?php
/**
* Plugin Name: Typography Stylist - My Extension
* Requires Plugins: typography-stylist
*/
add_action('plugins_loaded', function() {
if (!class_exists('Typost')) {
add_action('admin_notices', function() {
echo '<div class="notice notice-error"><p>This extension requires Typography Stylist.</p></div>';
});
return;
}
// Register your hooks here
add_filter('typost_editor_data', 'my_ext_add_editor_data');
add_action('typost_editor_assets', 'my_ext_enqueue_editor');
add_action('typost_register_rest_routes', 'my_ext_register_routes');
}, 20);