• Resolved Sunny

    (@frdmsun)


    1. If I add a new class to a block it gets saved to the database and is always present as a class suggestion. I would like the option to add one-off lasses to a block without them being saved.

    Perhaps return the default WP advanced class field so that we can add one-off classes. And we can paste multiple classes into the class field at once. Maybe a filter to not remove the WP advanced class field?

    Thanks again for an awesome plugin!

    • This topic was modified 2 months, 3 weeks ago by Sunny.
    • This topic was modified 2 months, 3 weeks ago by Sunny.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Edi Amin

    (@ediamin)

    Hi @frdmsun, thanks for the suggestions. I’ll try to add the option to skip saving the class to the database. For pasting multiple class names, I need to look into it a bit more. I’m not sure if it is doable or not. Anyway, I’ll share an update soon.

    Thank you very much for using the plugin.

    Thread Starter Sunny

    (@frdmsun)

    The simplest solution would be to have an option that restores the default WP class functionality in the advanced tab. This way classes could be manager both ways.

    Plugin Author Edi Amin

    (@ediamin)

    Hi @frdmsun ! I’ve just released a new version with the Add classes without saving to the database feature. You can enable it by toggling Press Space to add class names without creating them in Preferences inside the CSS Class Manager settings modal. When this option is enabled, you can press Space to add a class without saving it to the database. You can also add multiple class names, just copy/paste them into the input field and press Space.

    Here’s a screencast for more clarification: https://github.com/ediamin/css-class-manager/wiki#how-to-add-css-classes-without-saving-them-to-the-database-or-class-manager-list

    I hope this meets your requirement. Thanks for the feature request! Let me know if you have any questions.

    Thread Starter Sunny

    (@frdmsun)

    Thanks looks good!

    If anyone is interested here is a simple way to add the default Advanced > Classes field back if you need it.

    // Add the Advanced > Classes field back
    add_action('enqueue_block_editor_assets', function () {
    wp_add_inline_script(
    'css-class-manager-script',
    "wp.hooks.removeFilter('editor.BlockEdit', 'css-class-manager/block-editor/hide-core-inspector-control');",
    'after'
    );
    }, 100);
    Plugin Author Edi Amin

    (@ediamin)

    Thank you Sunny. Glad to hear it helped and thanks for sharing the snippet 👍.

    I am going to close this thread. If anyone runs into issues or has follow up questions, feel free to open a new topic.

Viewing 5 replies - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.