• Resolved neosan

    (@nreljed)


    I thought I was finally at peace and it is possible to have full control with “Editor Feature Restriction”

    but I find out that disabling my box taxonomies in the “Document Panel” section
    does it only on Gutenberg!

    misery and despair we will still have to install another plugin for that ..
    I need to disable Gutenberg and I need to hide all my taxonomies for all roles, because they are included in acf I have to make the interface as friendly and simple as possible

    can you take this scenario and this detail into account for the next update and enable compatibility with no Gutenberg ?

    add_filter('use_block_editor_for_post_type', 'prefix_disable_gutenberg', 10, 2);
    function prefix_disable_gutenberg($current_status, $post_type)
    {
        // Use your post type name
        if ($post_type === 'property') return false;
    	if ($post_type === 'post') return false;
    	if ($post_type === 'logo') return false;
    	if ($post_type === 'acf-test') return false;
        return $current_status;
    }
    • This topic was modified 2 years, 7 months ago by neosan.
    • This topic was modified 2 years, 7 months ago by neosan.
Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Steve Burge

    (@stevejburge)

    Hi @nreljed

    This plugin should successfully hide elements for posts using the Classic Editor also. Is that what you’re using for this post type?

    Thread Starter neosan

    (@nreljed)

    hello,
    at the end of my first post I included the snippet that I use to deactivate Gutenberg which puts the classic editor back by default,

    you just have to put the name for the desired CPT and voila
    I don’t use any plugin to put classic editor back

    you can just test it with posts and find that PublishPress Capabilities no longer has any effect in “Editor Feature Restriction”

    add_filter('use_block_editor_for_post_type', 'prefix_disable_gutenberg', 10, 2);
    function prefix_disable_gutenberg($current_status, $post_type)
    {
        // Use your post type name
    	if ($post_type === 'post') return false;
        return $current_status;
    }
    Plugin Support Riza Maulana Ardiyanto

    (@rizaardiyanto)

    Right now it only works when “Classic Editor” plugin installed, so it has this tab option: https://i.imgur.com/o7SDlz0.png

    However, our team has decided to change this behavior in the future. But we don’t have any ETA yet.

    Plugin Author Olawale Adesina

    (@olatechpro)

    Hi @nreljed

    While waiting for the release, i made a quick check on our code and notice there’s a way you can enable classic editor tab before we release an update to fix this issue by simply defining PP_CAPABILITIES_CONFIGURE_CLASSIC_EDITOR as true in your wp-config.php

    Example: Adding the below code in your config file will enable the classic editor tab even without classic editor plugin been active.

    define('PP_CAPABILITIES_CONFIGURE_CLASSIC_EDITOR', true);

    Thread Starter neosan

    (@nreljed)

    thanks @olatechpro
    for your time and your response

    it’s true that my snippet exposes an interesting scenario or sometimes we need the classic editor for some CPTs and not all

    for example I use jetformbuilder where it only works with gutenberg, installing classic editor plugin leads me to another more unpleasant scenario where gutenberg is disabled everywhere which is not desired.

    PublishPress Capabilities should be able to detect this scenario

    and maybe why not integrate this possibility directly into its settings choose whether or not to disable Gutenberg for CPTs

    Plugin Support Riza Maulana Ardiyanto

    (@rizaardiyanto)

    By the way, if you use Classic Editor plugin, you can choose the default editor whether its classic or Gutenberg. You can choose Gutenberg as default editor and allow the user to change editor: https://i.imgur.com/jWnGPLP.png so that way you can use Classic Editor by switching it here: https://imgur.com/QflHUWd

    This can be as a workaround since you can use Editor Feature (Classic) from PublishPress Capabilities while still be able to use JetFormBuilder or any plugin that depends on block editor.

    Thread Starter neosan

    (@nreljed)

    Thank you for your work and this update.
    I just installed version 2.5 and launched my series of tests on my current installation and a fresh one to confirm.

    everything seems to be working fine except for an annoying detail that shouldn’t exist

    the taxonomy boxes are well hidden but in “Screen Options” they are still there and they are still checked which is confusing

    I could hide “Screen Options” but I need to leave it for the client on some functions.

    it’s a detail that I didn’t have with role editor pro it must be missing an instruction to hide them completely in “Screen Options”.

    I also accidentally discovered this Disable Gutenberg 2.7 plugin
    it does exactly the same thing by disabling Gutenberg but with another dimension and finer controls

    but publishpress capabilities does not detect it the actions are without any effect.

    at the moment I don’t need this, but I imagine someone will come forward and point this out

    700,000+ installs just for that? it is not negligible

    so maybe improve the code to detect this one too and of course make sure that nothing is displayed in “Screen Options”

    in another alternative vision if I was a developer on publishpress capabilities I will think about integrating this notion of disabling Gutenberg with fine controls since it seems that the demand is enormous
    + the advantages already offered by your plugins to customize wordpress

    thank you for everything

    Thread Starter neosan

    (@nreljed)

    post updated to report a small bug related to version 2.5

    Plugin Support Riza Maulana Ardiyanto

    (@rizaardiyanto)

    @nreljed Now, we have the option to show the classic tab even though you don’t install Classic editor plugin: https://i.imgur.com/2Ckzybu.png

    While for the taxonomies in screen options, you can hide them by finding the selector and add custom code for it.

    For example, I want to hide this screen element: https://i.imgur.com/LvVPxAU.png

    To hide it, I can apply this code to function.php

    add_action('admin_head', 'hide_custom_elements');
    
    function hide_custom_elements() {
      echo '<style>
        #screen-options-wrap label[for="pp_read_post_exceptions-hide"] {
        display: none;
    }
      </style>';
    }
    

    You can hide any screen element by change the pp_read_post_exceptions-hide

    Let me know if you have any other questions.

    Thread Starter neosan

    (@nreljed)

    thank you @rizaardiyanto
    for the answers and the help provided ??but this is not the right solution
    there is a real display bug ??
    to show you clearly I reinstalled role editor pro,
    basically I gave up role editor for publishpress capabilities,
    it’s unfortunate to have to reinstall it for that but it’s for science and to show you the bug ?????

    ok so I’m redoing the manipulation to hide my taxonomies for the “editor” role
    look at the pictures to see what bug I’m talking about

    manipulation with role editor pro

    manipulation with Publishpress capabilities 2.5

    you can clearly see the bug ?? they are still there in the options.

    it’s unfortunate to have to do more manipulation to hide them isn’t it?
    hopefully it will be fixed soon ??

    Plugin Support Riza Maulana Ardiyanto

    (@rizaardiyanto)

    Thanks for more detailed explanation @nreljed

    Now it does looks like a bug. We have created a task on our Github repository to fix this issue in the future. Thanks for your report.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘PublishPress Capabilities ignore classic editor’ is closed to new replies.