Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add migration scripts for site blurb #1423

Open
rclations opened this issue Apr 17, 2017 · 5 comments
Open

Add migration scripts for site blurb #1423

rclations opened this issue Apr 17, 2017 · 5 comments
Milestone

Comments

@rclations
Copy link

of_get_option( 'site_blurb' ) => get_option( 'site_description' )

@rclations rclations added this to the 1.0 milestone Apr 17, 2017
@benlk
Copy link
Collaborator

benlk commented Apr 19, 2017

Is this just specifically for this one thing, or as part of a larger strategy to write from A to B?

How much of Largo 0.5.5.3's update functions do you want to import? All of the pre-0.5.5.3 stuff can be removed, but the broad strokes might be worth importing and switching over from the of_get_option mode: https://github.com/INN/Largo/blob/v0.5.5.3/inc/update.php

Of the stuff in the 0.5.5.3 file, I think we should keep these:

  • largo_perform_update
  • largo_need_update
  • largo_replace_deprecated_widgets if we're going to deprecate any, necessitating largo_widget_in_region, largo_instantiate_widget, largo_get_widget_basename, largo_get_widget_number
  • set the largo version in a place that we know
  • largo_update_admin_notice but something else for the customizer as well
  • some form of the Largo Update Page to run updates and largo_block_theme_opions_for_update and largo_block_theme_options

Notes on other bigs:

  • largo_preserve_previous_options would need to be totally rewritten to not use the options framework
  • largo_set_new_option_defaults may not need to be run
  • largo_update_custom_less_variables is irrelevant as LESS is being replaced with SASS

@benlk
Copy link
Collaborator

benlk commented Apr 19, 2017

Also, will we want tests in Largo 1.x?

@rclations
Copy link
Author

=> part of a larger strategy to write from A to B

I think we'll unfortunately need to keep everything in the updates file. What if someone tries to update from Largo < .5 to Largo 1.0? We'll need to have it run all the upgrade scripts.

@rclations
Copy link
Author

Re: testing, I think we should try to use https://codex.wordpress.org/Theme_Unit_Test instead of writing unit tests, which is more standard for plugins than themes

@benlk
Copy link
Collaborator

benlk commented Apr 20, 2017

Notes from talk with RC yesterday:

  • Largo is more focused on display than on functions, so the Theme Unit Test makes sense for testing presentation
  • unit tests where Largo is doing function themes, but that's out of the scope of this PR.
  • import Largo 0.5.5.3's inc/updates.php wholesale
  • from -> to in the case of the site description should interface with whatever name for the setting we decide works for Customizer site description #1425

So, as regards the general update script:

  • a way to map from optionsframework setting name to theme_mods setting name, probably with a sanitization/transformation callback to allow us to perform modifications to themes
    • don't automatically import stuff from 0.5.5.3 to 1.0, but selectively.
    • $imports[] = array( 'from' => 'of_name', 'to' => 'tm_name', 'callback' => '__return_true' /*optional*/ );
  • change how largo_need_update and largo_version works for 1.0+ sites to not use the optionsframework option but instead use theme_mods for storing the largo version number
  • keep the of_get_option function in Largo 1.0+ just so that we can read from the optionsframework. It's separate from the rest of the library, which mostly builds admin pages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants