Skip to content

Instantly share code, notes, and snippets.

@pranali333
Created March 16, 2017 13:20
Show Gist options
  • Select an option

  • Save pranali333/4133fe9c146aa46415c7e2d3f267fbba to your computer and use it in GitHub Desktop.

Select an option

Save pranali333/4133fe9c146aa46415c7e2d3f267fbba to your computer and use it in GitHub Desktop.
Custom code to add a custom DropDown under rtMedia uploader.
<?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