Skip to content

Instantly share code, notes, and snippets.

@pranali333
Last active March 8, 2017 14:34
Show Gist options
  • Save pranali333/b7ed8c40903765a23916978714dc3a81 to your computer and use it in GitHub Desktop.
Save pranali333/b7ed8c40903765a23916978714dc3a81 to your computer and use it in GitHub Desktop.
Add conditional check before applying watermark on rtMedia uploads
<?php
// IMPORTANT
// Before using this gist code, make sure you have added this code - https://gist.github.com/pranali333/085e312f18fc2b9bd7333f8c17b56630
add_action( 'init', 'pre_watermark_condition', 11 );
function pre_watermark_condition() {
if ( isset( $_POST['unique_hidden_field'] ) ) {
if ( Media is free ){
// Remove action to apply watermark
remove_class_action( 'rtemdia_after_file_upload_before_activity','RTMediaWatermark', 'load_filter', 10 );
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment