• Resolved jasoncfoster

    (@jasoncfoster)


    I’ve found a situation on one of our pages where we have numerous shortcodes in use where the indexing for the shortcode search matches were not working. I modified the check_for_shortcode() method as follows:

    function check_for_shortcode( $posts ){
    	$pattern = get_shortcode_regex();
    	foreach( $posts as $post ){
    		preg_match_all( '/'. $pattern .'/s', $post->post_content, $matches );
    		if(isset($matches)){
    			$key = array_search('gravityform', $matches[2]);
    			if(!$key) $key = array_search('gravityform', $matches[2]);
    			if($key && !empty($matches[3])){
    				$attributes = shortcode_parse_atts( trim( $matches[3][$key]) );
    				if( !empty($attributes['id']) && !is_ssl() && $this->check_force( $attributes['id'] ) )
    					$this->force_ssl( $post->ID );
    			}
    		}
    	}
    
    	return $posts;
    }

    https://wordpress.org/plugins/gravity-forms-force-ssl/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Too many shortcodes on page won't redirect’ is closed to new replies.