Support

Account

Forum Replies Created

  • Hey, what a great idea. I find that really useful while trying to use YT embeds in the gallery.

    Could you provide us with the code you used to solve the “no media sidebar” problem? I’ve been googling around though did not find anything useful.

    Thanks a lot in advance!
    Jan

  • Alright, I do have a hacky solution for that. Not bulletproof, though working.

    $_POST and $_GET of those AJAX calls unfortunately do not contain any ID-related info (no ‘et_post_id’). But I’ve noticed that Divi Pagebuilder saves a cookie named “et-editing-post-XXXX-fb”. XXXX being the post ID! 🙂

    The downside is, multiple Divi Pagebuilder cookies with different post IDs can exist at the same time. Probably while editing multiple posts at once (didn’t fully understand the logic of deleting those).

    I therefore check at least for existence of my custom field as a countermeasure and in case I can’t get the post ID, I’ll echo out a placeholder message. Of course, it can happen that I mistakenly get post ID of a different post of the same post type (having the custom field I check for), but that’s a problem I can live with for now.

    So far, it seems to work pretty reliably in my case.

    Here’s the snippet from my shortcode…

    // While in pagebuilder, try to get the ID from a cookie of name "et-editing-post-POSTID-fb"
      if (is_et_pb_preview()) {
        foreach(array_keys($_COOKIE) as $cookie) {
          if (strpos($cookie, 'et-editing-post-') === 0) {
            $cookieID = (int)explode('-', $cookie)[3];
            if (get_field('my_custom_field_name', $cookieID)) {
              $postID = $cookieID;
              break;
            }
          }
        }
      } else {
        $postID = get_the_ID();
      }

    Any proposed improvements will of course be appreciated 🙂

  • Have you tried contacting the Divi support? It’s more of a Divi issue anyway…

    I’ll do that as soon as my client will provide me with the login info 🙂 So we’ll see.

  • Hi guys, any tips on how to handle this one? I’m facing the very same issue.

    I’ve created a shortcode to transform and concatenate content from some (AC)fields and I’m using it in a Divi block.

    It works just fine on the frontend, in the Divi Builder though I’m getting totally different post IDs – both using global $post and get_the_ID() …not a great UX for the content editors.

    Any help would be appreciated 🙂

    Take care, Jan

Viewing 4 posts - 1 through 4 (of 4 total)