Created
March 16, 2017 13:20
-
-
Save pranali333/4133fe9c146aa46415c7e2d3f267fbba to your computer and use it in GitHub Desktop.
Custom code to add a custom DropDown under rtMedia uploader.
This file contains hidden or 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 | |
| /*Here is the custom code to add a custom Dropdown under rtMedia uploader with a hiddenfield. | |
| * You can add this code to your theme's functions.php file | |
| */ | |
| if ( ! function_exists( 'rtmedia_add_custom_dropdown_menu' ) ) { | |
| function rtmedia_add_custom_dropdown_menu( $content ) { | |
| ob_start(); | |
| ?> | |
| <div id="custom_dropdown_list_wrapper"> | |
| <select name="custom_dropdown" id="custom_dropdown_list"> | |
| <option value="free">Free</option> | |
| <option value="paid">Paid</option> | |
| </select> | |
| <input type="hidden" id="custom_media_type" name="custom_media_type" value=""/> | |
| </div> | |
| <?php | |
| return ob_get_clean(); | |
| } | |
| } | |
| add_filter( 'rtmedia_uploader_before_album_privacy', 'rtmedia_add_custom_dropdown_menu' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment