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
// Use this filter in your theme's functions.php file if you want to filter the content of new activity. | |
// For example below code will append username to current activity item. | |
// define the bp_activity_new_update_content callback | |
function filter_bp_activity_new_update_content( $activity_content ) | |
{ | |
// Append additional content here... | |
$user_info = get_userdata(get_current_user_id()); | |
$activity_content = 'I am user : '.$user_info->user_login." ".$activity_content; | |
// remove the filter |
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
<script type="text/javascript"> | |
jQuery( 'document' ).ready( function( $ ) { | |
rtMediaHook.register( 'rtmedia_js_after_files_added', function() { | |
jQuery( ".rtmedia-uploader-div #rtmedia-uploader-form #rtMedia-upload-button" ).val( 'Select your files' ); | |
return true; | |
} ); | |
}); | |
</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
<?php | |
// file: rtamazon-s3/includes/rtamazon-s3-functions.php | |
/** | |
* Set selected url structure, selected in rtAmazon settings. | |
* | |
* @since 1.4.0 | |
* | |
* @param string $urls urls in content. |
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 | |
/** | |
* Fetch google plus count from google API. | |
*/ | |
function rtmedia_wp_footer_callback(){ | |
/* Check if user is logged-in. */ | |
if( ! is_user_logged_in() ){ | |
/* Get option settings of the rtSocial plugin. */ |
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
// Check if function does not exist. | |
if ( ! function_exists( 'rtmedia_wp_footer_open_title_and_desc_callback' ) ) { | |
/** | |
* Add script in the wp_footer that fire just after the media is added in the rtMedia up-loader | |
* By default it will open the title and description box of the media | |
*/ | |
function rtmedia_wp_footer_open_title_and_desc_callback() { | |
?> | |
<script type="text/javascript"> | |
jQuery(document).ready(function($) { |
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 | |
/** That's all, stop editing from here * */ | |
global $rtmedia_backbone; | |
$rtmedia_backbone = array( | |
'backbone' => false, | |
'is_album' => false, | |
'is_edit_allowed' => false, | |
); |
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 | |
/** | |
* Remove Class Filter Without Access to Class Object | |
* | |
* In order to use the core WordPress remove_filter() on a filter added with the callback | |
* to a class, you either have to have access to that class object, or it has to be a call | |
* to a static method. This method allows you to remove filters with a callback to a class | |
* you don't have access to. | |
* | |
* @param string $tag Filter to remove |
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 | |
//Function to restrict rtmedia uploader view for author | |
function restrict_rtmedia_uploader( $allow, $section ) { | |
// Add Your Post Type Here | |
$ctp = ''; | |
if ( $ctp == get_post()->post_type ) { | |
if ( get_post()->post_author == get_current_user_id() ) { | |
$allow = true; |
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 | |
/** | |
* Magic begins from here | |
*/ | |
function my_rtmedia_set_query_filters() { | |
add_filter( 'rtmedia_media_query', 'my_modify_media_query', 9, 3 ); | |
} | |
add_action( 'rtmedia_set_query', 'my_rtmedia_set_query_filters', 99 ); | |
/** |
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 | |
// Fetch album description | |
function custom_rtmedia_get_album_desc(){ | |
global $rtmedia_backbone; | |
if ( $rtmedia_backbone[ 'backbone' ] ){ | |
echo '<%= album_desc %>'; | |
} else { | |
return rtmedia_get_album_desc_custom(); | |
} |
OlderNewer