- removed deprecated functions;

- updated readme.txt;
- wpcs changes;
This commit is contained in:
Mykyta Synelnikov
2023-12-01 17:41:13 +02:00
parent f8e49b96e1
commit 12ba973589
3 changed files with 14 additions and 96 deletions
-80
View File
@@ -489,85 +489,5 @@ if ( ! class_exists( 'um\core\Permalinks' ) ) {
return $user_in_url;
}
/**
* Get action url for admin use
*
* @param $action
* @param $subaction
*
* @deprecated 2.6.9
*
* @return mixed|string|void
*/
public function admin_act_url( $action, $subaction ) {
_deprecated_function( __METHOD__, '2.6.9' );
$url = add_query_arg(
array(
'um_adm_action' => $action,
'sub' => $subaction,
'user_id' => um_user( 'ID' ),
'_wpnonce' => wp_create_nonce( $action ),
)
);
return $url;
}
/**
* SEO canonical href bugfix
*
* @deprecated since version 2.1.7
*
* @todo remove since 2.7.0
* @see function um_profile_remove_wpseo()
*/
public function um_rel_canonical_() {
_deprecated_function( __METHOD__, '2.1.7', 'um_profile_remove_wpseo()' );
global $wp_the_query;
if ( ! is_singular() )
return;
/**
* UM hook
*
* @type filter
* @title um_allow_canonical__filter
* @description Allow canonical
* @input_vars
* [{"var":"$allow_canonical","type":"bool","desc":"Allow?"}]
* @change_log
* ["Since: 2.0"]
* @usage
* <?php add_filter( 'um_allow_canonical__filter', 'function_name', 10, 1 ); ?>
* @example
* <?php
* add_filter( 'um_allow_canonical__filter', 'my_allow_canonical', 10, 1 );
* function my_allow_canonical( $allow_canonical ) {
* // your code here
* return $allow_canonical;
* }
* ?>
*/
$enable_canonical = apply_filters( "um_allow_canonical__filter", true );
if( ! $enable_canonical )
return;
if ( !$id = $wp_the_query->get_queried_object_id() )
return;
if ( UM()->config()->permalinks['user'] == $id ) {
$link = esc_url( $this->get_current_url() );
echo "<link rel='canonical' href='$link' />\n";
return;
}
$link = get_permalink( $id );
if ( $page = get_query_var( 'cpage' ) ) {
$link = get_comments_pagenum_link( $page );
echo "<link rel='canonical' href='$link' />\n";
}
}
}
}
+11 -15
View File
@@ -584,31 +584,28 @@ function um_restore_default_roles( $user_id, $args, $to_update ) {
}
add_action( 'um_after_user_updated', 'um_restore_default_roles', 10, 3 );
/**
* If editing another user
*
* @param $args
*/
function um_editing_user_id_input( $args ) {
if ( true === UM()->fields()->editing && 'profile' === UM()->fields()->set_mode && UM()->user()->target_id ) { ?>
if ( true === UM()->fields()->editing && 'profile' === UM()->fields()->set_mode && UM()->user()->target_id ) {
?>
<input type="hidden" name="user_id" id="user_id" value="<?php echo esc_attr( UM()->user()->target_id ); ?>" />
<input type="hidden" name="profile_nonce" id="profile_nonce" value="<?php echo esc_attr( UM()->form()->nonce ); ?>" />
<?php }
<?php
}
}
add_action( 'um_after_form_fields', 'um_editing_user_id_input' );
/**
* Remove Yoast from front end for the Profile page
*
* @see https://gist.github.com/amboutwe/1c847f9c706ff6f8c9eca76abea23fb6
* @since 2.1.6
*/
if ( !function_exists( 'um_profile_remove_wpseo' ) ) {
if ( ! function_exists( 'um_profile_remove_wpseo' ) ) {
/**
* Remove Yoast from front end for the Profile page
*
* @see https://gist.github.com/amboutwe/1c847f9c706ff6f8c9eca76abea23fb6
* @since 2.1.6
*/
function um_profile_remove_wpseo() {
if ( um_is_core_page( 'user' ) && um_get_requested_user() ) {
@@ -631,7 +628,6 @@ if ( !function_exists( 'um_profile_remove_wpseo' ) ) {
}
}
}
}
add_action( 'get_header', 'um_profile_remove_wpseo', 8 );
+3 -1
View File
@@ -166,7 +166,7 @@ No specific extensions are needed. But we highly recommended keep active these P
IMPORTANT: PLEASE UPDATE THE PLUGIN TO AT LEAST VERSION 2.6.7 IMMEDIATELY. VERSION 2.6.7 PATCHES SECURITY PRIVILEGE ESCALATION VULNERABILITY. PLEASE SEE [THIS ARTICLE](https://docs.ultimatemember.com/article/1866-security-incident-update-and-recommended-actions) FOR MORE INFORMATION
= 2.8.0: November 30, 2023 =
= 2.8.0: December 6, 2023 =
* Enhancements:
@@ -198,6 +198,8 @@ IMPORTANT: PLEASE UPDATE THE PLUGIN TO AT LEAST VERSION 2.6.7 IMMEDIATELY. VERSI
- `UM()->admin()->enqueue()->css_url` param. Please use `UM()->admin()->enqueue()::get_url( 'css' );` or `self::get_url( 'js' );` instead
- `UM()->frontend()->enqueue()->js_url` param. Please use `UM()->frontend()->enqueue()::get_url( 'js' );` or `self::get_url( 'js' );` instead
- `UM()->frontend()->enqueue()->css_url` param. Please use `UM()->frontend()->enqueue()::get_url( 'css' );` or `self::get_url( 'js' );` instead
- Fully `UM()->permalinks()->um_rel_canonical_()` function. Because since version 2.1.7 there is used `um_profile_remove_wpseo();` alternative
- Fully `UM()->permalinks()->admin_act_url()` function. Since update for wp-admin links when there is nonce this function isn't used
- Fully `UM()->admin()->enqueue()->front_js_baseurl` param.
- Fully `UM()->admin()->enqueue()->front_css_baseurl` param.
- Fully `UM()->admin()->enqueue()->post_page` param.