Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter arustad

    (@arustad)

    OK, I think I got it

    
    class testing{
    function __construct(){
    add_filter( 'wpcf7_validate', array($this,"example"), 20, 2 );
    }
    private  function example($result, $tags ) {
    		foreach ( $tags as $tag ) {
    			$tag = new WPCF7_Shortcode( $tag );
    			//tag stuff here
    		}
    		}		
        return $result;
    }
    }
    
    Thread Starter arustad

    (@arustad)

    I know how to write validation for specific tags, I want one that applies to all tags that take options.

    Maybe I am not seeing your point?

    • This reply was modified 8 years, 5 months ago by arustad.
    Thread Starter arustad

    (@arustad)

    It would be ridiculous not to round it. Three significant figures is enough.

    I got the (pdf) to work. But I still don’t know how to get the file size. But I honestly have not put much time into it, bigger fish to fry.

    Thread Starter arustad

    (@arustad)

    A plugin, it is for a multi-site, the form will hold a private key so I am trying to throw the book at it for security.

    Thread Starter arustad

    (@arustad)

    I understand what it is, I just do not know how to check if it is working correctly.

    Forum: Fixing WordPress
    In reply to: Roles in WordPress
    Thread Starter arustad

    (@arustad)

    .

    Forum: Fixing WordPress
    In reply to: Roles in WordPress
    Thread Starter arustad

    (@arustad)

    Thanks got multi-site working.

    I wish wordpress had a wrapper for the customizer so that super-admins could toggle what is site wide appearance and local. EG have a site wide header and main navigation bar. But per-site customization of the sidebar and branding.

    I have been accomplishing that by almost rewriting the entire theme, and a bunch of plug ins. But it seems like more work than it should be.

    Thread Starter arustad

    (@arustad)

    Thanks for replying

    I ended up using something like the following copy pasta. My boss wants a href mailto: only. He doesn’t want forms [I don’t understand either].

    So on hitting the page, the page is like this.

    [Captcha_Hide]
    Phone:123-4..
    Email:[email protected]
    ...
    [/Captcha_Hide]
    if ($_SESSION['timeout'] + 60*60 /*seconds*/ < time()) {
        // session timedout
    	$_SESSION["AreYouHuman"] = false;
      } else {
         // session ok
    	 $_SESSION["timeout"] = time() ;
      }
    if(isset($_POST['submit']) && !empty($_POST['submit'])):
        if(isset($_POST['g-recaptcha-response']) && !empty($_POST['g-recaptcha-response'])):
            //your site secret key
            $secret = 'Googles-Sectret';
            //get verify response data
            $verifyResponse = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret='.$secret.'&response='.$_POST['g-recaptcha-response']);
            $responseData = json_decode($verifyResponse);
            if($responseData->success):
                //contact form submission code
    			$_SESSION["AreYouHuman"] = true ;
    			$_SESSION['timeout'] = time();
    
            else:
                $errMsg = 'Robot verification failed, please try again.';
            endif;
        else:
            $errMsg = 'Please click on the reCAPTCHA box.';
        endif;
    else:
        $errMsg = '';
        $succMsg = '';
    endif;
    
    function AreYouHuman($atts,$content=null){
    
    	static $foo_count=0; $foo_count++; 
    
    	if ($_SESSION['AreYouHuman']==true){
    			return do_shortcode($content);
    	} else{
    	if ($foo_count<>1){
    		return;
    	};
    		echo '<script src="https://www.google.com/recaptcha/api.js" async defer>
    				$(document).ready(function(){
    					 document.getElementById("Submit").disabled = true;
    				});
    				</script>
    
    		<form id="recaptcha-email" action="" method="POST">
    			<div class="g-recaptcha"  data-callback="enableBtn" data-sitekey="SiteSecret"></div>
    			<input id="Submit" type="submit" name="submit" value="Continue">
    		</form>';
    
    	};
    }
    add_shortcode("Captcha_Hide","AreYouHuman")

Viewing 8 replies - 1 through 8 (of 8 total)