Making WordPress.org

Changeset 1681


Ignore:
Timestamp:
06/19/2015 06:21:59 PM (10 years ago)
Author:
iandunn
Message:

Jetpack Tweaks: Always automatically connect new sites to WordPress.com.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/jetpack-tweaks.php

    r1665 r1681  
    11<?php
     2
     3namespace WordCamp\Jetpack_Tweaks;
    24
    35/*
     
    5658 */
    5759add_filter( 'jetpack_photon_reject_https', '__return_false' );
     60
     61/**
     62 * Always automatically connect new sites to WordPress.com
     63 *
     64 * The UI for the auto-connect option is currently commented out in Jetpack. You can enable the setting manually,
     65 * but it will get overridden if you save the settings from the UI, because the form field is missing.
     66 *
     67 * @todo Remove this when the UI for the setting is launched.
     68 *
     69 * @param array $new_value
     70 * @param array $old_value
     71 *
     72 * @return array
     73 */
     74function auto_connect_new_sites( $new_value, $old_value ) {
     75    $new_value['auto-connect'] = 1;
     76
     77    return $new_value;
     78}
     79add_filter( 'pre_update_site_option_jetpack-network-settings', __NAMESPACE__ . '\auto_connect_new_sites', 10, 2 );
Note: See TracChangeset for help on using the changeset viewer.