[wp-trac] [WordPress Trac] #34415: Force disable WP-API 2.0-beta4 and below

WordPress Trac noreply at wordpress.org
Fri Oct 23 21:28:19 UTC 2015


#34415: Force disable WP-API 2.0-beta4 and below
-----------------------------+------------------
 Reporter:  danielbachhuber  |       Owner:
     Type:  enhancement      |      Status:  new
 Priority:  normal           |   Milestone:  4.4
Component:  REST API         |     Version:
 Severity:  normal           |  Resolution:
 Keywords:  needs-patch      |     Focuses:
-----------------------------+------------------

Comment (by swissspidy):

 Theoretically, deactivating the plugin would be as simple as this (inside
 `upgrade_440()`):

 {{{#!php
 <?php
 if ( defined( 'REST_API_VERSION' ) && version_compare( REST_API_VERSION,
 '2.0-beta4', '<=' ) ) {
         deactivate_plugins( array( 'rest-api/plugin.php' ), true );
 }
 }}}

 However, I just installed a previous beta on a local 4.3 site, updated it
 to trunk and immediately got a fatal error.

 Deactivation needs to happen earlier, e.g. in
 `wp_get_active_and_valid_plugins()`, as can be seen in the attached proof-
 of-concept. I don't really like that method though.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34415#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list