### Example Implementation Source: https://docs.ultimatemember.com/article/1422-umthemesinglepostbottom A complete example showing how to define a function and hook it to um_theme_single_post_bottom. ```php ``` -------------------------------- ### Example implementation of um_theme_single_post_before Source: https://docs.ultimatemember.com/article/1418-umthemesinglepostbefore A complete example showing how to register the action and define the callback function. ```php ``` -------------------------------- ### Example implementation of um_before_submit_form_post Source: https://docs.ultimatemember.com/article/1063-umbeforesubmitformpost A practical example showing how to hook into the form submission process. ```php ``` -------------------------------- ### Example implementation of um_before_{$mode}_fields Source: https://docs.ultimatemember.com/article/1171-ummainmodefields A complete example showing how to register the action and define the callback function. ```php ``` -------------------------------- ### Example implementation of um_after_user_status_is_changed Source: https://docs.ultimatemember.com/article/1036-umafteruserstatusischanged A complete example showing how to define a callback function for the um_after_user_status_is_changed hook. ```php ``` -------------------------------- ### Example: Custom function for um_theme_single_post_top Source: https://docs.ultimatemember.com/article/1420-umthemesingleposttop Example implementation of a custom function hooked to um_theme_single_post_top, with a placeholder for user code. ```php ``` -------------------------------- ### Example implementation of um_default_settings_values filter Source: https://docs.ultimatemember.com/article/1101-umdefaultsettingsvalues Example implementation of the um_default_settings_values filter. The callback receives the $settings array and should return it after modifications. ```php ``` -------------------------------- ### Example implementation for um_admin_user_action_hook Source: https://docs.ultimatemember.com/article/1004-umadminuseractionhook Provides a complete PHP example that registers a custom function for the um_admin_user_action_hook and defines the callback. The callback receives the $subaction string parameter. ```php ``` -------------------------------- ### Example callback for um_account_secure_fields Source: https://docs.ultimatemember.com/article/965-umaccountsecurefields Example implementation of the filter. The callback receives the account fields array and the user ID, and must return the modified fields array. ```php ``` -------------------------------- ### Example of um_theme_after_page_content Hook Source: https://docs.ultimatemember.com/article/1434-umthemeafterpagecontent Provides a complete example of adding a custom function to the um_theme_after_page_content action hook. ```php ``` -------------------------------- ### Example callback for um_admin_settings_email_section_fields Source: https://docs.ultimatemember.com/article/1003-umadminsettingsemailsectionfields Example implementation of the filter callback that receives the settings array and email key, and returns the modified settings. ```php ``` -------------------------------- ### Example implementation of um_access_fix_external_post_content Source: https://docs.ultimatemember.com/article/958-umaccessfixexternalpostcontent Example of defining a callback function for the hook. The function is empty and ready for custom code. ```php ``` -------------------------------- ### Example implementation for um_custom_image_handle_{$field} Source: https://docs.ultimatemember.com/article/1097-umcustomimagehandlefield Example implementation of a callback for the um_custom_image_handle_{$field} filter. The function receives $data and returns it after custom processing. ```php ``` -------------------------------- ### Example: um_theme_after_comments_title callback with function definition Source: https://docs.ultimatemember.com/article/1428-umthemebelowcommentstitle Complete example that hooks my_comments_title to um_theme_after_comments_title and defines the callback with a placeholder comment for custom code. ```php ``` -------------------------------- ### Example: custom callback for um_update_profile_full_name Source: https://docs.ultimatemember.com/article/1285-umupdateprofilefullname Example of a custom callback function hooked to um_update_profile_full_name. The function receives $user_id and $args, and contains a placeholder for custom code. ```php ``` -------------------------------- ### Example callback for um_after_template_part Source: https://docs.ultimatemember.com/article/1027-umaftertemplatepart Example callback function that receives the template name, path, located file, and template arguments. Place custom code inside the function body. ```php ``` -------------------------------- ### Example: Custom callback for um_access_enable_referer Source: https://docs.ultimatemember.com/article/957-umaccessenablereferer Provides a complete PHP example of adding a custom function to the um_access_enable_referer filter. The function receives the $referrer boolean and returns it after custom logic. ```php ``` -------------------------------- ### Implement my_admin_field_modal_footer callback Source: https://docs.ultimatemember.com/article/994-umadminfieldmodalfooter Example implementation of the callback function for the um_admin_field_modal_footer hook. ```php ``` -------------------------------- ### Example usage of um_roles_add_meta_boxes hook Source: https://docs.ultimatemember.com/article/1249-umrolesaddmetaboxes Example implementation of the um_roles_add_meta_boxes action hook. The callback function receives the $meta parameter and can contain custom code to add meta boxes on the add/edit UM Role screen. ```php ``` -------------------------------- ### Example implementation of um_rest_api_get_stats filter Source: https://docs.ultimatemember.com/article/1243-umrestapigetstats Provides a complete example of a custom filter function that modifies the $response array. The function returns the modified $response. This example is intended for developers to customize the Rest API get stats output. ```php ``` -------------------------------- ### Example implementation of um_modify_sortby_parameter Source: https://docs.ultimatemember.com/article/1179-ummodifysortbyparameter Example function that modifies the query arguments for the Members Directory sort by parameter. ```php ``` -------------------------------- ### Example: Retrieve and echo user IP with um_user_ip() Source: https://docs.ultimatemember.com/article/159-umuserip Retrieves the user's IP address and prints it with a message. The output is the IP address, e.g., 127.0.0.1. ```php ``` -------------------------------- ### Example 02: Allow video file uploads Source: https://docs.ultimatemember.com/article/1045-umallowedfiletypes Adds video file extensions to the allowed types and embeds video files in profile view. Requires adding to functions.php. Uses wp_get_video_extensions() and applies the [video] shortcode. ```php uploader()->get_upload_user_base_url( um_profile_id() ) ) . $filename; $shortcode = '[video src="' . esc_url( $file_url ) . '"]'; $value = apply_shortcodes( $shortcode ); } return $value; } ``` -------------------------------- ### Example implementation of um_edit_{$key}_field_value Source: https://docs.ultimatemember.com/article/1109-umeditkeyfieldvalue A complete example showing how to define the callback function to modify the field value. ```php ``` -------------------------------- ### Example implementation of um_profile_header hook Source: https://docs.ultimatemember.com/article/1212-umprofileheader Defines a custom function my_profile_header that hooks into um_profile_header and receives the $args array. ```php ``` -------------------------------- ### Auto-login user with remember session using UM()->user()->auto_login(10, true) Source: https://docs.ultimatemember.com/article/161-autologin Example that signs in a user and makes the plugin remember their session by passing true for the $rememberme parameter. ```php user()->auto_login ( 10, true ); ?> ``` -------------------------------- ### Example usage of um_view_field_value_{$type} filter Source: https://docs.ultimatemember.com/article/1316-umviewfieldvaluetype Example implementation of the um_view_field_value_{$type} filter. The callback function my_form_edit_field receives the field HTML and data, and must return the modified HTML. Note the function name in the example differs from the one in the add_filter call. ```php ``` -------------------------------- ### Implement my_after_user_updated callback Source: https://docs.ultimatemember.com/article/1038-umafteruserupdated Example implementation of the callback function to handle user profile updates. ```php ``` -------------------------------- ### Implement the um_profile_menu_link_{$id} callback Source: https://docs.ultimatemember.com/article/1215-umprofilemenulinkid Example implementation of the callback function to modify the navigation link. ```php ``` -------------------------------- ### Example: Custom callback for um_validation_safe_username_regex Source: https://docs.ultimatemember.com/article/1313-umvalidationsafeusernameregex Example implementation of a callback function for the um_validation_safe_username_regex filter. The function receives the $regex_safe parameter and returns it after modification. ```php ``` -------------------------------- ### Registering the um_user_before_query hook Source: https://docs.ultimatemember.com/article/1292-umuserbeforequery Basic syntax for adding an action to the um_user_before_query hook. ```php add_action( 'um_user_before_query', 'function_name', 10, 1 ); ``` -------------------------------- ### Example implementation of um_{$key}_form_edit_field Source: https://docs.ultimatemember.com/article/1321-umkeyformeditfield Example callback function that modifies the field HTML. The function receives $output and $mode, and should return the modified $output. ```php ```