function genesis_user_meta_default_on( $value, $user_id ) { // If a real value exists, simply return it. if ( $value ) { return $value; } // Get the name of the field by removing the prefix from the active filter. $field = str_replace( 'get_the_author_', '', current_filter() ); // Setup user data. if ( ! $user_id ) { global $authordata; } else { // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited -- same pattern used in` get_the_author_meta() $authordata = get_userdata( $user_id ); } // Just in case. $user_field = "user_$field"; if ( isset( $authordata->$user_field ) ) { return $authordata->user_field; } // If an empty or false value exists, return it. if ( isset( $authordata->$field ) ) { return $value; } // If all that fails, default to true. return 1; }