Skip to content

Instantly share code, notes, and snippets.

@subharanjanm
subharanjanm / jupiter-theme-php-error-patch.diff
Created March 22, 2016 07:30
Jupiter Theme PHP Error Fix
From 61c50a2cde79587d6857f5b7dc9c96edf25b04d9 Mon Sep 17 00:00:00 2001
From: Subharanjan Mantri <subharanjan@axelerant.com>
Date: Tue, 22 Mar 2016 12:48:42 +0530
Subject: [PATCH] Fixed php error while pushing to Git
---
.../jupiter/components/shortcodes/mk_blog_teaser/mk_blog_teaser.php | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/wp-content/themes/jupiter/components/shortcodes/mk_blog_teaser/mk_blog_teaser.php b/wp-content/themes/jupiter/components/shortcodes/mk_blog_teaser/mk_blog_teaser.php
@subharanjanm
subharanjanm / tw_get_testimonial_html_class.php
Last active February 16, 2016 11:46
tw_get_testimonial_html_class to add even odd class
<?php
add_filter( 'tw_get_testimonial_html_class', 'my_tw_testimonial_html_class', 99, 6 );
function my_tw_testimonial_html_class( $class, $testimonial, $atts, $is_list, $is_first, $widget_number ) {
static $tw_list_count = 0;
if( ( $tw_list_count % 2 ) == 0 ) {
$tw_class = 'tw-even';
} else {
$tw_class = 'tw-odd';
}
@subharanjanm
subharanjanm / get-testimonials-html-controls-above.php
Last active January 27, 2016 14:15
Get testimonials html controls above the testimonials slider.
<?php
function manipulate_filter_tw_get_testimonials_html() {
if ( class_exists( 'Axl_Testimonials_Widget_Premium' ) ) {
remove_filter( 'tw_get_testimonials_html', array(
'Axl_Testimonials_Widget_Premium',
'get_testimonials_html_controls'
), 10 );
add_filter( 'tw_get_testimonials_html', 'get_testimonials_html_controls_above', 10, 10 );
}
}
@subharanjanm
subharanjanm / tw_get_testimonial_html_class.php
Created January 23, 2016 05:31
`tw_get_testimonial_html_class` hook for alternate css class
<?php
add_filter( 'tw_get_testimonial_html_class', 'my_tw_testimonial_html_class', 99, 6 );
function my_tw_testimonial_html_class( $class, $testimonial, $atts, $is_list, $is_first, $widget_number ) {
static $tw_list_count = 0;
if( ( $tw_list_count % 2 ) == 0 ) {
$tw_class = 'tw-even';
} else {
$tw_class = 'tw-odd';
}
$tw_list_count++;
@subharanjanm
subharanjanm / Setup.md
Created November 11, 2015 11:36 — forked from suvozy/Setup.md
Setup AWS EC2 and RDS (php5.5, apache2.4, mysql5.5, phpmyadmin)
@subharanjanm
subharanjanm / category-in-cite.diff
Created October 2, 2015 13:15
Display category inside testimonial's cite.
--- wp-content/plugins/testimonials-widget/templates/testimonial-cite.php (revision )
+++ wp-content/plugins/testimonials-widget/templates/testimonial-cite.php (revision )
@@ -62,6 +62,18 @@
$cite = apply_filters( 'tw_cite_html', $cite, $testimonial, $atts );
+$testimonial_category = '';
+$terms = get_the_terms( $testimonial['post_id'], 'category' );
+if ( $terms && ! is_wp_error( $terms ) ) {
+ $term_names = array();
if ( !function_exists( 'write_log' ) ) {
function write_log ( $log ) {
if ( true === WP_DEBUG ) {
error_log('---------------------------------');
if ( is_array( $log ) || is_object( $log ) ) {
error_log( print_r( $log, true ) );
} else {
error_log( $log );
}
}
add_filter( 'tw_cite_html', 'my_testimonials_widget_cite_html', 10, 3 );
function my_testimonials_widget_cite_html( $cite, $testimonial, $atts ) {
if ( ! empty( $testimonial['is-nurse'] ) ) {
$cite .= ', <b>' . $testimonial['is-nurse'] . '</b>';
}
return $cite;
}
@subharanjanm
subharanjanm / testimonials-widget-get-template-part.php
Created June 8, 2015 14:09
Load different template for content as per conditions in Testimonials Widget ( testimonials_widget_get_template_part / tw_get_template_part )
/**
* Load different template for content as per conditions.
*
* @param $templates
* @param $slug
* @param $name
*
* @return mixed
*/
function load_alternate_template( $templates, $slug, $name ) {
@subharanjanm
subharanjanm / adi_uid_issue.diff
Last active August 29, 2015 14:22
Active Directory Integration - Authentication failed issue - uid - loginattr - adLDAP
From b5818c205b382c001867a6ee5bd811cbe745f5cb Mon Sep 17 00:00:00 2001
From: Subharanjan Mantri <subharanjan@axelerant.com>
Date: Thu, 28 May 2015 14:15:44 +0530
Subject: [PATCH] Quick Fix for the LDAP id issue while authentication in
adLDAP.
---
.../plugins/active-directory-integration/ad_ldap/adLDAP.php | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)