WordPress.org

Make WordPress Core

Changeset 21804


Ignore:
Timestamp:
09/11/2012 12:37:31 AM (7 years ago)
Author:
nacin
Message:

Turn XML-RPC on and remove the option on the Writing Settings page.
props markoheijnen for the initial patch.

Introduces a new filter, xmlrpc_enabled.

Respects any current callbacks registered to the pre_option_enable_xmlrpc
and option_enable_xmlrpc filters, for anyone forcing it off via code.

fixes #21509.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/schema.php

    r21803 r21804  
    446446    'avatar_default' => 'mystery',
    447447    'enable_app' => 0,
    448     'enable_xmlrpc' => 0,
    449448
    450449    // 2.7
     
    544543        'can_compress_scripts', 'page_uris', 'update_core', 'update_plugins', 'update_themes', 'doing_cron',
    545544        'random_seed', 'rss_excerpt_length', 'secret', 'use_linksupdate', 'default_comment_status_page',
    546         'wporg_popular_tags', 'what_to_show', 'rss_language', 'language',
     545        'wporg_popular_tags', 'what_to_show', 'rss_language', 'language', 'enable_xmlrpc',
    547546    );
    548547    foreach ( $unusedoptions as $option )
  • trunk/wp-admin/includes/upgrade.php

    r21536 r21804  
    998998    if ( $wp_current_db_version < 8201 ) {
    999999        update_option('enable_app', 1);
    1000         update_option('enable_xmlrpc', 1);
    10011000    }
    10021001}
  • trunk/wp-admin/options-writing.php

    r21501 r21804  
    180180</fieldset></td>
    181181</tr>
    182 <tr valign="top">
    183 <th scope="row"><?php _e('XML-RPC') ?></th>
    184 <td><fieldset><legend class="screen-reader-text"><span><?php _e('XML-RPC') ?></span></legend>
    185 <label for="enable_xmlrpc">
    186 <input name="enable_xmlrpc" type="checkbox" id="enable_xmlrpc" value="1" <?php checked('1', get_option('enable_xmlrpc')); ?> />
    187 <?php _e('Enable the WordPress, Movable Type, MetaWeblog and Blogger XML-RPC publishing protocols.') ?></label><br />
    188 </fieldset></td>
    189 </tr>
    190182<?php do_settings_fields('writing', 'remote_publishing'); ?>
    191183</table>
  • trunk/wp-admin/options.php

    r21551 r21804  
    6565    'privacy' => array( 'blog_public' ),
    6666    'reading' => array( 'posts_per_page', 'posts_per_rss', 'rss_use_excerpt', 'blog_charset', 'show_on_front', 'page_on_front', 'page_for_posts' ),
    67     'writing' => array( 'default_post_edit_rows', 'use_smilies', 'default_category', 'default_email_category', 'use_balanceTags', 'default_link_category', 'default_post_format', 'enable_app', 'enable_xmlrpc' ),
     67    'writing' => array( 'default_post_edit_rows', 'use_smilies', 'default_category', 'default_email_category', 'use_balanceTags', 'default_link_category', 'default_post_format', 'enable_app' ),
    6868    'options' => array( '' ) );
    6969
  • trunk/wp-includes/class-wp-xmlrpc-server.php

    r21765 r21804  
    170170     */
    171171    function login_pass_ok($user_login, $user_pass) {
    172         if ( !get_option( 'enable_xmlrpc' ) ) {
    173             $this->error = new IXR_Error( 405, sprintf( __( 'XML-RPC services are disabled on this site. An admin user can enable them at %s'),  admin_url('options-writing.php') ) );
     172
     173        // Respect any old filters against get_option() for 'enable_xmlrpc'.
     174        $enabled = apply_filters( 'pre_option_enable_xmlrpc', false ); // Deprecated
     175        if ( false === $enabled )
     176            $enabled = apply_filters( 'option_enable_xmlrpc', true ); // Deprecated
     177
     178        // Proper filter for turning off XML-RPC. It is on by default.
     179        $enabled = apply_filters( 'xmlrpc_enabled', $enabled );
     180
     181        if ( ! $enabled ) {
     182            $this->error = new IXR_Error( 405, sprintf( __( 'XML-RPC services are disabled on this site.' ) ) );
    174183            return false;
    175184        }
     
    192201     */
    193202    function login($username, $password) {
    194         if ( !get_option( 'enable_xmlrpc' ) ) {
    195             $this->error = new IXR_Error( 405, sprintf( __( 'XML-RPC services are disabled on this site. An admin user can enable them at %s'),  admin_url('options-writing.php') ) );
     203        // Respect any old filters against get_option() for 'enable_xmlrpc'.
     204        $enabled = apply_filters( 'pre_option_enable_xmlrpc', false ); // Deprecated
     205        if ( false === $enabled )
     206            $enabled = apply_filters( 'option_enable_xmlrpc', true ); // Deprecated
     207
     208        // Proper filter for turning off XML-RPC. It is on by default.
     209        $enabled = apply_filters( 'xmlrpc_enabled', $enabled );
     210
     211        if ( ! $enabled ) {
     212            $this->error = new IXR_Error( 405, sprintf( __( 'XML-RPC services are disabled on this site.' ) ) );
    196213            return false;
    197214        }
  • trunk/wp-includes/version.php

    r21751 r21804  
    1212 * @global int $wp_db_version
    1313 */
    14 $wp_db_version = 21707;
     14$wp_db_version = 21804;
    1515
    1616/**
Note: See TracChangeset for help on using the changeset viewer.