Skip to content

Instantly share code, notes, and snippets.

View BhargavBhandari90's full-sized avatar
🏠
Working from home

Bhargav(Bunty) BhargavBhandari90

🏠
Working from home
View GitHub Profile
@BhargavBhandari90
BhargavBhandari90 / scripts.js
Created December 15, 2016 11:21
Prevent license key validation by Enter Key as it is deactivates the first plugin's license.
/* Prevent license key validation by Enter Key as it is deactivates the first plugin's license. */
jQuery( '.license-form .regular-text' ).each( function(){
jQuery( this ).keypress(function (event) {
var keycode = (event.keyCode ? event.keyCode : event.which);
/* check if key pressed is "Enter key" or not */
if(keycode == '13'){
return false;
}
} );
} );
/*
Theme Name: Twenty Sixteen
Theme URI: https://wordpress.org/themes/twentysixteen/
Author: the WordPress team
Author URI: https://wordpress.org/
Description: Twenty Sixteen is a modernized take on an ever-popular WordPress layout — the horizontal masthead with an optional right sidebar that works perfectly for blogs and websites. It has custom color options with beautiful default color schemes, a harmonious fluid grid using a mobile-first approach, and impeccable polish in every detail. Twenty Sixteen will make your WordPress look beautiful everywhere.
Version: 1.3
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: one-column, two-columns, right-sidebar, accessibility-ready, custom-background, custom-colors, custom-header, custom-menu, editor-style, featured-images, flexible-header, microformats, post-formats, rtl-language-support, sticky-post, threaded-comments, translation-ready, blog
<?php
/**
* Apply css validation during rtMe
*/
function rtmedia_apply_css_validation() {
return true;
}
add_filter( 'rtmedia_css_validation', 'rtmedia_apply_css_validation' );
@BhargavBhandari90
BhargavBhandari90 / default-sorting.php
Last active February 27, 2017 07:09
Default sorting option
<?php
/**
*
* Sorts media on page load accoeging to perameters passed
* Use this function when rtmedia-sorting plugin is active
*
*/
function rtmedia_custom_order_by( $order_by ) {
// if it's not json data
<?php
/**
* rtmedia_enable_tabular_view Show medias in tabular format.
* @param bool $status Status of function.
* @return bool Returns true tabular format is enabled from rtMedia settings.
*/
function rtmedia_enable_tabular_view( $status ) {
global $rtmedia_query;
if ( function_exists( 'rtm_is_document_table_view_enabled' ) && rtm_is_document_table_view_enabled() && isset( $rtmedia_query->action_query->action ) && 'edit' !== $rtmedia_query->action_query->action ) {
if ( ( function_exists( 'is_rtmedia_album' ) && is_rtmedia_album() ) || ( function_exists( 'is_rtmedia_gallery' ) && is_rtmedia_gallery() ) ) {
<?php
/*
Plugin Name: Easy Digital Downloads - Software Licenses
Plugin URL: https://easydigitaldownloads.com/downloads/software-licensing/
Description: Adds a software licensing system to Easy Digital Downloads
Version: 3.5.10
Author: Easy Digital Downloads
Author URI: https://easydigitaldownloads.com
Contributors: easydigitaldownloads, mordauk, cklosows
Text Domain: edd_sl
@BhargavBhandari90
BhargavBhandari90 / prevent-video.php
Last active April 19, 2017 14:02
This will skip videos for uploading to s3 bucket
<?php
/**
* rtamazon_can_upload_to_bucket Prevent preticular media type to upload to s3 bucket
* @param bool $status status of filter
* @param int $attachment_id Id of uploading media
* @return bool Return false if media type is video
*/
function rtamazon_can_upload_to_bucket( $status, $attachment_id ) {
// Get the mime type for uploading video.
@BhargavBhandari90
BhargavBhandari90 / functions.php
Last active May 15, 2017 15:13
Get randome image in member's loop
<?php
// Add this function to theme's functions.php
/**
* Show randome album image in member's loop.
*/
function rtmedia_members_gallery() {
global $wpdb;
if ( function_exists( 'bp_get_member_user_id' ) ) {
// Get member's ID.
@BhargavBhandari90
BhargavBhandari90 / functions.php
Last active May 15, 2017 15:13
Remove target blank from edit link.
<?php
// Add this code to theme's functions.php
// Remove target blank from edit link.
// Check if function doest not exists.
if ( ! function_exists( 'rtmedia_wp_footer_add_js_callback' ) ) {
function rtmedia_wp_footer_add_js_callback() {
?>
<script type="text/javascript">
jQuery(document).ready(function($) {
function remove_blank_target() {
@BhargavBhandari90
BhargavBhandari90 / functions.php
Last active May 17, 2017 09:04
Remove link of url preview from activity
<?php
// Add this function to theme's functions.php
// Check if function doest not exists.
if ( ! function_exists( 'rtmedia_wp_footer_add_js_remove_link' ) ) {
/**
* Remove link from activity url preview content.
*/
function rtmedia_wp_footer_add_js_remove_link() {
?>
<script type="text/javascript">