mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-11 18:56:10 +09:00
Merge pull request #1607 from ultimatemember/fix/remove_mobile_detect
Deprecates mobile detect library
This commit is contained in:
+8
-17
@@ -520,12 +520,10 @@ if ( ! class_exists( 'UM' ) ) {
|
||||
$this->form()->hooks();
|
||||
$this->permalinks();
|
||||
$this->cron();
|
||||
$this->mobile();
|
||||
$this->external_integrations();
|
||||
$this->gdpr();
|
||||
$this->member_directory();
|
||||
$this->blocks();
|
||||
$this->secure();
|
||||
|
||||
// If multisite networks active
|
||||
if ( is_multisite() ) {
|
||||
@@ -1334,21 +1332,6 @@ if ( ! class_exists( 'UM' ) ) {
|
||||
return $this->classes['templates'];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @since 2.0
|
||||
*
|
||||
* @return um\lib\mobiledetect\Um_Mobile_Detect
|
||||
*/
|
||||
function mobile() {
|
||||
if ( empty( $this->classes['mobile'] ) ) {
|
||||
$this->classes['mobile'] = new um\lib\mobiledetect\Um_Mobile_Detect();
|
||||
}
|
||||
|
||||
return $this->classes['mobile'];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @since 2.0.44
|
||||
*
|
||||
@@ -1474,6 +1457,14 @@ if ( ! class_exists( 'UM' ) ) {
|
||||
_deprecated_function( __METHOD__, '2.1.0', 'UM()->member_directory()' );
|
||||
return UM()->member_directory();
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 2.0
|
||||
* @deprecated 2.9.3
|
||||
*/
|
||||
public function mobile() {
|
||||
_deprecated_function( __METHOD__, '2.9.3', 'wp_is_mobile' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -751,13 +751,13 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
$output .= '</label>';
|
||||
|
||||
if ( ! empty( $data['help'] ) && false === $this->viewing && false === strpos( $key, 'confirm_user_pass' ) ) {
|
||||
if ( ! UM()->mobile()->isMobile() ) {
|
||||
if ( ! wp_is_mobile() ) {
|
||||
if ( false === $this->disable_tooltips ) {
|
||||
$output .= '<span class="um-tip um-tip-' . ( is_rtl() ? 'e' : 'w' ) . '" title="' . esc_attr__( $data['help'], 'ultimate-member' ) . '"><i class="um-icon-help-circled"></i></span>';
|
||||
}
|
||||
}
|
||||
|
||||
if ( false !== $this->disable_tooltips || UM()->mobile()->isMobile() ) {
|
||||
if ( false !== $this->disable_tooltips || wp_is_mobile() ) {
|
||||
$output .= '<span class="um-tip-text">' . __( $data['help'], 'ultimate-member' ) . '</span>';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1027,7 +1027,7 @@ if ( ! class_exists( 'um\core\Member_Directory_Meta' ) ) {
|
||||
$this->sql_order = apply_filters( 'um_modify_sortby_parameter_meta', $this->sql_order, $sortby );
|
||||
|
||||
$profiles_per_page = $directory_data['profiles_per_page'];
|
||||
if ( UM()->mobile()->isMobile() && isset( $directory_data['profiles_per_page_mobile'] ) ) {
|
||||
if ( wp_is_mobile() && isset( $directory_data['profiles_per_page_mobile'] ) ) {
|
||||
$profiles_per_page = $directory_data['profiles_per_page_mobile'];
|
||||
}
|
||||
|
||||
@@ -1105,7 +1105,7 @@ if ( ! class_exists( 'um\core\Member_Directory_Meta' ) ) {
|
||||
|
||||
$sizes = UM()->options()->get( 'cover_thumb_sizes' );
|
||||
|
||||
$this->cover_size = UM()->mobile()->isTablet() ? $sizes[1] : end( $sizes );
|
||||
$this->cover_size = wp_is_mobile() ? $sizes[1] : end( $sizes );
|
||||
|
||||
$avatar_size = UM()->options()->get( 'profile_photosize' );
|
||||
$this->avatar_size = str_replace( 'px', '', $avatar_size );
|
||||
|
||||
@@ -1374,7 +1374,7 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) {
|
||||
function pagination_options( $directory_data ) {
|
||||
// number of profiles for mobile
|
||||
$profiles_per_page = $directory_data['profiles_per_page'];
|
||||
if ( UM()->mobile()->isMobile() && isset( $directory_data['profiles_per_page_mobile'] ) ) {
|
||||
if ( wp_is_mobile() && isset( $directory_data['profiles_per_page_mobile'] ) ) {
|
||||
$profiles_per_page = $directory_data['profiles_per_page_mobile'];
|
||||
}
|
||||
|
||||
@@ -2553,7 +2553,7 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) {
|
||||
|
||||
// number of profiles for mobile
|
||||
$profiles_per_page = $directory_data['profiles_per_page'];
|
||||
if ( UM()->mobile()->isMobile() && isset( $directory_data['profiles_per_page_mobile'] ) ) {
|
||||
if ( wp_is_mobile() && isset( $directory_data['profiles_per_page_mobile'] ) ) {
|
||||
$profiles_per_page = $directory_data['profiles_per_page_mobile'];
|
||||
}
|
||||
|
||||
@@ -2998,7 +2998,7 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) {
|
||||
|
||||
$sizes = UM()->options()->get( 'cover_thumb_sizes' );
|
||||
|
||||
$this->cover_size = UM()->mobile()->isTablet() ? $sizes[1] : end( $sizes );
|
||||
$this->cover_size = wp_is_mobile() ? $sizes[1] : end( $sizes );
|
||||
|
||||
$this->cover_size = apply_filters( 'um_member_directory_cover_image_size', $this->cover_size, $directory_data );
|
||||
|
||||
|
||||
@@ -917,12 +917,9 @@ function um_profile_header_cover_area( $args ) {
|
||||
$size = $get_cover_size;
|
||||
}
|
||||
|
||||
if ( UM()->mobile()->isMobile() ) {
|
||||
|
||||
// set for mobile width = 300 by default but can be changed via filter
|
||||
if ( ! UM()->mobile()->isTablet() ) {
|
||||
$size = 300;
|
||||
}
|
||||
if ( wp_is_mobile() ) {
|
||||
// Set for mobile width = 300 by default but can be changed via filter
|
||||
$size = 300;
|
||||
|
||||
/**
|
||||
* UM hook
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user