Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Plugin Name: WCFM – Content Restriction 2
- * Plugin URI: http://wclovers.com
- * Description: WCFM Messages Content Restriction Customization
- * Author: WC Lovers
- * Version: 2.1.0
- * Author URI: http://wclovers.com
- *
- * Text Domain: wcfm-content-check
- * Domain Path: /lang/
- *
- * WC requires at least: 3.0.0
- * WC tested up to: 3.6.0
- *
- */
- if (!defined('ABSPATH')) exit; // Exit if accessed directly
- if (!class_exists('WCFM')) return; // Exit if WCFM not installed
- add_filter('wcfm_is_allow_enquiry_by_customer', '__return_false');
- add_filter('wcfm_is_allow_enquiry_customer_reply', '__return_false');
- add_filter('wcfm_enquiry_content', function ($content, $product_id, $vendor_id, $customer_id) {
- if (function_exists('wcfm_filter_content_email_phone')) {
- $new_content = wcfm_filter_content_email_phone($content);
- if($new_content!=$content) {
- return 'predefined text which would include terms and conditions for use of inquiry module';
- }
- }
- return $content;
- }, 50, 4);
- add_filter('wcfm_enquiry_reply_content', function ($content, $product_id, $vendor_id, $customer_id) {
- if (function_exists('wcfm_filter_content_email_phone')) {
- $new_content = wcfm_filter_content_email_phone($content);
- if($new_content!=$content) {
- return 'predefined text which would include terms and conditions for use of inquiry module';
- }
- }
- return $content;
- }, 50, 4);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement