Make WordPress Core

Ticket #22942: 22942.diff

File 22942.diff, 4.5 KB (added by ericmann, 12 years ago)

First pass at deprecating the post by email settings section.

  • wp-admin/includes/schema.php

     
    369369        'comments_notify' => 1,
    370370        'posts_per_rss' => 10,
    371371        'rss_use_excerpt' => 0,
    372         'mailserver_url' => 'mail.example.com',
    373         'mailserver_login' => 'login@example.com',
    374         'mailserver_pass' => 'password',
    375         'mailserver_port' => 110,
    376372        'default_category' => 1,
    377373        'default_comment_status' => 'open',
    378374        'default_ping_status' => 'open',
     
    476472
    477473        // 3.5
    478474        'link_manager_enabled' => 0,
     475
     476        // 3.6
     477        'post_by_email_enabled' => 0,
    479478        );
    480479
    481480        // 3.3
  • wp-admin/includes/upgrade.php

     
    402402        if ( $wp_current_db_version < 22422 )
    403403                upgrade_350();
    404404
     405        if ( $wp_current_db_version < 22441 )
     406                upgrade_360();
     407
    405408        maybe_disable_link_manager();
    406409
    407410        maybe_disable_automattic_widgets();
    408411
     412        maybe_disable_post_by_email();
     413
    409414        update_option( 'db_version', $wp_db_version );
    410415        update_option( 'db_upgraded', true );
    411416}
     
    12091214}
    12101215
    12111216/**
     1217 * Execute changes made in WordPress 3.6.
     1218 *
     1219 * @since 3.6.0
     1220 */
     1221function upgrade_360() {
     1222        global $wp_current_db_version;
     1223
     1224        if ( $wp_current_db_version < 22441 && 'mail.example.com' != get_option( 'mailserver_url' ) )
     1225                update_option( 'post_by_email_enabled', 1 ); // Previosuly set to 0 by populate_options()
     1226}
     1227
     1228/**
    12121229 * Execute network level changes
    12131230 *
    12141231 * @since 3.0.0
     
    19531970}
    19541971
    19551972/**
     1973 * Disables Post by Email options if, at the time of upgrade, the settings have not been changed from original defaults.
     1974 *
     1975 * @since 3.6.0
     1976 */
     1977function maybe_disable_post_by_email() {
     1978        global $wp_current_db_version;
     1979
     1980        if ( $wp_current_db_version >= 22441 && get_option( 'post_by_email_enabled' ) && 'mail.example.com' == get_option( 'mailserver_url' ) )
     1981                update_option( 'post_by_email_enabled', 0 );
     1982}
     1983
     1984/**
    19561985 * Runs before the schema is upgraded.
    19571986 *
    19581987 * @since 2.9.0
  • wp-admin/options-writing.php

     
    2828        'content' => '<p>' . __('Press This is a bookmarklet that makes it easy to blog about something you come across on the web. You can use it to just grab a link, or to post an excerpt. Press This will even allow you to choose from images included on the page and use them in your post. Just drag the Press This link on this screen to your bookmarks bar in your browser, and you&#8217;ll be on your way to easier content creation. Clicking on it while on another website opens a popup window with all these options.') . '</p>',
    2929) );
    3030
    31 if ( apply_filters( 'enable_post_by_email_configuration', true ) ) {
     31if ( get_option( 'link_manager_enabled' ) && apply_filters( 'enable_post_by_email_configuration', true ) ) {
    3232        get_current_screen()->add_help_tab( array(
    3333                'id'      => 'options-postemail',
    3434                'title'   => __( 'Post Via Email' ),
     
    124124        <p><textarea rows="5" cols="120" readonly="readonly"><?php echo htmlspecialchars( get_shortcut_link() ); ?></textarea></p>
    125125</div>
    126126
    127 <?php if ( apply_filters( 'enable_post_by_email_configuration', true ) ) { ?>
     127<?php if ( get_option( 'link_manager_enabled' ) && apply_filters( 'enable_post_by_email_configuration', true ) ) { ?>
    128128<h3><?php _e('Post via e-mail') ?></h3>
    129129<p><?php printf(__('To post to WordPress by e-mail you must set up a secret e-mail account with POP3 access. Any mail received at this address will be posted, so it&#8217;s a good idea to keep this address very secret. Here are three random strings you could use: <kbd>%s</kbd>, <kbd>%s</kbd>, <kbd>%s</kbd>.'), wp_generate_password(8, false), wp_generate_password(8, false), wp_generate_password(8, false)) ?></p>
    130130
  • wp-includes/default-filters.php

     
    288288// This option no longer exists; tell plugins we always support auto-embedding.
    289289add_filter( 'default_option_embed_autourls', '__return_true' );
    290290
     291// If the upgrade hasn't run yet, assume the post by mail options are set.
     292add_filter( 'default_option_post_by_email_enabled', '__return_true' );
     293
    291294unset($filter, $action);