• Resolved mad99

    (@mad99)


    Hi everyone,
    I like the plugin “Disable Gutenberg” a lot.
    Unfortunatelly the plugin does alo disable the direct-edit link “Edit With Divi” in the pages overview page.

    See image: https://i.imgur.com/iBNaRKn.jpg

    Because of this, we have always click 2 times instead of one.

    Can’t find a solution. Have searched in support-tickets, also try&error every Plugin Setting. But only the ?Disable for Administrators? is enable the Divi-direct-edit-Link. But this is not really helpful.

    Maybe someone else has the same problem and found a solution.
    Would be great to get some link, help or hint to find the right direction.

    Best regards
    Martin

    • This topic was modified 2 years, 2 months ago by mad99.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Jeff Starr

    (@specialk)

    Hi @mad99, you might try reaching out to the Divi folks if you haven’t already. They might know what’s required in order for the “Edit With Divi” links to work.

    Maybe someone reading here will have some clues. Will leave this thread open for a while, maybe someone will chime in.

    Thread Starter mad99

    (@mad99)

    Hi Jeff,
    Thank you very mutch for your fast reply and your hint to ask the Divi-Support.

    I did and chat currently with Drin from Support. He will forward this issue/bug to the dev. But also in the same moment he wrote:

    Unfortunately, there is no ETA on a solution that I can provide at this time. Though I can assure you that issues are addressed as quickly as possible based on our development team's current workload and the severity of the issue when compared to the severity of other open issues.

    So my hope is rather humble.

    But as I wrote in support-chat I investigate the Divi-Code and 99% sure I found the ?Problem?.

    In Line Line 423 from wp-content/themes/Divi/includes/builder/feature/BlockEditorIntegration.php

    if ( ! $this->_can_edit_post( $post ) || ! et_builder_enabled_for_post_type( $post->post_type ) ) {
    return $actions;
    }

    When I delete the ! (not) from ! $this->_can_edit_post( $post ) ||
    Then the Link is shown also with the active Plugin ?Disable Gutenberg?.

    So I’m quite sure when ?Disable Gutenberg? is activated it seams
    $this->_can_edit_post( $post )
    returns FALSE
    So it seams for Divi, when Disable Gutenberg is activated the Post/Page seams to be not longer editable.

    But it is, because over the twice click:
    First => Click ?Edit Page?
    Second => Click ?Build ON The Front End? the Page is editable.

    So I continued to get to the bottom of the code.

    The portected fuction _can_edit_post()
    In LIne 43 is only check if function_exists ?gutenberg_can_edit_post?

    See code:

    protected function _can_edit_post( $post ) {
    if ( function_exists( 'gutenberg_can_edit_post' ) ) {
    return gutenberg_can_edit_post( $post );
    }

    So this is the real point of problem!
    I guess there are two different solutions.

    FIRST:
    _can_edit_post should have some query for plugins that disable Gutenberg and the function ?gutenberg_can_edit_post?. This I wrote to Drin from Divi-Support. And he will forward the chat to developer. But wrote:

    The developers will be having a look at this chat in this case, as we as support only do help with the issues that the Divi theme has.

    SECOND:
    Maybe you as Plugin-Author from ?Disable Gutenberg? can leave visible the function gutenberg_can_edit_post.
    Or maybe you have another good idea how it is possible to save Divi from this stumble about querying the “gutenberg_can_edit_post” function.

    Would be great to hear from you or other solution-finders.
    Best regards
    Martin

    • This reply was modified 2 years, 2 months ago by mad99.
    Thread Starter mad99

    (@mad99)

    This is the full code of function _can_edit_post on Line 43 from wp-content/themes/Divi/includes/builder/feature/BlockEditorIntegration.php
    (can NOT edit the post above anymore)

    protected function _can_edit_post( $post ) {
    		if ( function_exists( 'gutenberg_can_edit_post' ) ) {
    			return gutenberg_can_edit_post( $post );
    		}
    
    		// In case WordPress is lower than version 5.0.
    		if ( ! function_exists( 'use_block_editor_for_post' ) ) {
    			return false;
    		}
    
    		return use_block_editor_for_post( $post );
    	}
    Plugin Author Jeff Starr

    (@specialk)

    Thanks for the detailed information, @mad99. Not sure if there is much can be done from the DG side of things, but I will take a closer look during the next plugin update for any possible solution.

    • This reply was modified 2 years, 2 months ago by Jeff Starr.
    Plugin Author Jeff Starr

    (@specialk)

    Looking closer at this, there doesn’t seem much that can be done from DG side of things. You did mention this:

    “Maybe you as Plugin-Author from Disable Gutenberg can leave visible the function gutenberg_can_edit_post.”

    That sounds logical, however the function gutenberg_can_edit_post() is a core WP function, not something that is part of the Disable Gutenberg plugin. Unless there is a way to modify via hooks, the solution will need to happen via Divi and related codes. Hopefully the Divi team can get it fixed up.

    Let me know if I can provide any further information, glad to help anytime.

    Thread Starter mad99

    (@mad99)

    Hey Jeff,
    Thanks for your closer look.

    You are right. And so I sent Divi a Code-Change suggestion.
    Because at the end Divi’s function ?_can_edit_post? basically only checks if the WP version is greater than version 5.
    Written in Comment in L:48
    // In case WordPress is lower than version 5.0.

    they nothing do with the return of the function “_can_edit_post( $post )” in the function on line 420.

    So much easier and more GutenbergLess Systems/Plugins compliant would be to check the WP version directly with a code like:

    get_bloginfo( 'version' ) < 5

    So I sent the support a Code-Change-Suggestion-Request:

    L:423 old
    if ( ! $this->_can_edit_post( $post ) || ! et_builder_enabled_for_post_type( $post->post_type ) ) {
    
    Line:423 new
    if ( get_bloginfo( 'version' ) < 5 || ! et_builder_enabled_for_post_type( $post->post_type ) ) {

    Hope this will built-in or considered in an other change of Divi’s Code…
    More I guess we can not do.

    So we (I) will see ??
    Best regards and thanks again
    Martin

    • This reply was modified 2 years, 1 month ago by mad99.
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Page-Menu Option “Edit With Divi” is missng’ is closed to new replies.