Giter Club home page Giter Club logo

Comments (1)

pyronaur avatar pyronaur commented on June 12, 2024

I submitted a PR, a few notes:

  • I renamed the classes and files too

  • Due to changes to the options key change - if someone is using ramp_for_gutenberg() function currently - they'll have to do two reloads for the settings to catch up.

To avoid two reloads, we could do something like this on VIP Go helper file, but this seems like overkill:

function gutenberg_ramp_migrate() {

	$old_criteria = get_option( 'ramp_for_gutenberg_load_critera' );

	// Fail fast if there is no old criteria
	if ( false === $old_criteria ) {
		return false;
	}

	$new_criteria = get_option( 'gutenberg_ramp_load_critera' );

	// Cancel if there is already new criteria
	if ( ! empty( $new_criteria ) ) {
		return false;
	}

	// --- at this point $new_criteria doesn't exist, and $old_criteria has been defined

	// Update new option
	update_option( 'gutenberg_ramp_load_critera', $old_criteria );

	// Delete the old option
	delete_option( 'ramp_for_gutenberg_load_critera' );
}

// Ready, Set, Migrate:
// This would run before anything else related to Gutenberg Ramp
// For example
gutenberg_ramp_migrate();

^^-- If that snippet is used, we need to make sure it's loaded before anything else related to Gutenberg Ramp. This seems like a good place to do so.

from gutenberg-ramp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.