mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
@@ -1962,20 +1962,17 @@ if ( ! class_exists( 'Admin_Metabox' ) ) {
|
||||
case '_parent_dropdown_relationship':
|
||||
?>
|
||||
|
||||
<p><label for="_parent_dropdown_relationship">Parent Option<?php UM()->tooltip( __( 'Dynamically populates the option based from selected parent option.', 'ultimate-member' ) ); ?></label>
|
||||
<p><label for="_parent_dropdown_relationship"><?php _e( 'Parent Option', 'ultimate-member' ) ?><?php UM()->tooltip( __( 'Dynamically populates the option based from selected parent option.', 'ultimate-member' ) ); ?></label>
|
||||
<select name="_parent_dropdown_relationship" id="_parent_dropdown_relationship" style="width: 100%">
|
||||
<option value="">No Selected</option>
|
||||
<?php
|
||||
if ( UM()->builtin()->custom_fields ) {
|
||||
foreach (UM()->builtin()->custom_fields as $field_key => $array) {
|
||||
if( in_array( $array['type'], array( 'select' ) )
|
||||
&& $field_args['metakey'] != $array['metakey'] ){
|
||||
<option value=""><?php _e( 'No Selected', 'ultimate-member' ) ?></option>
|
||||
|
||||
<?php if ( UM()->builtin()->custom_fields ) {
|
||||
foreach ( UM()->builtin()->custom_fields as $field_key => $array ) {
|
||||
if ( in_array( $array['type'], array( 'select' ) ) && ( ! isset( $field_args['metakey'] ) || $field_args['metakey'] != $array['metakey'] ) ) {
|
||||
echo "<option value='".$array['metakey']."' ".selected( $array['metakey'], $this->edit_mode_value ).">".$array['title']."</option>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
} ?>
|
||||
</select>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1404,7 +1404,7 @@ if ( ! class_exists( 'Admin_Settings' ) ) {
|
||||
$filtered_settings[$key] = $value;
|
||||
|
||||
foreach( $fields as $field ) {
|
||||
if ( $field['id'] == $key && $field['type'] == 'multi_text' ) {
|
||||
if ( $field['id'] == $key && isset( $field['type'] ) && $field['type'] == 'multi_text' ) {
|
||||
$filtered_settings[$key] = array_filter( $settings[$key] );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -585,14 +585,21 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
/***
|
||||
*** @Get a translated core page URL
|
||||
***/
|
||||
|
||||
/**
|
||||
* Get a translated core page URL
|
||||
*
|
||||
* @param $post_id
|
||||
* @param $language
|
||||
* @return bool|false|string
|
||||
*/
|
||||
function um_get_url_for_language( $post_id, $language ) {
|
||||
if ( ! um_is_wpml_active() )
|
||||
return '';
|
||||
|
||||
$lang_post_id = icl_object_id( $post_id, 'page', true, $language );
|
||||
|
||||
$url = "";
|
||||
if ($lang_post_id != 0) {
|
||||
if ( $lang_post_id != 0 ) {
|
||||
$url = get_permalink( $lang_post_id );
|
||||
} else {
|
||||
// No page found, it's most likely the homepage
|
||||
@@ -603,6 +610,22 @@
|
||||
return $url;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if WPML is active
|
||||
*
|
||||
* @return bool|mixed
|
||||
*/
|
||||
function um_is_wpml_active() {
|
||||
if ( defined( 'ICL_SITEPRESS_VERSION' ) ) {
|
||||
global $sitepress;
|
||||
|
||||
return $sitepress->get_setting( 'setup_complete' );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/***
|
||||
*** @Get core page url
|
||||
***/
|
||||
|
||||
Reference in New Issue
Block a user