Skip to content

Commit

Permalink
Hide deprecated social media links
Browse files Browse the repository at this point in the history
Checks the WordPress database version and hides the fields for Jabber, AIM, and Google Talk on newer sites.
  • Loading branch information
gamebits authored and GaryJones committed Jul 24, 2023
1 parent 6789ce7 commit a897708
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions php/class-coauthors-guest-authors.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit a897708

Please sign in to comment.