- 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";
}
}
}
}