Created
November 4, 2022 12:58
-
-
Save yuriinalivaiko/9b6ad03fbedda7a91071bfd86bf0d802 to your computer and use it in GitHub Desktop.
Hook um_custom_dropdown_options_source_url__{$form_key}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Hook: um_custom_dropdown_options_source_url__{$form_key} | |
* | |
* Type: filter | |
* | |
* Description: Change custom dropdown options source URL by $form_key. | |
* | |
* @example https://github.com/ultimatemember/ultimatemember/blob/master/includes/core/class-fields.php#L3139 | |
* @link https://docs.ultimatemember.com/article/1094-umcustomdropdownoptionssourceurlformkey | |
* | |
* @package um\core | |
* @see um\core\Fields::edit_field() | |
* @since 2.0 | |
* @deprecated | |
* | |
* @param string $url Dropdown options source URL. | |
* @param array $data Field data. | |
* | |
* @return string Dropdown options source URL. | |
*/ | |
function my_custom_dropdown_options_source_url( $url, $data ) { | |
// your code here. | |
return $url; | |
} | |
$form_key = 'role'; | |
add_filter( "um_custom_dropdown_options_source_url__{$form_key}", 'my_custom_dropdown_options_source_url', 10, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment