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 | |
//* Changing Price Label in Gravity Forms - Supports the latest version too | |
//* in gform_product_price_6 the 6 denoted to the FORM ID | |
add_filter( 'gform_product_price_6', function( $sublabel, $form_id ) { | |
return 'Donation Amount'; | |
}, 10, 2); |
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 | |
//* Attaching file to the form notification user email | |
//* in gform_notification_7, the number 7 is the FORM ID | |
//* This snippet works with the newer version of Gravity Forms too | |
add_filter('gform_notification_7', 'add_attachment_pdf', 10, 3); //target form id 7, change to your form id | |
function add_attachment_pdf( $notification, $form, $entry ) { | |
//There is no concept of user notifications anymore, so we will need to target notifications based on other criteria, | |
//such as name or subject | |
if($notification["name"] == "User Notification - Life Lesson"){ | |
//get upload root for WordPress |
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_filter( 'xmlrpc_enabled', '__return_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 | |
/* | |
Plugin Name: Insert AdSense Ad Code after certain paragraph | |
Plugin URI: https://www.isaumya.com/ | |
Description: Insert AdSense Ad code after certain paragraph number while ignoring some paragraphs | |
Version: 2.0 | |
Author: Saumya Majumder | |
Author URI: https://www.isaumya.com/ | |
*/ |
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 | |
/* | |
Plugin Name: Insert AdSense Ad Code after certain paragraph | |
Plugin URI: https://www.isaumya.com/ | |
Description: Insert AdSense Ad code after certain paragraph number considering all `p` tags | |
Version: 1.0 | |
Author: Saumya Majumder | |
Author URI: https://www.isaumya.com/ | |
*/ |
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 __check_paragraph_count_blog( $content ) { | |
global $post; | |
if ( $post->post_type == 'post' ) { | |
$count = substr_count( $content, '</p>' ); | |
return $count; | |
} else { | |
return 0; | |
} | |
} |
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 | |
/* Please note this filter will not work on Gravity Forms v2.0+ | |
* If your GF is not capturing values like ajgsdn?12332#?fds#^% | |
* then use the following filter in GF v2.0 prior | |
**/ | |
add_filter( 'gform_sanitize_entry_value', '__return_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 | |
/** | |
* Increase general user comment editing time | |
* @plugin_name: Simple Comment Editing | |
* @plugin_uri: https://wordpress.org/plugins/simple-comment-editing/ | |
*/ | |
add_filter( 'sce_comment_time', function( $time_in_minutes ) { | |
return 10; | |
} ); |
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 | |
/** | |
* Changing the default loading icon for editing comments for general users | |
* @plugin_name: Simple Comment Editing | |
* @plugin_uri: https://wordpress.org/plugins/simple-comment-editing/ | |
*/ | |
add_filter( 'sce_loading_img', function( $default_url ) { | |
return get_stylesheet_directory_uri() . '/assets/images/spinner.gif'; | |
} ); |
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 | |
/*Allowing mod_pagespeed or nginx_pagespeed to combine CSS files*/ | |
/*By removing the ID field from the css link href*/ | |
add_filter('style_loader_tag', function( $link ) { | |
// Removing the Style ID from the WordPress CSS output as the ID in `link` causes the issue | |
return preg_replace("/id='.*-css'/", "", $link); | |
} ); |