From a897708d3199289617f3c042ea57a65c7d17e731 Mon Sep 17 00:00:00 2001 From: Ken Gagne Date: Tue, 9 Nov 2021 08:54:48 -0700 Subject: [PATCH] Hide deprecated social media links Checks the WordPress database version and hides the fields for Jabber, AIM, and Google Talk on newer sites. --- php/class-coauthors-guest-authors.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/php/class-coauthors-guest-authors.php b/php/class-coauthors-guest-authors.php index 8441bbb2..37811992 100644 --- a/php/class-coauthors-guest-authors.php +++ b/php/class-coauthors-guest-authors.php @@ -1012,6 +1012,13 @@ function get_guest_author_thumbnail( $guest_author, $size, $class = null ) { */ function get_guest_author_fields( $groups = 'all' ) { + if ( get_site_option( 'initial_db_version' ) < 23588 ) { + $oldcontact = 'contact-info'; + } + else { + $oldcontact = 'hidden'; + } + $groups = (array) $groups; $global_fields = array( // Hidden (included in object, no UI elements) @@ -1065,17 +1072,17 @@ function get_guest_author_fields( $groups = 'all' ) { array( 'key' => 'aim', 'label' => __( 'AIM', 'co-authors-plus' ), - 'group' => 'contact-info', + 'group' => $oldcontact, ), array( 'key' => 'yahooim', 'label' => __( 'Yahoo IM', 'co-authors-plus' ), - 'group' => 'contact-info', + 'group' => $oldcontact, ), array( 'key' => 'jabber', 'label' => __( 'Jabber / Google Talk', 'co-authors-plus' ), - 'group' => 'contact-info', + 'group' => $oldcontact, ), array( 'key' => 'description',