' . $wbpAdFilterNameLong, 'wbp_ssms_options' ); ?>

Settings

(default: at end of Post/Page content) Tools
(Placeholder)
'; echo $result; } // define admin menu plugin page tab: about function wbpAdFilterTabAbout() { global $wbpAdFilterNameLong; global $wbpAdFilterHomeLink; ?>

About

' . $wbpAdFilterNameLong . ' ' . $wbpAdFilterNameLong . '

' . $wbpAdFilterNameLong . '

Updates, news, and more useful WordPress plugins available at WeBuildPlugins.com

How to use:
1. Use any ad rotator plugin shortcode. We tested with the Ads by Datafeeder plugin.
2. Choose if you want your advertisement or Call To Action to appear on Pages/Posts/Both.
3. Choose how far into your post/page that you want your ads to appear.

Boom! You don\'t have to edit ANYTHING else!

Don\'t forget to rate this plugin so others can get injected too!
'; } // define the core ad filter function function wbpAdFilterMain( $content ){ global $wbpAdFilterNameLong; $wbpAdFilterWordCount = 110; $wbpAdFilterCharacterCount = 1000; $wbpAdFilterCharacterCount = get_option( 'wbp-ad-filter-settings-word-count' ); $wbpAdFilterSearchString = "."; $wbpAdFilterContentLength = ""; $wbpAdFilterSampleAd = ""; $wbpAdFilterSampleAd = " " . get_option( 'wbp-ad-filter-settings-shortcode' ) . " "; $wbpAdFilterHome = "no"; $wbpAdFilterHome = strtolower( get_option( 'wbp-ad-filter-settings-home' ) ); $wbpAdFilterTargetContent = "post"; $wbpAdFilterTargetContent = strtolower( get_option( 'wbp-ad-filter-settings-target-content' ) ); // Plugin set to off if( $wbpAdFilterTargetContent == "off" ) { return $content; } // Display on home page or not if( is_home() && $wbpAdFilterHome == "no" ) { return $content; } elseif( is_home() && $wbpAdFilterHome == "yes" && ( $wbpAdFilterTargetContent == "page" || $wbpAdFilterTargetContent == "both") ) { return wbpAdFilterModContent( $content, $wbpAdFilterContentLength, $wbpAdFilterSearchString, $wbpAdFilterCharacterCount, $wbpAdFilterSampleAd); } if( $wbpAdFilterTargetContent == "both" ) { return wbpAdFilterModContent( $content, $wbpAdFilterContentLength, $wbpAdFilterSearchString, $wbpAdFilterCharacterCount, $wbpAdFilterSampleAd); } elseif ( $wbpAdFilterTargetContent == "post" ) { if( is_single() ) { return wbpAdFilterModContent( $content, $wbpAdFilterContentLength, $wbpAdFilterSearchString, $wbpAdFilterCharacterCount, $wbpAdFilterSampleAd); } } elseif ( $wbpAdFilterTargetContent == "page" ) { if( is_page() ) { return wbpAdFilterModContent( $content, $wbpAdFilterContentLength, $wbpAdFilterSearchString, $wbpAdFilterCharacterCount, $wbpAdFilterSampleAd); } } return $content; } add_filter( 'the_content', 'wbpAdFilterMain' ); function wbpAdFilterModContent( $content, $wbpAdFilterContentLength, $wbpAdFilterSearchString, $wbpAdFilterCharacterCount, $wbpAdFilterSampleAd) { $wbpAdFilterPosition = 0; // get the string length of the content $wbpAdFilterContentLength = strlen( $content ); // insert or append the ad if( $wbpAdFilterContentLength > $wbpAdFilterCharacterCount ) { // move x character/words/spaces into the content and get the position after the next end of sentence. $wbpAdFilterPosition = stripos( $content, $wbpAdFilterSearchString, $wbpAdFilterCharacterCount ) + 1; $content = substr_replace( $content, $wbpAdFilterSampleAd, $wbpAdFilterPosition, 0 ); } else { $content = substr_replace( $content, $wbpAdFilterSampleAd, $wbpAdFilterContentLength ); } return $content; } // End full page scroll