Enclavely / tailor

Build beautiful page layouts quickly and easily using your favourite WordPress theme.
https://www.tailorwp.com
GNU General Public License v3.0
1.05k stars 102 forks source link

Post title reverts to `_post_title` #164

Open JustinSainton opened 6 years ago

JustinSainton commented 6 years ago

Steps to Reproduce

  1. Go to any existing page's edit screen.
  2. Change the title and update the page.
  3. Tailor the page - make any change and save it.
  4. Go back to edit screen, see title is reverted to previous title.

This is due to this function: https://github.com/Enclavely/tailor/blob/fd69c688257500d6b633795c41e0a34097fa7c1d/includes/class-panels.php#L384-L394

I'm unclear at the moment on what the best way to address this. Current working theory is that it probably makes sense to hook into post title changes and update the _post_title meta key so they stay synced in both directions.

conwaydev commented 6 years ago

To override this we just remove_all_actions( 'tailor_save_settings' );, but yeah this is a pain.

JustinSainton commented 6 years ago

Definitely! Considered that approach as well, but it seemed prone to unintended consequences.

Our likely approach here will be something like this in a functionality plugin:

remove_action( 'tailor_save_settings', array( tailor_panels(), 'update_post_title' ) );

This approach likely works for us as we don't anticipate making use of the title field in Tailor that this affects.

conwaydev commented 6 years ago

oh for sure, that too!