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 | |
if ( ! function_exists( 'rtmedia_get_attributes_count' ) ) { | |
/** | |
* Return the media count of the terms | |
* | |
* @since 1.2.3 | |
* | |
* @param string $attributes_slug attribute slug | |
* @param string $terms_slug terms slug | |
* |
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 | |
if ( ! function_exists( 'wp_footer_rtmedia_add_script_callback' ) ) { | |
/** | |
* Add javascript in the footer | |
*/ | |
function wp_footer_rtmedia_add_script_callback() { | |
?> | |
<script type="text/javascript"> | |
jQuery(document).ready(function($) { | |
rtMediaHook.register('rtmedia_js_after_file_upload', function ( resp ) { |
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 | |
if ( ! function_exists( 'wp_footer_rtmedia_add_script_callback' ) ) { | |
/** | |
* Add javascript in the footer | |
*/ | |
function wp_footer_rtmedia_add_script_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 | |
/** | |
* Add a link below every media in media gallery. | |
*/ | |
function tmp_rtmedia_rtmedia_after_item_callback() { | |
global $rtmedia_media; | |
// Check if $rtmedia_media->id rtMedia id is set and also check for if $rtmedia_media->media_id post id is set | |
if ( isset( $rtmedia_media->id ) && isset( $rtmedia_media->media_id ) ) { |
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
#!/bin/bash | |
echo 'Enter pre-commit DIR>' | |
read pre_path | |
if [ ! -f "$pre_path" ]; then | |
# Will enter here if $pre_path exists, even if it contains spaces | |
echo 'Pre commit file does not exists' | |
exit; | |
fi |
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
Run the below command in the terminal directly | |
sudo service network-manager restart | |
Will restart the netowrk manager module completly |
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 | |
/** | |
* Add script for mobile device in BuddyPress profile page only. | |
* | |
* Change style of uploader that used to change profile picture and cover photo. | |
*/ | |
function tmp_rtmedia_wp_footer_callback() { | |
// Check if it is a mobile device and bp_is_my_profile function exist also it an BuddyPress profile page. | |
if ( wp_is_mobile() && function_exists( 'bp_is_my_profile' ) && bp_is_my_profile() ) { | |
?> |
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 | |
/** | |
* Define the 'ajaxurl' JS variable, used by rtMEdia as an AJAX endpoint. | |
*/ | |
function tmp_rtmedia_core_add_ajax_url_js() { | |
?> | |
<script type="text/javascript">var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', is_ssl() ? 'admin' : 'http' ); ?>';</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 | |
/** | |
* Fix Change sensitivity of lightbox swipe on mobile. | |
* | |
* Issue link: http://community.rtcamp.com/t/change-sensitivity-of-lightbox-swipe-on-mobile/8550 | |
*/ | |
function tmp_rtm_wp_head_callback() { | |
// Check if it's an mobile device or not. | |
if ( wp_is_mobile() ) { |
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 | |
/** | |
* Change the media order tab in rtMedia sidebar widgets gallery. | |
* | |
* @since 1.3.5 | |
* | |
* @param array $allowed Contain the media tab list that will be going to be display in the rtMedia sidebar widget gallery. | |
* @param array $widgetid Contain widget id. | |
* |