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
add_filter( 'wpforms_webhooks_process_delivery_request_options', function( $options, $webhook_data, $fields, $form_data, $entry_id ) { | |
if ( empty( $entry_id ) || empty( $form_data['id'] ) ) { | |
return $options; | |
} | |
$body = ! is_array( $options['body'] ) ? json_decode( $options['body'], true ) : $options['body']; | |
$location = wpforms()->entry_meta->get_meta( | |
[ | |
'entry_id' => $entry_id, | |
'type' => 'location', | |
'number' => 1, |
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
/** | |
* This snippet can be used for redirecting users to the BuddyPress group Media tab when clicking on the group name. | |
* You can use this code under your theme's functions.php file: | |
*/ | |
function bp_change_group_link( $link ) { | |
preg_match_all( '~<a(.*?)href="([^"]+)"(.*?)>~', $link, $matches ); | |
$link_changed = preg_replace( "/(?<=href=(\"|'))[^\"']+(?=(\"|'))/", $matches[2][0] . apply_filters( 'rtmedia_media_tab_slug', 'media' ), $link ); |
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
// Put below code at end of your theme's functions.php file. | |
add_action( 'wp_head', function() { | |
?> | |
<style> | |
#rtm-media-gallery-uploader { | |
display: block !important; | |
} | |
</style> | |
<script> |
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
/** | |
* Add space after content of what's new. | |
*/ | |
function rtmc_add_space_after_content() { | |
?> | |
<script> | |
console.log( rtMediaHook ); | |
if( typeof rtMediaHook == "object" ){ // check if rtMediaHook defined or not | |
rtMediaHook.register( | |
'rtmedia_js_file_added', // hook id here |
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
/** | |
* Change title of "Media Gallery" in "media" tab. | |
* This functions needs "Buddypress" plugin to be activated. | |
* | |
* @param string $title Title of Media gallery. | |
* @return String Updated title. | |
*/ | |
function rtm_gallery_title( $title ) { | |
// Get user name for current profile. | |
if ( ! function_exists( 'bp_get_displayed_user_mentionname' ) ) { |
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 | |
/** | |
* It will first identify that currently logged-in user is member of which group and pick up the first group | |
* if there are more than one. | |
**/ | |
$user_id = get_current_user_id(); | |
$user_groups = (groups_get_user_groups($user_id)); | |
$user_groups = $user_groups["groups"]; |
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 | |
/** | |
* rtMedia creates activity post if someone likes the media. | |
* If anyone wants to display the liked media along with the activity post as well then here is the custom code. | |
* Thanks to community contributor Ignacio_Duran_Sanz for this. | |
* You can add this code your theme's functions.php file. | |
*/ | |
// Adding mediato activity when someone likes it |
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 | |
/*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"> |
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
jQuery( document ).ready( function () { | |
$custom_dropdown = jQuery( '#custom_dropdown_list' ); | |
$custom_input = jQuery( "#custom_media_type" ); | |
$custom_input.val( $custom_dropdown.val() ); | |
$custom_dropdown.on( 'change', function() { | |
$custom_input.val( $custom_dropdown.val() ); | |
} ); |
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 | |
// 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 ){ |
NewerOlder