This file contains hidden or 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 | |
/* Option 1 */ | |
$html = '<div> | |
<p>At the time of creating any blog or news based websites most webmasters gives the least amount of importance to the commenting system of their website, without even understanding the importance of it. Eventually comment section of a website is the only place where people interact with the author when they are exited or happy with the article and helps to grow the whole website community. In most cases they end up using some third party commenting system like Disqus or Spot.im etc. without even realizing what a blunder they are making. I’ve seen many websites (both big & popular as well as small websites) using Disqus commenting system, without even realizing the consequences. And by the time you will realize it, your site would have become so big & popular they you can’t take the risk of changing your commenting system. If you are thinking why, keep reading.</p> | |
<p><a href="I want to omit this P from counting"><img src="I want to omit this p from counting" /></a></p> | |
<p |
This file contains hidden or 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); | |
} ); |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |