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

Already on GitHub? Sign in to your account

Use version option to check on init if rewrite rules should be flushed. #149

Merged
merged 3 commits into from Apr 28, 2014

Conversation

Projects
None yet
2 participants
Owner

rachelbaker commented Apr 24, 2014

This should fix #113.

@rmccue rmccue commented on an outdated diff Apr 25, 2014

@@ -135,7 +160,7 @@ function json_api_activation( $network_wide ) {
switch_to_blog( $mu_blog['blog_id'] );
json_api_register_rewrites();
- flush_rewrite_rules();
+ update_option( 'json_api_plugin_version', NULL );
@rmccue

rmccue Apr 25, 2014

Owner

Can probably use delete_option() here.

@rmccue rmccue commented on an outdated diff Apr 25, 2014

@@ -38,6 +49,20 @@ function json_api_register_rewrites() {
}
/**
+ * Determine if the rewrite rules should be flushed.
+ */
+function json_api_maybe_flush_rewrites() {
+ $version = get_option( 'json_api_plugin_version', NULL );
@rmccue

rmccue Apr 25, 2014

Owner

null should be lowercase.

@rmccue rmccue added this to the 1.0 milestone Apr 28, 2014

rmccue added a commit that referenced this pull request Apr 28, 2014

Merge pull request #149 from WP-API/mu-flush
Use version option to check on init if rewrite rules should be flushed.

@rmccue rmccue merged commit 81b1599 into master Apr 28, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details

@rmccue rmccue deleted the mu-flush branch Apr 28, 2014

kellbot pushed a commit to kellbot/WP-API that referenced this pull request Aug 1, 2014

Merge pull request #149 from WP-API/mu-flush
Use version option to check on init if rewrite rules should be flushed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment