mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- reviewed #1298;
- temporarily removed Stripe from extensions; - wpcs for extensions.php;
This commit is contained in:
@@ -1,84 +1,87 @@
|
||||
<?php if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
<?php
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$premium['bbpress'] = array(
|
||||
'url' => 'https://ultimatemember.com/extensions/bbpress/',
|
||||
'url' => 'https://ultimatemember.com/extensions/bbpress/',
|
||||
'img' => 'bbpress.svg',
|
||||
'name' => 'bbPress',
|
||||
'desc' => 'With the bbPress extension you can integrate Ultimate Member with bbPress',
|
||||
);
|
||||
|
||||
$premium['profile-completeness'] = array(
|
||||
'url' => 'https://ultimatemember.com/extensions/profile-completeness/',
|
||||
'url' => 'https://ultimatemember.com/extensions/profile-completeness/',
|
||||
'img' => 'profile-completeness.svg',
|
||||
'name' => 'Profile Completeness',
|
||||
'desc' => 'Encourage or force users to complete their profile on your site',
|
||||
);
|
||||
|
||||
$premium['verified-users'] = array(
|
||||
'url' => 'https://ultimatemember.com/extensions/verified-users/',
|
||||
'url' => 'https://ultimatemember.com/extensions/verified-users/',
|
||||
'img' => 'verified-users.svg',
|
||||
'name' => 'Verified Users',
|
||||
'desc' => 'Add a user verficiation system to your site so user accounts can be verified',
|
||||
);
|
||||
|
||||
$premium['friends'] = array(
|
||||
'url' => 'https://ultimatemember.com/extensions/friends/',
|
||||
'url' => 'https://ultimatemember.com/extensions/friends/',
|
||||
'img' => 'friends.svg',
|
||||
'name' => 'Friends',
|
||||
'desc' => 'Increase user interaction on your site by allowing users to become friends',
|
||||
);
|
||||
|
||||
$premium['woocommerce'] = array(
|
||||
'url' => 'https://ultimatemember.com/extensions/woocommerce/',
|
||||
'url' => 'https://ultimatemember.com/extensions/woocommerce/',
|
||||
'img' => 'woocommerce.png',
|
||||
'name' => 'WooCommerce',
|
||||
'desc' => 'Integrates the popular e-commerce plugin WooCommerce with Ultimate Member',
|
||||
);
|
||||
|
||||
$premium['notices'] = array(
|
||||
'url' => 'https://ultimatemember.com/extensions/notices/',
|
||||
'url' => 'https://ultimatemember.com/extensions/notices/',
|
||||
'img' => 'notices.svg',
|
||||
'name' => 'Notices',
|
||||
'desc' => 'Alert users to important information using conditional notices',
|
||||
);
|
||||
|
||||
$premium['followers'] = array(
|
||||
'url' => 'https://ultimatemember.com/extensions/followers/',
|
||||
'url' => 'https://ultimatemember.com/extensions/followers/',
|
||||
'img' => 'followers.svg',
|
||||
'name' => 'Followers',
|
||||
'desc' => 'Increase user interaction on your site by allowing users to follow each other',
|
||||
);
|
||||
|
||||
$premium['mycred'] = array(
|
||||
'url' => 'https://ultimatemember.com/extensions/mycred/',
|
||||
'url' => 'https://ultimatemember.com/extensions/mycred/',
|
||||
'img' => 'mycred.png',
|
||||
'name' => 'myCRED',
|
||||
'desc' => 'With the myCRED extension you can integrate Ultimate Member with myCRED',
|
||||
);
|
||||
|
||||
$premium['private-messages'] = array(
|
||||
'url' => 'https://ultimatemember.com/extensions/private-messages/',
|
||||
'url' => 'https://ultimatemember.com/extensions/private-messages/',
|
||||
'img' => 'private-messages.svg',
|
||||
'name' => 'Private Messages',
|
||||
'desc' => 'Add a private messaging system to your site & allow users to message each other',
|
||||
);
|
||||
|
||||
$premium['social-activity'] = array(
|
||||
'url' => 'https://ultimatemember.com/extensions/social-activity/',
|
||||
'url' => 'https://ultimatemember.com/extensions/social-activity/',
|
||||
'img' => 'social-activity.svg',
|
||||
'name' => 'Social Activity',
|
||||
'desc' => 'Let users create public wall posts & see the activity of other users',
|
||||
);
|
||||
|
||||
$premium['social-login'] = array(
|
||||
'url' => 'https://ultimatemember.com/extensions/social-login/',
|
||||
'url' => 'https://ultimatemember.com/extensions/social-login/',
|
||||
'img' => 'social-login.svg',
|
||||
'name' => 'Social Login',
|
||||
'desc' => 'Let users register & login to your site via Facebook, Twitter, G+, LinkedIn, and more',
|
||||
);
|
||||
|
||||
$premium['user-tags'] = array(
|
||||
'url' => 'https://ultimatemember.com/extensions/user-tags/',
|
||||
'url' => 'https://ultimatemember.com/extensions/user-tags/',
|
||||
'img' => 'user-tags.svg',
|
||||
'name' => 'User Tags',
|
||||
'desc' => 'With this extension you can add a user tag system to your website',
|
||||
@@ -86,7 +89,7 @@ $premium['user-tags'] = array(
|
||||
|
||||
|
||||
$premium['mailchimp'] = array(
|
||||
'url' => 'https://ultimatemember.com/extensions/mailchimp/',
|
||||
'url' => 'https://ultimatemember.com/extensions/mailchimp/',
|
||||
'img' => 'mailchimp.png',
|
||||
'name' => 'MailChimp',
|
||||
'desc' => 'Allow users to subscribe to your mailchimp lists when they signup on your site',
|
||||
@@ -94,105 +97,105 @@ $premium['mailchimp'] = array(
|
||||
|
||||
|
||||
$premium['user-reviews'] = array(
|
||||
'url' => 'https://ultimatemember.com/extensions/user-reviews/',
|
||||
'url' => 'https://ultimatemember.com/extensions/user-reviews/',
|
||||
'img' => 'user-reviews.svg',
|
||||
'name' => 'User Reviews',
|
||||
'desc' => 'Allow users to rate & review each other using a 5 star rate/review system',
|
||||
);
|
||||
|
||||
$premium['real-time-notifications'] = array(
|
||||
'url' => 'https://ultimatemember.com/extensions/real-time-notifications/',
|
||||
'url' => 'https://ultimatemember.com/extensions/real-time-notifications/',
|
||||
'img' => 'real-time-notifications.svg',
|
||||
'name' => 'Real-time Notifications',
|
||||
'desc' => 'Add a notifications system to your site so users can receive real-time notifications',
|
||||
);
|
||||
|
||||
$premium['private-content'] = array(
|
||||
'url' => 'https://ultimatemember.com/extensions/private-content/',
|
||||
'url' => 'https://ultimatemember.com/extensions/private-content/',
|
||||
'img' => 'private-content.svg',
|
||||
'name' => 'Private Content',
|
||||
'desc' => 'Display private content to logged in users that only they can access',
|
||||
);
|
||||
|
||||
$premium['groups'] = array(
|
||||
'url' => 'https://ultimatemember.com/extensions/groups/',
|
||||
'url' => 'https://ultimatemember.com/extensions/groups/',
|
||||
'img' => 'groups.svg',
|
||||
'name' => 'Groups',
|
||||
'desc' => 'Allow users to create and join groups around shared topics, interests etc.',
|
||||
);
|
||||
|
||||
$premium['user-photos'] = array(
|
||||
'url' => 'https://ultimatemember.com/extensions/user-photos/',
|
||||
'url' => 'https://ultimatemember.com/extensions/user-photos/',
|
||||
'name' => 'User Photos',
|
||||
'img' => 'user-photos.svg',
|
||||
'desc' => 'Allow users to upload photos to their profile',
|
||||
);
|
||||
|
||||
$premium['user-bookmarks'] = array(
|
||||
'url' => 'https://ultimatemember.com/extensions/user-bookmarks/',
|
||||
'url' => 'https://ultimatemember.com/extensions/user-bookmarks/',
|
||||
'img' => 'user-bookmarks.svg',
|
||||
'name' => 'User Bookmarks',
|
||||
'desc' => 'Allow users to bookmark content from your website',
|
||||
);
|
||||
|
||||
$premium['unsplash'] = array(
|
||||
'url' => 'https://ultimatemember.com/extensions/unsplash/',
|
||||
'url' => 'https://ultimatemember.com/extensions/unsplash/',
|
||||
'img' => 'unsplash.png',
|
||||
'name' => 'Unsplash',
|
||||
'desc' => 'Allow users to select a profile cover photo from <a href="https://unsplash.com/" target="_blank">Unsplash</a> from their profile',
|
||||
);
|
||||
|
||||
$premium['user-locations'] = array(
|
||||
'url' => 'https://ultimatemember.com/extensions/user-locations/',
|
||||
'url' => 'https://ultimatemember.com/extensions/user-locations/',
|
||||
'img' => 'user-locations.svg',
|
||||
'name' => 'User Locations',
|
||||
'desc' => 'Using the Google Maps API, display users on a map on the member directory page and allow users to add their location via their profile',
|
||||
);
|
||||
|
||||
$premium['user-notes'] = array(
|
||||
'url' => 'https://ultimatemember.com/extensions/user-notes/',
|
||||
'url' => 'https://ultimatemember.com/extensions/user-notes/',
|
||||
'img' => 'user-notes.svg',
|
||||
'name' => 'User Notes',
|
||||
'desc' => 'Allow users to create public and private notes from their profile',
|
||||
);
|
||||
|
||||
$premium['profile-tabs'] = array(
|
||||
'url' => 'https://ultimatemember.com/extensions/profile-tabs/',
|
||||
'url' => 'https://ultimatemember.com/extensions/profile-tabs/',
|
||||
'img' => 'profile-tabs.svg',
|
||||
'name' => 'Profile Tabs',
|
||||
'desc' => 'Add custom tabs to profiles',
|
||||
);
|
||||
|
||||
$premium['stripe'] = array(
|
||||
'url' => 'https://ultimatemember.com/extensions/stripe/',
|
||||
'img' => 'stripe.png',
|
||||
'name' => 'Stripe',
|
||||
'desc' => 'Sell paid memberships to access your website via Stripe subscriptions',
|
||||
);
|
||||
//$premium['stripe'] = array(
|
||||
// 'url' => 'https://ultimatemember.com/extensions/stripe/',
|
||||
// 'img' => 'stripe.png',
|
||||
// 'name' => 'Stripe',
|
||||
// 'desc' => 'Sell paid memberships to access your website via Stripe subscriptions',
|
||||
//);
|
||||
|
||||
$free['jobboardwp'] = array(
|
||||
'url' => 'https://wordpress.org/plugins/um-jobboardwp',
|
||||
'url' => 'https://wordpress.org/plugins/um-jobboardwp',
|
||||
'img' => 'jobboardwp.png',
|
||||
'name' => 'JobBoardWP',
|
||||
'desc' => 'Integrates Ultimate Member with the job board plugin <a href="https://wordpress.org/plugins/jobboardwp" target="_blank">JobBoardWP</a>',
|
||||
);
|
||||
|
||||
$free['forumwp'] = array(
|
||||
'url' => 'https://ultimatemember.com/extensions/forumwp/',
|
||||
'url' => 'https://ultimatemember.com/extensions/forumwp/',
|
||||
'img' => 'forumwp.png',
|
||||
'name' => 'ForumWP',
|
||||
'desc' => 'Integrates Ultimate Member with the forum plugin <a href="https://forumwpplugin.com" target="_blank">ForumWP</a>',
|
||||
);
|
||||
|
||||
$free['online-users'] = array(
|
||||
'url' => 'https://ultimatemember.com/extensions/online-users/',
|
||||
'url' => 'https://ultimatemember.com/extensions/online-users/',
|
||||
'img' => 'online-users.svg',
|
||||
'name' => 'Online Users',
|
||||
'desc' => 'Display online users on your site so users can see who is online'
|
||||
'desc' => 'Display online users on your site so users can see who is online',
|
||||
);
|
||||
|
||||
$free['google-recaptcha'] = array(
|
||||
'url' => 'https://ultimatemember.com/extensions/google-recaptcha/',
|
||||
'url' => 'https://ultimatemember.com/extensions/google-recaptcha/',
|
||||
'img' => 'google-recaptcha.png',
|
||||
'name' => 'Google reCAPTCHA',
|
||||
'desc' => 'Stop bots on your registration & login forms with Google reCAPTCHA',
|
||||
@@ -203,7 +206,23 @@ $free['terms-conditions'] = array(
|
||||
'img' => 'terms-conditions.svg',
|
||||
'name' => 'Terms & Conditions',
|
||||
'desc' => 'Add terms & conditions to your registration form',
|
||||
); ?>
|
||||
);
|
||||
|
||||
$classes = array(
|
||||
'free' => '',
|
||||
'premium' => '',
|
||||
);
|
||||
$loop = $premium;
|
||||
// phpcs:disable WordPress.Security.NonceVerification -- Don't need nonce for the filter.
|
||||
if ( ! isset( $_REQUEST['filter'] ) || 'premium' === sanitize_key( $_REQUEST['filter'] ) ) {
|
||||
$loop = $premium;
|
||||
$classes['premium'] = 'current';
|
||||
} elseif ( 'free' === sanitize_key( $_REQUEST['filter'] ) ) {
|
||||
$loop = $free;
|
||||
$classes['free'] = 'current';
|
||||
}
|
||||
// phpcs:enable WordPress.Security.NonceVerification -- Don't need nonce for the filter.
|
||||
?>
|
||||
|
||||
<div id="um-extensions-wrap" class="wrap">
|
||||
|
||||
@@ -212,13 +231,13 @@ $free['terms-conditions'] = array(
|
||||
<div class="wp-filter">
|
||||
<ul class="filter-links">
|
||||
<li>
|
||||
<a href="?page=ultimatemember-extensions&filter=premium" class="<?php if ( ! isset( $_REQUEST['filter'] ) || isset( $_REQUEST['filter'] ) && sanitize_key( $_REQUEST['filter'] ) == 'premium' ) { echo 'current'; } ?>">
|
||||
<?php _e( 'Premium', 'ultimate-member' ) ?>
|
||||
<a href="?page=ultimatemember-extensions&filter=premium" class="<?php echo esc_attr( $classes['premium'] ); ?>">
|
||||
<?php esc_html_e( 'Premium', 'ultimate-member' ); ?>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="?page=ultimatemember-extensions&filter=free" class="<?php if ( isset( $_REQUEST['filter'] ) && sanitize_key( $_REQUEST['filter'] ) == 'free' ) { echo 'current'; } ?>">
|
||||
<?php _e( 'Free', 'ultimate-member' ) ?>
|
||||
<a href="?page=ultimatemember-extensions&filter=free" class="<?php echo esc_attr( $classes['free'] ); ?>">
|
||||
<?php esc_html_e( 'Free', 'ultimate-member' ); ?>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -226,64 +245,36 @@ $free['terms-conditions'] = array(
|
||||
|
||||
<div class="wp-list-table widefat plugin-install">
|
||||
<div id="the-list">
|
||||
<?php if ( ! isset( $_REQUEST['filter'] ) || isset( $_REQUEST['filter'] ) && sanitize_key( $_REQUEST['filter'] ) == 'premium' ) {
|
||||
foreach ( $premium as $key => $info ) { ?>
|
||||
<?php foreach ( $loop as $key => $info ) { ?>
|
||||
<div class="plugin-card">
|
||||
<div class="plugin-image-wrapper">
|
||||
<?php
|
||||
$image_class = 'plugin-image';
|
||||
if ( false !== strpos( $info['img'], '.svg' ) ) {
|
||||
$image_class .= ' svg-image';
|
||||
}
|
||||
?>
|
||||
<a href="<?php echo esc_url( $info['url'] ); ?>" class="<?php echo esc_attr( $image_class ); ?>">
|
||||
<img id="<?php echo esc_attr( 'um_' . $key . '_image' ); ?>" src="<?php echo esc_url( UM_URL . 'assets/img/extensions/' . $info['img'] ); ?>" alt="<?php echo esc_attr( $info['name'] ); ?>" />
|
||||
</a>
|
||||
</div>
|
||||
<div class="plugin-card-top">
|
||||
<h3><a href="<?php echo esc_url( $info['url'] ); ?>"><?php echo esc_html( $info['name'] ); ?></a></h3>
|
||||
|
||||
<div class="plugin-card">
|
||||
<div class="plugin-image-wrapper">
|
||||
<a href="<?php echo esc_url( $info['url'] ); ?>" class="plugin-image<?php if ( false !== strpos( $info['img'], '.svg' ) ) { ?> svg-image<?php } ?>">
|
||||
<img id="<?php echo esc_attr( 'um_' . $key . '_image' ); ?>" src="<?php echo esc_url( UM_URL . 'assets/img/extensions/' . $info['img'] ); ?>" alt="<?php echo esc_attr( $info['name'] ) ?>" />
|
||||
</a>
|
||||
</div>
|
||||
<div class="plugin-card-top">
|
||||
<h3><a href="<?php echo esc_url( $info['url'] ); ?>"><?php echo esc_html( $info['name'] ); ?></a></h3>
|
||||
|
||||
<div class="desc column-description">
|
||||
<?php echo wp_kses( $info['desc'], UM()->get_allowed_html( 'admin_notice' ) ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="plugin-action-links">
|
||||
<a class="button" href="<?php echo esc_url( $info['url'] ); ?>">
|
||||
<?php esc_html_e( 'Get this Add on', 'ultimate-member' ) ?>
|
||||
</a>
|
||||
<a href="<?php echo esc_url( $info['url'] ); ?>">
|
||||
<?php esc_html_e( 'More Details', 'ultimate-member' ) ?>
|
||||
</a>
|
||||
<div class="desc column-description">
|
||||
<?php echo wp_kses( $info['desc'], UM()->get_allowed_html( 'admin_notice' ) ); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php }
|
||||
}
|
||||
|
||||
if ( isset( $_REQUEST['filter'] ) && sanitize_key( $_REQUEST['filter'] ) == 'free' ) {
|
||||
foreach ( $free as $key => $info ) { ?>
|
||||
|
||||
<div class="plugin-card">
|
||||
<div class="plugin-image-wrapper">
|
||||
<a href="<?php echo esc_url( $info['url'] ); ?>" class="plugin-image<?php if ( false !== strpos( $info['img'], '.svg' ) ) { ?> svg-image<?php } ?>">
|
||||
<img id="<?php echo esc_attr( 'um_' . $key . '_image' ); ?>" src="<?php echo esc_url( UM_URL . 'assets/img/extensions/' . $info['img'] ); ?>" alt="<?php echo esc_attr( $info['name'] ) ?>" />
|
||||
</a>
|
||||
</div>
|
||||
<div class="plugin-card-top">
|
||||
<h3><a href="<?php echo esc_url( $info['url'] ); ?>"><?php echo esc_html( $info['name'] ); ?></a></h3>
|
||||
|
||||
<div class="desc column-description">
|
||||
<?php echo wp_kses( $info['desc'], UM()->get_allowed_html( 'admin_notice' ) ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="plugin-action-links">
|
||||
<a class="button" href="<?php echo esc_url( $info['url'] ); ?>">
|
||||
<?php esc_html_e( 'Get this Add on', 'ultimate-member' ) ?>
|
||||
</a>
|
||||
<a href="<?php echo esc_url( $info['url'] ); ?>">
|
||||
<?php esc_html_e( 'More Details', 'ultimate-member' ) ?>
|
||||
</a>
|
||||
</div>
|
||||
<div class="plugin-action-links">
|
||||
<a class="button" href="<?php echo esc_url( $info['url'] ); ?>">
|
||||
<?php esc_html_e( 'Get this Add on', 'ultimate-member' ); ?>
|
||||
</a>
|
||||
<a href="<?php echo esc_url( $info['url'] ); ?>">
|
||||
<?php esc_html_e( 'More Details', 'ultimate-member' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<?php }
|
||||
} ?>
|
||||
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -499,73 +499,100 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
update_option( 'um_fields', $all_fields );
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate aria errors attributes.
|
||||
*
|
||||
* @param bool $is_error
|
||||
* @param string $field_id
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function aria_valid_attributes( $is_error, $field_id, $context = 'error' ) {
|
||||
//$context
|
||||
$attr = ' aria-invalid="false" ';
|
||||
if ( $is_error ) {
|
||||
if ( 'notice' === $context ) {
|
||||
$errormessage_id = 'um-notice-for-' . $field_id;
|
||||
} else {
|
||||
$errormessage_id = 'um-error-for-' . $field_id;
|
||||
}
|
||||
$attr = ' aria-invalid="true" aria-errormessage="' . esc_attr( $errormessage_id ) . '" ';
|
||||
}
|
||||
return $attr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Print field error
|
||||
* Print field error.
|
||||
*
|
||||
* @since 2.6.12 Added $input_id attribute.
|
||||
*
|
||||
* @param string $text
|
||||
* @param string $input_id
|
||||
* @param bool $force_show
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function field_error( $text, $force_show = false ) {
|
||||
|
||||
public function field_error( $text, $input_id, $force_show = false ) {
|
||||
if ( empty( $text ) ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$error_id = 'um-error-for-' . $input_id;
|
||||
|
||||
if ( $force_show ) {
|
||||
$output = '<div class="um-field-error"><span class="um-field-arrow"><i class="um-faicon-caret-up"></i></span>' . wp_kses( $text, UM()->get_allowed_html( 'templates' ) ) . '</div>';
|
||||
$output = '<div class="um-field-error" id="' . esc_attr( $error_id ) . '"><span class="um-field-arrow"><i class="um-faicon-caret-up"></i></span>' . wp_kses( $text, UM()->get_allowed_html( 'templates' ) ) . '</div>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
if ( isset( $this->set_id ) && UM()->form()->processing === $this->set_id ) {
|
||||
$output = '<div class="um-field-error"><span class="um-field-arrow"><i class="um-faicon-caret-up"></i></span>' . wp_kses( $text, UM()->get_allowed_html( 'templates' ) ) . '</div>';
|
||||
$output = '<div class="um-field-error" id="' . esc_attr( $error_id ) . '"><span class="um-field-arrow"><i class="um-faicon-caret-up"></i></span>' . wp_kses( $text, UM()->get_allowed_html( 'templates' ) ) . '</div>';
|
||||
} else {
|
||||
$output = '';
|
||||
}
|
||||
|
||||
if ( ! UM()->form()->processing ) {
|
||||
$output = '<div class="um-field-error"><span class="um-field-arrow"><i class="um-faicon-caret-up"></i></span>' . wp_kses( $text, UM()->get_allowed_html( 'templates' ) ) . '</div>';
|
||||
$output = '<div class="um-field-error" id="' . esc_attr( $error_id ) . '"><span class="um-field-arrow"><i class="um-faicon-caret-up"></i></span>' . wp_kses( $text, UM()->get_allowed_html( 'templates' ) ) . '</div>';
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Print field notice
|
||||
* Print field notice.
|
||||
*
|
||||
* @since 2.6.12 Added $input_id attribute.
|
||||
*
|
||||
* @param string $text
|
||||
* @param string $input_id
|
||||
* @param bool $force_show
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function field_notice( $text, $force_show = false ) {
|
||||
|
||||
public function field_notice( $text, $input_id, $force_show = false ) {
|
||||
if ( empty( $text ) ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$notice_id = 'um-notice-for-' . $input_id;
|
||||
|
||||
if ( $force_show ) {
|
||||
$output = '<div class="um-field-notice"><span class="um-field-arrow"><i class="um-faicon-caret-up"></i></span>' . wp_kses( $text, UM()->get_allowed_html( 'templates' ) ) . '</div>';
|
||||
$output = '<div class="um-field-notice" id="' . esc_attr( $notice_id ) . '"><span class="um-field-arrow"><i class="um-faicon-caret-up"></i></span>' . wp_kses( $text, UM()->get_allowed_html( 'templates' ) ) . '</div>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
if ( isset( $this->set_id ) && UM()->form()->processing === $this->set_id ) {
|
||||
$output = '<div class="um-field-notice"><span class="um-field-arrow"><i class="um-faicon-caret-up"></i></span>' . wp_kses( $text, UM()->get_allowed_html( 'templates' ) ) . '</div>';
|
||||
$output = '<div class="um-field-notice" id="' . esc_attr( $notice_id ) . '"><span class="um-field-arrow"><i class="um-faicon-caret-up"></i></span>' . wp_kses( $text, UM()->get_allowed_html( 'templates' ) ) . '</div>';
|
||||
} else {
|
||||
$output = '';
|
||||
}
|
||||
|
||||
if ( ! UM()->form()->processing ) {
|
||||
$output = '<div class="um-field-notice"><span class="um-field-arrow"><i class="um-faicon-caret-up"></i></span>' . wp_kses( $text, UM()->get_allowed_html( 'templates' ) ) . '</div>';
|
||||
$output = '<div class="um-field-notice" id="' . esc_attr( $notice_id ) . '"><span class="um-field-arrow"><i class="um-faicon-caret-up"></i></span>' . wp_kses( $text, UM()->get_allowed_html( 'templates' ) ) . '</div>';
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if field has a server-side error
|
||||
*
|
||||
@@ -2353,7 +2380,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
$field_name = $key . $form_suffix;
|
||||
$field_value = $this->field_value( $key, $default, $data );
|
||||
|
||||
$output .= '<input ' . $disabled . ' class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
|
||||
$output .= '<input ' . $disabled . ' class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $field_name ) . '/>
|
||||
|
||||
</div>';
|
||||
|
||||
@@ -2362,9 +2389,9 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
}
|
||||
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $field_name );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $field_name );
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
@@ -2387,7 +2414,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
$field_name = $key . $form_suffix;
|
||||
$field_value = $this->field_value( $key, $default, $data );
|
||||
|
||||
$output .= '<input ' . $disabled . ' autocomplete="' . esc_attr( $autocomplete ) . '" class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
|
||||
$output .= '<input ' . $disabled . ' autocomplete="' . esc_attr( $autocomplete ) . '" class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $field_name ) . '/>
|
||||
|
||||
</div>';
|
||||
|
||||
@@ -2396,9 +2423,9 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
}
|
||||
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $field_name );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $field_name );
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
@@ -2428,14 +2455,14 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
$field_name = $key . $form_suffix;
|
||||
$field_value = $this->field_value( $key, $default, $data );
|
||||
|
||||
$output .= '<input ' . $disabled . ' class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="number" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" ' . $number_limit . ' />
|
||||
$output .= '<input ' . $disabled . ' class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="number" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" ' . $number_limit . ' ' . $this->aria_valid_attributes( $this->is_error( $key ), $field_name ) . '/>
|
||||
|
||||
</div>';
|
||||
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $field_name );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $field_name );
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
@@ -2464,20 +2491,20 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
|
||||
if ( UM()->options()->get( 'toggle_password' ) ) {
|
||||
$output .= '<div class="um-field-area-password">
|
||||
<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
|
||||
<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $field_name ) . '/>
|
||||
<span class="um-toggle-password"><i class="um-icon-eye"></i></span>
|
||||
</div>
|
||||
</div>';
|
||||
} else {
|
||||
$output .= '<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
|
||||
$output .= '<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $field_name ) . '/>
|
||||
|
||||
</div>';
|
||||
}
|
||||
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $field_name );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $field_name );
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
@@ -2502,20 +2529,20 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
|
||||
if ( UM()->options()->get( 'toggle_password' ) ) {
|
||||
$output .= '<div class="um-field-area-password">
|
||||
<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
|
||||
<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $field_name ) . '/>
|
||||
<span class="um-toggle-password"><i class="um-icon-eye"></i></span>
|
||||
</div>
|
||||
</div>';
|
||||
} else {
|
||||
$output .= '<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
|
||||
$output .= '<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $field_name ) . '/>
|
||||
|
||||
</div>';
|
||||
}
|
||||
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $field_name );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $field_name );
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
@@ -2550,20 +2577,20 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
$field_value = $this->field_value( $key, $default, $data );
|
||||
if ( UM()->options()->get( 'toggle_password' ) ) {
|
||||
$output .= '<div class="um-field-area-password">
|
||||
<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $name ) . '" id="' . esc_attr( $key . $form_suffix ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
|
||||
<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $name ) . '" id="' . esc_attr( $key . $form_suffix ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $name ) . '/>
|
||||
<span class="um-toggle-password"><i class="um-icon-eye"></i></span>
|
||||
</div>
|
||||
</div>';
|
||||
} else {
|
||||
$output .= '<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $name ) . '" id="' . esc_attr( $key . $form_suffix ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
|
||||
$output .= '<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $name ) . '" id="' . esc_attr( $key . $form_suffix ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $name ) . '/>
|
||||
|
||||
</div>';
|
||||
}
|
||||
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $name );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $name );
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
@@ -2604,17 +2631,17 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
}
|
||||
|
||||
if ( UM()->options()->get( 'toggle_password' ) ) {
|
||||
$output .= '<div class="um-field-area-password"><input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $name ) . '" id="' . esc_attr( $key . $form_suffix ) . '" value="' . esc_attr( $this->field_value( $key, $default, $data ) ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" /><span class="um-toggle-password"><i class="um-icon-eye"></i></span></div>';
|
||||
$output .= '<div class="um-field-area-password"><input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $name ) . '" id="' . esc_attr( $key . $form_suffix ) . '" value="' . esc_attr( $this->field_value( $key, $default, $data ) ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $name ) . '/><span class="um-toggle-password"><i class="um-icon-eye"></i></span></div>';
|
||||
} else {
|
||||
$output .= '<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $name ) . '" id="' . esc_attr( $key . $form_suffix ) . '" value="' . esc_attr( $this->field_value( $key, $default, $data ) ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />';
|
||||
$output .= '<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $name ) . '" id="' . esc_attr( $key . $form_suffix ) . '" value="' . esc_attr( $this->field_value( $key, $default, $data ) ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $name ) . '/>';
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $name );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $name );
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
@@ -2638,14 +2665,14 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
$field_name = $key . $form_suffix;
|
||||
$field_value = $this->field_value( $key, $default, $data );
|
||||
|
||||
$output .= '<input ' . $disabled . ' class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
|
||||
$output .= '<input ' . $disabled . ' class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $field_name ) . '/>
|
||||
|
||||
</div>';
|
||||
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $field_name );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $field_name );
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
@@ -2684,14 +2711,14 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
$disabled_weekdays = '[' . implode( ',', $data['disabled_weekdays'] ) . ']';
|
||||
}
|
||||
|
||||
$output .= '<input ' . $disabled . ' class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" data-range="' . esc_attr( $data['range'] ) . '" data-years="' . esc_attr( $data['years'] ) . '" data-years_x="' . esc_attr( $data['years_x'] ) . '" data-disabled_weekdays="' . esc_attr( $disabled_weekdays ) . '" data-date_min="' . esc_attr( $data['date_min'] ) . '" data-date_max="' . esc_attr( $data['date_max'] ) . '" data-format="' . esc_attr( $data['js_format'] ) . '" data-value="' . esc_attr( $value ) . '" />
|
||||
$output .= '<input ' . $disabled . ' class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" data-range="' . esc_attr( $data['range'] ) . '" data-years="' . esc_attr( $data['years'] ) . '" data-years_x="' . esc_attr( $data['years_x'] ) . '" data-disabled_weekdays="' . esc_attr( $disabled_weekdays ) . '" data-date_min="' . esc_attr( $data['date_min'] ) . '" data-date_max="' . esc_attr( $data['date_max'] ) . '" data-format="' . esc_attr( $data['js_format'] ) . '" data-value="' . esc_attr( $value ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $field_name ) . '/>
|
||||
|
||||
</div>';
|
||||
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $field_name );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $field_name );
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
@@ -2713,14 +2740,14 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
$field_name = $key . $form_suffix;
|
||||
$field_value = $this->field_value( $key, $default, $data );
|
||||
|
||||
$output .= '<input ' . $disabled . ' class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" data-format="' . esc_attr( $data['js_format'] ) . '" data-intervals="' . esc_attr( $data['intervals'] ) . '" data-value="' . esc_attr( $field_value ) . '" />
|
||||
$output .= '<input ' . $disabled . ' class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" data-format="' . esc_attr( $data['js_format'] ) . '" data-intervals="' . esc_attr( $data['intervals'] ) . '" data-value="' . esc_attr( $field_value ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $field_name ) . '/>
|
||||
|
||||
</div>';
|
||||
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $field_name );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $field_name );
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
@@ -2826,7 +2853,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
}
|
||||
}
|
||||
}
|
||||
$output .= '<textarea ' . $disabled . ' style="height: ' . esc_attr( $data['height'] ) . ';" class="' . esc_attr( $this->get_class( $key, $data ) ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_id ) . '" placeholder="' . esc_attr( $placeholder ) . '">' . esc_textarea( $textarea_field_value ) . '</textarea>';
|
||||
$output .= '<textarea ' . $disabled . ' style="height: ' . esc_attr( $data['height'] ) . ';" class="' . esc_attr( $this->get_class( $key, $data ) ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_id ) . '" placeholder="' . esc_attr( $placeholder ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $field_name ) . '>' . esc_textarea( $textarea_field_value ) . '</textarea>';
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
@@ -2836,9 +2863,9 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
}
|
||||
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $field_name );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $field_name );
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
@@ -2853,13 +2880,13 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
|
||||
$output .= '<div class="um-field-area">';
|
||||
|
||||
$output .= '<div class="um-rating um-raty" id="' . esc_attr( $key ) . '" data-key="' . esc_attr( $key ) . '" data-number="' . esc_attr( $data['number'] ) . '" data-score="' . $this->field_value( $key, $default, $data ) . '"></div>';
|
||||
$output .= '<div class="um-rating um-raty" id="' . esc_attr( $key ) . '" data-key="' . esc_attr( $key ) . '" data-number="' . esc_attr( $data['number'] ) . '" data-score="' . $this->field_value( $key, $default, $data ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $key ) . '></div>';
|
||||
$output .= '</div>';
|
||||
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $key );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $key );
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
@@ -2906,7 +2933,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
|
||||
$field_name = $key . $form_suffix;
|
||||
|
||||
$output .= '<input type="hidden" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" />';
|
||||
$output .= '<input type="hidden" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $field_name ) . '/>';
|
||||
if ( isset( $data['label'] ) ) {
|
||||
$output .= $this->field_label( $data['label'], $key, $data );
|
||||
}
|
||||
@@ -2991,9 +3018,9 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
}
|
||||
/* end */
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $field_name );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $field_name );
|
||||
}
|
||||
$output .= '</div>';
|
||||
|
||||
@@ -3005,7 +3032,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
$field_name = $key . $form_suffix;
|
||||
$file_field_value = $this->field_value( $key, $default, $data );
|
||||
|
||||
$output .= '<input type="hidden" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $file_field_value ) . '" />';
|
||||
$output .= '<input type="hidden" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $file_field_value ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $field_name ) . '/>';
|
||||
if ( isset( $data['label'] ) ) {
|
||||
$output .= $this->field_label( $data['label'], $key, $data );
|
||||
}
|
||||
@@ -3116,9 +3143,9 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
}
|
||||
/* end */
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $field_name );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $field_name );
|
||||
}
|
||||
$output .= '</div>';
|
||||
|
||||
@@ -3335,7 +3362,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
|
||||
$field_value = '';
|
||||
|
||||
$output .= '<select data-default="' . esc_attr( $default ) . '" ' . $disabled . ' ' . $select_original_option_value . ' ' . $disabled_by_parent_option . ' name="' . esc_attr( $form_key ) . '" id="' . esc_attr( $field_id ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" class="' . esc_attr( $this->get_class( $key, $data, $class ) ) . '" style="width: 100%" data-placeholder="' . esc_attr( $placeholder ) . '" ' . $atts_ajax . '>';
|
||||
$output .= '<select data-default="' . esc_attr( $default ) . '" ' . $disabled . ' ' . $select_original_option_value . ' ' . $disabled_by_parent_option . ' name="' . esc_attr( $form_key ) . '" id="' . esc_attr( $field_id ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" class="' . esc_attr( $this->get_class( $key, $data, $class ) ) . '" style="width: 100%" data-placeholder="' . esc_attr( $placeholder ) . '" ' . $atts_ajax . ' ' . $this->aria_valid_attributes( $this->is_error( $form_key ), $form_key ) . '>';
|
||||
$output .= '<option value=""></option>';
|
||||
|
||||
// add options
|
||||
@@ -3380,9 +3407,9 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
$output .= '</div>';
|
||||
|
||||
if ( $this->is_error( $form_key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $form_key ) );
|
||||
$output .= $this->field_error( $this->show_error( $form_key ), $form_key );
|
||||
} elseif ( $this->is_notice( $form_key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $form_key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $form_key ), $form_key );
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
@@ -3417,7 +3444,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
$output .= '<div class="um-field-icon"><i class="' . esc_attr( $data['icon'] ) . '"></i></div>';
|
||||
}
|
||||
|
||||
$output .= '<select ' . $disabled . ' multiple="multiple" name="' . esc_attr( $field_name ) . '[]" id="' . esc_attr( $field_id ) . '" data-maxsize="' . esc_attr( $max_selections ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" class="' . $this->get_class( $key, $data, $class ) . '" style="width: 100%" data-placeholder="' . esc_attr( $placeholder ) . '">';
|
||||
$output .= '<select ' . $disabled . ' multiple="multiple" name="' . esc_attr( $field_name ) . '[]" id="' . esc_attr( $field_id ) . '" data-maxsize="' . esc_attr( $max_selections ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" class="' . $this->get_class( $key, $data, $class ) . '" style="width: 100%" data-placeholder="' . esc_attr( $placeholder ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $field_name ) . '>';
|
||||
|
||||
if ( isset( $options ) && 'builtin' === $options ) {
|
||||
$options = UM()->builtin()->get( $data['filter'] );
|
||||
@@ -3536,9 +3563,9 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
$output .= '</div>';
|
||||
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $field_name );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $field_name );
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
@@ -3591,7 +3618,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
$options = apply_filters( "um_radio_field_options_{$key}", $options );
|
||||
$options = $this->get_available_roles( $form_key, $options );
|
||||
|
||||
$output .= '<div ' . $this->get_atts( $key, $classes, $conditional, $data ) . '>';
|
||||
$output .= '<div ' . $this->get_atts( $key, $classes, $conditional, $data ) . ' ' . $this->aria_valid_attributes( $this->is_error( $key ), $form_key ) . '>';
|
||||
|
||||
if ( isset( $data['label'] ) ) {
|
||||
$output .= $this->field_label( $data['label'], $key, $data );
|
||||
@@ -3693,9 +3720,9 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
$output .= '</div>';
|
||||
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $form_key );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $form_key );
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
@@ -3745,7 +3772,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
*/
|
||||
$options = apply_filters( "um_checkbox_field_options_{$key}", $options );
|
||||
|
||||
$output .= '<div ' . $this->get_atts( $key, $classes, $conditional, $data ) . '>';
|
||||
$output .= '<div ' . $this->get_atts( $key, $classes, $conditional, $data ) . ' ' . $this->aria_valid_attributes( $this->is_error( $key ), $key ) . '>';
|
||||
|
||||
if ( isset( $data['label'] ) ) {
|
||||
$output .= $this->field_label( $data['label'], $key, $data );
|
||||
@@ -3834,9 +3861,9 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
$output .= '</div>';
|
||||
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $key );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $key );
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
|
||||
@@ -1021,7 +1021,7 @@ function um_profile_header( $args ) {
|
||||
*/
|
||||
do_action( 'um_pre_header_editprofile', $args ); ?>
|
||||
|
||||
<div class="um-profile-photo" data-user_id="<?php echo esc_attr( um_profile_id() ); ?>">
|
||||
<div class="um-profile-photo" data-user_id="<?php echo esc_attr( um_profile_id() ); ?>" <?php echo esc_html( UM()->fields()->aria_valid_attributes( UM()->fields()->is_error( 'profile_photo' ), 'profile_photo' ) ); ?>>
|
||||
|
||||
<a href="<?php echo esc_url( um_user_profile_url() ); ?>" class="um-profile-photo-img" title="<?php echo esc_attr( um_user( 'display_name' ) ); ?>">
|
||||
<?php if ( ! $default_size || $default_size == 'original' ) {
|
||||
@@ -1282,13 +1282,13 @@ function um_profile_header( $args ) {
|
||||
<textarea id="um-meta-bio" data-html="<?php echo esc_attr( $bio_html ); ?>"
|
||||
data-character-limit="<?php echo esc_attr( $limit ); ?>"
|
||||
placeholder="<?php esc_attr_e( 'Tell us a bit about yourself...', 'ultimate-member' ); ?>"
|
||||
name="<?php echo esc_attr( $description_key ); ?>"><?php echo esc_textarea( $description_value ); ?></textarea>
|
||||
name="<?php echo esc_attr( $description_key ); ?>" <?php echo esc_html( UM()->fields()->aria_valid_attributes( UM()->fields()->is_error( $description_key ), 'um-meta-bio' ) ); ?>><?php echo esc_textarea( $description_value ); ?></textarea>
|
||||
<span class="um-meta-bio-character um-right">
|
||||
<span class="um-bio-limit"><?php echo esc_html( $limit ); ?></span>
|
||||
</span>
|
||||
<?php
|
||||
if ( UM()->fields()->is_error( $description_key ) ) {
|
||||
echo UM()->fields()->field_error( UM()->fields()->show_error( $description_key ), true );
|
||||
echo wp_kses( UM()->fields()->field_error( UM()->fields()->show_error( $description_key ), 'um-meta-bio', true ), UM()->get_allowed_html( 'templates' ) );
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
@@ -1332,8 +1332,9 @@ function um_profile_header( $args ) {
|
||||
</div>
|
||||
<div class="um-clear"></div>
|
||||
|
||||
<?php if ( UM()->fields()->is_error( 'profile_photo' ) ) {
|
||||
echo UM()->fields()->field_error( UM()->fields()->show_error( 'profile_photo' ), 'force_show' );
|
||||
<?php
|
||||
if ( UM()->fields()->is_error( 'profile_photo' ) ) {
|
||||
echo wp_kses( UM()->fields()->field_error( UM()->fields()->show_error( 'profile_photo' ), 'profile_photo', true ), UM()->get_allowed_html( 'templates' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user