Making WordPress.org

Ticket #1975: 1975.diff

File 1975.diff, 1.3 KB (added by netweb, 8 years ago)
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-hooks.php

     
    1515                // oEmbed.
    1616                add_filter( 'oembed_discovery_links', array( $this, 'disable_oembed_discovery_links' ) );
    1717                add_filter( 'oembed_response_data', array( $this, 'disable_oembed_response_data' ), 10, 2 );
     18
     19                // Remove archaic custom user contact methods.
     20                add_filter( 'user_contactmethods', 'remove_archaic_contact_methods' );
    1821        }
    1922
    2023        /**
     
    6063
    6164                return $data;
    6265        }
     66
     67        /**
     68         * Removes archaic AIM, Yahoo IM, and Google Talk contact methods
     69         *
     70         * @link https://codex.wordpress.org/Plugin_API/Filter_Reference/user_contactmethods
     71         *
     72         * @param array $user_contact_method Array of contact methods.
     73         * @return array An array of contact methods.
     74         */
     75        public function remove_archaic_contact_methods( $user_contact_method ) {
     76                /* Remove user contact methods */
     77                unset( $user_contact_method['aim'] );
     78                unset( $user_contact_method['yim'] );
     79                unset( $user_contact_method['jabber'] );
     80
     81                return $user_contact_method;
     82        }
    6383}