Sorry, I’m really not familiar with elementor or what would be needed to make them work together, but if it’s a relatively small/non-impactful change & you’d like to submit a patch, I could definitely commit it to the main plugin so you don’t have to worry about it getting overwritten by future updates 🙂
It’s probably not too big, but beyond my skill level.
Basically, when you first click on “edit with elementor” for a page it takes everything from DB::wp_posts::post_content
And copies it to: DB::wp_postmeta::_elementor_data (WHERE post_id == wp_posts.ID) along with some other fancy stuff that elementor is adding.
After that any changes in post_content will be ignored, even though your plugin will successfully update that bit.
I have not found a way for Elementor to recheck post_content and tried to adapt your script to make the change in _elementor_data but that went beyond my skill level. So I ended up with adding:
echo '<textarea style="width:350px;overflow:hidden;resize:none;line-height:1;font-family:inherit;font-size:inherit;" readonly="readonly" onclick="this.focus();this.select();">';
echo '$album = fpf_fetch_album_content( \'' . $album->id . '\', array() ); echo $album[\'content\'];';
echo '</textarea>';
to _admin_menu.php –> search for albums so it’s an easy copy and paste to a php snippet plugin.
Like I said, it works, but isn’t very elegant 🙂
Ah gotcha. Based on what you describe, it sounds like this is a question much more suited for the Elementor folks – they should provide some hook/filter that they invoke before updating, which you could then use to force their plugin to re-check post_content & pull it into elementor_data. Alternatively, if they don’t provide such a hook/filter (which I think is unlikely, but just to cover all bases) you might be able to use one of the standard core hooks that occurs before saving content to i.e. clear elemetor’s post_meta for that post, which seems like their plugin would then see as ‘blank’ and then fetch the original post_content again. Again though, this is really a question for them as it pertains to how their plugin is functioning, rather than mine 🙂
Hi, im looking to integrate this into elementor myself. Any help or ways in which you have done this would be great. 🙂