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 | |
/** | |
* Upload Article Feature image. | |
* | |
* @param int $post_id Article ID. | |
* | |
* @param string $image_name image name. | |
* | |
* @param string $full_image_path Full image path from where image will upload. | |
*/ |
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 | |
/** | |
* set /?do=now at the end of site your URL to fire this script. | |
*/ | |
/** | |
* Function return attachment data needed for s3 table upload. | |
* | |
* @return array $attachment_data_array Attachment data array. | |
*/ |
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 | |
# PHP CodeSniffer pre-commit hook for git | |
# | |
# @author Soenke Ruempler <soenke@ruempler.eu> | |
# @author Sebastian Kaspari <s.kaspari@googlemail.com> | |
# | |
# see the README | |
PHPCS_BIN=/Users/mangesh/pear/bin/phpcs | |
PHPCS_CODING_STANDARD=PHPCompatibility |
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 | |
hookname=`basename $0` | |
FILE=`mktemp` | |
trap 'rm -f $FILE' EXIT | |
cat - > $FILE | |
for hook in $GIT_DIR/hooks/$hookname.* |
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
#!/usr/bin/php | |
<?php | |
// copied from http://phpadvent.org/2008/dont-commit-that-error-by-travis-swicegood | |
// authored by Travis Swicegood | |
// Store this file in your projects .git/hooks/ directory | |
$output = array(); | |
$return = 0; | |
exec('git rev-parse --verify HEAD 2> /dev/null', $output, $return); | |
$against = $return == 0 ? 'HEAD' : '4b825dc642cb6eb9a060e54bf8d69288fbee4904'; | |
exec("git diff-index --cached --name-only {$against}", $output); |
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 custom_get_rtmedia_permalink( $permalink, $media, $id ) { | |
$post = get_post( $media[0]->media_id ); | |
$title = isset( $post->post_name ) ? $post->post_name : ''; | |
if ( ! empty( $title ) ) { | |
$permalink = str_replace( '/' . $id , '/' . $title, $permalink ); | |
} |
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 | |
// 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($) { | |
// Event will fire when someone click on edit button of media. | |
jQuery( 'body' ).on( 'click', '.rtmedia-gallery-item-actions a:first',function(){ | |
var target = jQuery( this ).attr( 'target' ); |
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 rtmedia_get_single_album_desc_custom(){ | |
$desc = ''; | |
global $rtmedia_query; | |
if ( isset( $rtmedia_query->media_query ) && is_array( $rtmedia_query->media_query ) && isset( $rtmedia_query->media_query['album_id'] ) ) { | |
$id = $rtmedia_query->media_query['album_id']; | |
$album_desc = get_post( rtmedia_media_id( $id ) ); | |
if( isset($album_desc) ){ | |
$desc = $album_desc->post_content; | |
}else{ |
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 | |
/** | |
* When 'Delete local file' option is on in rtAmazon S3 plugin, | |
* Fetch the original image from S3 bucket and Upload back the filtered photos | |
* modified by 'rtMedia Photo Filter' addon to the S3 bucket | |
* to the S3 bucket | |
* | |
*/ | |
function custom_rtmedia_photo_filter_compatibility() { | |
if ( ! class_exists( 'RTAWSS3_Client' ) ) { |
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. | |
* |
NewerOlder