- updated hookdocs markup;

- updated release docs;
This commit is contained in:
Mykyta Synelnikov
2023-06-12 17:02:56 +03:00
parent 71790c44fa
commit ca092d9496
6 changed files with 52 additions and 18 deletions
+4 -7
View File
@@ -47,16 +47,13 @@ if ( ! class_exists( 'um\admin\core\Admin_Navmenu' ) ) {
* Fires just before the move buttons of a nav menu item in the menu editor.
* Adds block "Ultimate Member Menu Settings"
*
* @since WP 5.4.0
* @hook wp_nav_menu_item_custom_fields
*
* @param int $item_id Menu item ID.
* @param int $item_id Menu item ID.
* @param \WP_Post $item Menu item data object.
* @param int $depth Depth of menu item. Used for padding.
* @param int $depth Depth of menu item. Used for padding.
* @param \stdClass $args An object of menu item arguments.
* @param int $id Nav menu ID.
* @param int $id Nav menu ID.
*/
function wp_nav_menu_item_custom_fields( $item_id, $item, $depth, $args, $id = null ) {
public function wp_nav_menu_item_custom_fields( $item_id, $item, $depth, $args, $id = null ) {
$um_nav_public = get_post_meta( $item->ID, 'menu-item-um_nav_public', true );
$_nav_roles_meta = get_post_meta( $item->ID, 'menu-item-um_nav_roles', true );
+12
View File
@@ -729,6 +729,18 @@ if ( ! class_exists( 'UM_Functions' ) ) {
* @param {string} $context Function context 'wp-admin' for Admin Dashboard echo, 'templates' for the frontend.
*
* @return {array} Allowed HTML tags with attributes.
*
* @example <caption>It adds iframe HTML tag and 'onclick' attribute for strong tag.</caption>
* function add_extra_kses_allowed_tags( $allowed_html, $context ) {
* if ( 'templates' === $context ) {
* $allowed_html['iframe'] = array(
* 'src' => true,
* );
* $allowed_html['strong']['onclick'] = true;
* }
* return $allowed_html;
* }
* add_filter( 'um_late_escaping_allowed_tags', 'add_extra_kses_allowed_tags', 10, 2 );
*/
$allowed_html = apply_filters( 'um_late_escaping_allowed_tags', $allowed_html, $context );
@@ -51,7 +51,6 @@ if ( ! class_exists( 'um\core\External_Integrations' ) ) {
* UM filter - Restore original arguments on translated page
*
* @description Restore original arguments on load shortcode if they are missed in the WPML translation
* @hook um_pre_args_setup
*
* @global \SitePress $sitepress
* @param array $args
@@ -82,7 +81,6 @@ if ( ! class_exists( 'um\core\External_Integrations' ) ) {
* Integration for the "Transposh Translation Filter" plugin
*
* @description Fix issue "404 Not Found" on profile page
* @hook template_redirect
* @see http://transposh.org/
*
* @global transposh_plugin $my_transposh_plugin
@@ -179,7 +177,6 @@ if ( ! class_exists( 'um\core\External_Integrations' ) ) {
/**
* Change user profile URL for WPML compatibility.
*
* @hook um_external_profile_url
* @see \um\core\Permalinks::profile_permalink()
*
* @param bool|string $profile_url Profile URL.
@@ -217,7 +214,6 @@ if ( ! class_exists( 'um\core\External_Integrations' ) ) {
*
* Note: It's used for User Profile nav links fix
*
* @hook um_get_current_page_url
* @see \um\core\Permalinks::get_current_url()
*
* @param string $page_url Current URL.
@@ -244,7 +240,6 @@ if ( ! class_exists( 'um\core\External_Integrations' ) ) {
/**
* Filters the displayed languages of the WPML language switcher.
*
* @hook icl_ls_languages
* @see https://wpml.org/wpml-hook/icl_ls_languages/
*
* @param array $array Collection of active languages to display in the language switcher.
+5 -4
View File
@@ -1726,14 +1726,15 @@ function um_profile_menu( $args ) {
$nav_link = apply_filters( "um_profile_menu_link_{$id}", $nav_link );
/**
* Filters changing a link's tag attributes.
* Filters a profile menu navigation links' tag attributes.
*
* @since 2.6.3
* @hook um_profile_menu_link_{$id}_attrs
*
* @param {string} $profile_nav_attrs link's tag attributes.
* @param {string} $profile_nav_attrs Link's tag attributes.
* @param {array} $args Profile form arguments.
*
* @return {string} link's tag attributes.
* @return {string} Link's tag attributes.
*
* @example <caption>Add a link's tag attributes.</caption>
* function um_profile_menu_link_attrs( $profile_nav_attrs ) {
@@ -1742,7 +1743,7 @@ function um_profile_menu( $args ) {
* }
* add_filter( 'um_profile_menu_link_{$id}_attrs', 'um_profile_menu_link_attrs', 10, 1 );
*/
$profile_nav_attrs = apply_filters( "um_profile_menu_link_{$id}_attrs", '' );
$profile_nav_attrs = apply_filters( "um_profile_menu_link_{$id}_attrs", '', $args );
$profile_nav_class = '';
if ( ! UM()->options()->get( 'profile_menu_icons' ) ) {