Support

Account

Home Forums Front-end Issues Conditional Logic not working in Front-End

Solving

Conditional Logic not working in Front-End

  • I followed the new post tutorial and noticed that my Conditional Logic types are not working in the front-end new post but work in the admin new post. I followed it exactly like the tutorial. They all display instead of turning on and off.

    http://www.advancedcustomfields.com/resources/tutorials/using-acf_form-to-create-a-new-post/

  • Hi @Hunter

    Can you check your console log on the front end form?
    Do you have any errors to report?

    Thanks
    E

  • I checked the log… if you mean setting debug to true… and only had alot of undefined variables in other plugins nothing specific to acf..

    [05-Sep-2013 15:45:23] PHP Notice:  Undefined index: tr_on in D:\Hosting\11702510\html\wp-content\plugins\toolbar-remixed-free\toolbar-remixed-free.php on line 348
    [05-Sep-2013 15:45:23] PHP Notice:  has_cap was called with an argument that is <strong>deprecated</strong> since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in D:\Hosting\11702510\html\wp-includes\functions.php on line 2969
    [05-Sep-2013 15:45:23] PHP Notice:  Undefined variable: control_ops in D:\Hosting\11702510\html\wp-content\plugins\social-media-followers-counter\social-counter.php on line 21
    [05-Sep-2013 15:45:24] PHP Notice:  Use of undefined constant cgview - assumed 'cgview' in D:\Hosting\11702510\html\wp-content\plugins\category-grid-view-gallery\includes\Options.php on line 38
    [05-Sep-2013 15:45:24] PHP Notice:  has_cap was called with an argument that is <strong>deprecated</strong> since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in D:\Hosting\11702510\html\wp-includes\functions.php on line 2969
    [05-Sep-2013 15:45:24] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:24] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:24] PHP Notice:  Undefined index: tr_on in D:\Hosting\11702510\html\wp-content\plugins\toolbar-remixed-free\toolbar-remixed-free.php on line 317
    [05-Sep-2013 15:45:24] PHP Notice:  Undefined index: tr_on in D:\Hosting\11702510\html\wp-content\plugins\toolbar-remixed-free\toolbar-remixed-free.php on line 348
    [05-Sep-2013 15:45:24] PHP Notice:  has_cap was called with an argument that is <strong>deprecated</strong> since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in D:\Hosting\11702510\html\wp-includes\functions.php on line 2969
    [05-Sep-2013 15:45:24] PHP Notice:  Undefined variable: control_ops in D:\Hosting\11702510\html\wp-content\plugins\social-media-followers-counter\social-counter.php on line 21
    [05-Sep-2013 15:45:24] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined index: tr_on in D:\Hosting\11702510\html\wp-content\plugins\toolbar-remixed-free\toolbar-remixed-free.php on line 317
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined property: FollowerCounterWidget::$version in D:\Hosting\11702510\html\wp-content\plugins\social-media-followers-counter\social-counter.php on line 190
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined index: tr_on in D:\Hosting\11702510\html\wp-content\plugins\toolbar-remixed-free\toolbar-remixed-free.php on line 348
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined index: tabActive in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 1884
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined index: tab_type in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 1892
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined index: tabActive in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 1884
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined index: tab_type in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 1892
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined property: WP_Query::$post in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 41
    [05-Sep-2013 15:45:25] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 42
    [05-Sep-2013 15:45:25] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 44
    [05-Sep-2013 15:45:25] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 45
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined variable: options in D:\Hosting\11702510\html\wp-content\plugins\facebook-members\facebook-members.php on line 73
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined property: WP_Query::$post in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 41
    [05-Sep-2013 15:45:25] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 42
    [05-Sep-2013 15:45:25] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 44
    [05-Sep-2013 15:45:25] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 45
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined variable: options in D:\Hosting\11702510\html\wp-content\plugins\facebook-members\facebook-members.php on line 73
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined property: WP_Query::$post in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 41
    [05-Sep-2013 15:45:25] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 42
    [05-Sep-2013 15:45:25] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 44
    [05-Sep-2013 15:45:25] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 45
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined variable: options in D:\Hosting\11702510\html\wp-content\plugins\facebook-members\facebook-members.php on line 73
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined variable: control_ops in D:\Hosting\11702510\html\wp-content\plugins\social-media-followers-counter\social-counter.php on line 21
    [05-Sep-2013 15:45:26] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:26] PHP Notice:  Undefined index: tr_on in D:\Hosting\11702510\html\wp-content\plugins\toolbar-remixed-free\toolbar-remixed-free.php on line 317
    [05-Sep-2013 15:45:26] PHP Notice:  Undefined property: FollowerCounterWidget::$version in D:\Hosting\11702510\html\wp-content\plugins\social-media-followers-counter\social-counter.php on line 190
    [05-Sep-2013 15:45:26] PHP Notice:  Undefined index: tr_on in D:\Hosting\11702510\html\wp-content\plugins\toolbar-remixed-free\toolbar-remixed-free.php on line 348
    [05-Sep-2013 15:45:26] PHP Notice:  Undefined variable: options in D:\Hosting\11702510\html\wp-content\plugins\facebook-members\facebook-members.php on line 73
    [05-Sep-2013 15:45:26] PHP Notice:  Undefined variable: options in D:\Hosting\11702510\html\wp-content\plugins\facebook-members\facebook-members.php on line 73
    [05-Sep-2013 15:45:26] PHP Notice:  Undefined variable: options in D:\Hosting\11702510\html\wp-content\plugins\facebook-members\facebook-members.php on line 73
    [05-Sep-2013 15:45:26] PHP Notice:  Undefined variable: options in D:\Hosting\11702510\html\wp-content\plugins\facebook-members\facebook-members.php on line 73
    [05-Sep-2013 15:45:27] PHP Notice:  Undefined variable: control_ops in D:\Hosting\11702510\html\wp-content\plugins\social-media-followers-counter\social-counter.php on line 21
    [05-Sep-2013 15:45:27] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:27] PHP Notice:  Undefined variable: control_ops in D:\Hosting\11702510\html\wp-content\plugins\social-media-followers-counter\social-counter.php on line 21
    [05-Sep-2013 15:45:27] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:28] PHP Notice:  Undefined variable: control_ops in D:\Hosting\11702510\html\wp-content\plugins\social-media-followers-counter\social-counter.php on line 21
    [05-Sep-2013 15:45:28] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:29] PHP Notice:  Undefined variable: control_ops in D:\Hosting\11702510\html\wp-content\plugins\social-media-followers-counter\social-counter.php on line 21
    [05-Sep-2013 15:45:29] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:33] PHP Notice:  Undefined variable: control_ops in D:\Hosting\11702510\html\wp-content\plugins\social-media-followers-counter\social-counter.php on line 21
    [05-Sep-2013 15:45:33] PHP Notice:  Use of undefined constant cgview - assumed 'cgview' in D:\Hosting\11702510\html\wp-content\plugins\category-grid-view-gallery\includes\Options.php on line 38
    [05-Sep-2013 15:45:33] PHP Notice:  has_cap was called with an argument that is <strong>deprecated</strong> since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in D:\Hosting\11702510\html\wp-includes\functions.php on line 2969
    [05-Sep-2013 15:45:33] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:33] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:33] PHP Notice:  Undefined index: tr_on in D:\Hosting\11702510\html\wp-content\plugins\toolbar-remixed-free\toolbar-remixed-free.php on line 317
    [05-Sep-2013 15:45:33] PHP Notice:  Undefined index: tr_on in D:\Hosting\11702510\html\wp-content\plugins\toolbar-remixed-free\toolbar-remixed-free.php on line 348
    [05-Sep-2013 15:45:33] PHP Notice:  has_cap was called with an argument that is <strong>deprecated</strong> since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in D:\Hosting\11702510\html\wp-includes\functions.php on line 2969
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined variable: control_ops in D:\Hosting\11702510\html\wp-content\plugins\social-media-followers-counter\social-counter.php on line 21
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined index: tr_on in D:\Hosting\11702510\html\wp-content\plugins\toolbar-remixed-free\toolbar-remixed-free.php on line 317
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined property: FollowerCounterWidget::$version in D:\Hosting\11702510\html\wp-content\plugins\social-media-followers-counter\social-counter.php on line 190
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined index: tr_on in D:\Hosting\11702510\html\wp-content\plugins\toolbar-remixed-free\toolbar-remixed-free.php on line 348
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined index: tabActive in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 1884
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined index: tab_type in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 1892
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined index: tabActive in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 1884
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined index: tab_type in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 1892
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined property: WP_Query::$post in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 41
    [05-Sep-2013 15:45:34] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 42
    [05-Sep-2013 15:45:34] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 44
    [05-Sep-2013 15:45:34] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 45
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined variable: options in D:\Hosting\11702510\html\wp-content\plugins\facebook-members\facebook-members.php on line 73
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined property: WP_Query::$post in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 41
    [05-Sep-2013 15:45:34] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 42
    [05-Sep-2013 15:45:34] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 44
    [05-Sep-2013 15:45:34] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 45
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined variable: options in D:\Hosting\11702510\html\wp-content\plugins\facebook-members\facebook-members.php on line 73
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined property: WP_Query::$post in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 41
    [05-Sep-2013 15:45:34] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 42
    [05-Sep-2013 15:45:34] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 44
    [05-Sep-2013 15:45:34] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 45
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined variable: options in D:\Hosting\11702510\html\wp-content\plugins\facebook-members\facebook-members.php on line 73
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:44] PHP Notice:  Undefined variable: control_ops in D:\Hosting\11702510\html\wp-content\plugins\social-media-followers-counter\social-counter.php on line 21
    [05-Sep-2013 15:45:44] PHP Notice:  Use of undefined constant cgview - assumed 'cgview' in D:\Hosting\11702510\html\wp-content\plugins\category-grid-view-gallery\includes\Options.php on line 38
    [05-Sep-2013 15:45:44] PHP Notice:  has_cap was called with an argument that is <strong>deprecated</strong> since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in D:\Hosting\11702510\html\wp-includes\functions.php on line 2969
    [05-Sep-2013 15:45:44] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:44] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:44] PHP Notice:  Undefined index: tr_on in D:\Hosting\11702510\html\wp-content\plugins\toolbar-remixed-free\toolbar-remixed-free.php on line 317
    
  • There no direct errors on the site….
    My Function.php afc part

    function my_pre_save_post( $post_id )
    {
        // check if this is to be a new post
        if( $post_id != 'new' )
        {
            return $post_id;
        }
     
        // Create a new post
        $post = array(
            'post_status'  => 'draft' ,
            'post_title'  => 'A title, maybe a $_POST variable' ,
            'post_type'  => 'post' ,
        );  
     
        // insert the post
        $post_id = wp_insert_post( $post ); 
        $targetCatgogry = array( 4 ); 
        wp_set_post_terms( $post_id, $targetCatgogry);
        // update $_POST['return']
        $_POST['return'] = add_query_arg( array('post_id' => $post_id), $_POST['return'] );    
     
        // return the new ID
        return $post_id;
    }
     
    add_filter('acf/pre_save_post' , 'my_pre_save_post' );
    

    My template page php afc

    <?php
    acf_form_head();
    the_post();
    
    $args = array
    (
    	'post_id' => 'new',
    	'field_groups' => array(182, 368)
    );
    
    acf_form( $args ); 
    ?>
  • Hi @Hunter

    Sorry, no, I did not mean turn on debug mode and search for PHP errors.

    I mean, open up the console log and check for JS errors. The console log is found in firebug / inspector and will show JS error.

    Conditional logic is a Javascript functionality, not PHP, so only a JS error can cause it updset.

    Thanks
    E

  • These were the only errors both are acf it looks like`ReferenceError: acf is not defined…. I included the line in question that the error was coming from… Below the error… Honestly looks like cause it null I am having theses issues… Don't understand why it null though :/

    
    ReferenceError: acf is not defined
    	
    
    acf.conditional_logic.items.push({"status":1,"rules":[{"field":"field_52269b8e9a732","operator":"!=","value":"Renzo"},{"field":"field_52269b8e9a732","operator":"!=","value":"Amaryth"},{"field":"field_52269b8e9a732","operator":"==","value":"Friea"}],"allorany":"all","field":"field_52269c7cc3246"});
    
    TypeError: acf.o is null
    	
    */__d("JSON3",[],function(a,b,c,d,e,f){(function(){var g={}.toString,h,i,j,k=e.exports={},l='{"A":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}',m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ba=new Date(-3509827334573292),ca,da,ea;try{ba=ba.getUTCFullYear()==-109252&&ba.getUTCMonth()===0&&ba.getUTCDate()==1&&ba.getUTCHours()==10&&ba.getUTCMinutes()==37&&ba.getUTCSeconds()==6&&ba.getUTCMilliseconds()==708;}catch(fa){}if(!ba){ca=Math.floor;da=[0,31,59,90,120,151,181,212,243,273,304,334];ea=function(ga,ha){return da[ha]+365*(ga-1970)+ca((ga-1969+(ha=+(ha>1)))/4)-ca((ga-1901+ha)/100)+ca((ga-1601+ha)/400);};}if(typeof JSON=="object"&&JSON){k.stringify=JSON.stringify;k.parse=JSON.parse;}if((m=typeof k.stringify=="function"&&!ea)){(ba=function(){return 1;}).toJSON=ba;try{m=k.stringify(0)==="0"&&k.stringify(new Number())==="0"&&k.stringify(new String())=='""'&&k.stringify(g)===j&&k.stringify(j)===j&&k.stringify()===j&&k.stringify(ba)==="1"&&k.stringify([ba])=="[1]"&&k.stringify([j])=="[null]"&&k.stringify(null)=="null"&&k.stringify([j,g,null])=="[null,null,null]"&&k.stringify({result:[ba,true,false,null,"\b\n\f\r\t"]})==l&&k.stringify(null,ba)==="1"&&k.stringify([1,2],null,1)=="[\n 1,\n 2\n]"&&k.stringify(new Date(-8.64e+15))=='"-271821-04-20T00:00:00.000Z"'&&k.stringify(new Date(8.64e+15))=='"+275760-09-13T00:00:00.000Z"'&&k.stringify(new Date(-62198755200000))=='"-000001-01-01T00:00:00.000Z"'&&k.stringify(new Date(-1))=='"1969-12-31T23:59:59.999Z"';}catch(fa){m=false;}}if(typeof k.parse=="function")try{if(k.parse("0")===0&&!k.parse(false)){ba=k.parse(l);if((r=ba.A.length==5&&ba.A[0]==1)){try{r=!k.parse('"\t"');}catch(fa){}if(r)try{r=k.parse("01")!=1;}catch(fa){}}}}catch(fa){r=false;}ba=l=null;if(!m||!r){if(!(h={}.hasOwnProperty))h=function(ga){var ha={},ia;if((ha.__proto__=null,ha.__proto__={toString:1},ha).toString!=g){h=function(ja){var ka=this.__proto__,la=ja in (this.__proto__=null,this);this.__proto__=ka;return la;};}else{ia=ha.constructor;h=function(ja){var ka=(this.constructor||ia).prototype;return ja in this&&!(ja in ka&&this[ja]===ka[ja]);};}ha=null;return h.call(this,ga);};i=function(ga,ha){var ia=0,ja,ka,la,ma;(ja=function(){this.valueOf=0;}).prototype.valueOf=0;ka=new ja();for(la in ka)if(h.call(ka,la))ia++;ja=ka=null;if(!ia){ka=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"];ma=function(na,oa){var pa=g.call(na)=="[object Function]",qa,ra;for(qa in na)if(!(pa&&qa=="prototype")&&h.call(na,qa))oa(qa);for(ra=ka.length;qa=ka[--ra];h.call(na,qa)&&oa(qa));};}else if(ia==2){ma=function(na,oa){var pa={},qa=g.call(na)=="[object Function]",ra;for(ra in na)if(!(qa&&ra=="prototype")&&!h.call(pa,ra)&&(pa[ra]=1)&&h.call(na,ra))oa(ra);};}else ma=function(na,oa){var pa=g.call(na)=="[object Function]",qa,ra;for(qa in na)if(!(pa&&qa=="prototype")&&h.call(na,qa)&&!(ra=qa==="constructor"))oa(qa);if(ra||h.call(na,(qa="constructor")))oa(qa);};return ma(ga,ha);};if(!m){n={"\\":"\\\\",'"':'\\"',"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"};o=function(ga,ha){return ("000000"+(ha||0)).slice(-ga);};p=function(ga){var ha='"',ia=0,ja;for(;ja=ga.charAt(ia);ia++)ha+='\\"\b\f\n\r\t'.indexOf(ja)>-1?n[ja]:ja<" "?"\\u00"+o(2,ja.charCodeAt(0).toString(16)):ja;return ha+'"';};q=function(ga,ha,ia,ja,ka,la,ma){var na=ha[ga],oa,pa,qa,ra,sa,ta,ua,va,wa,xa,ya,za,ab,bb,cb;if(typeof na=="object"&&na){oa=g.call(na);if(oa=="[object Date]"&&!h.call(na,"toJSON")){if(na>-1/0&&na<1/0){if(ea){ra=ca(na/86400000);for(pa=ca(ra/365.2425)+1970-1;ea(pa+1,0)<=ra;pa++);for(qa=ca((ra-ea(pa,0))/30.42);ea(pa,qa+1)<=ra;qa++);ra=1+ra-ea(pa,qa);sa=(na%86400000+86400000)%86400000;ta=ca(sa/3600000)%24;ua=ca(sa/60000)%60;va=ca(sa/1000)%60;wa=sa%1000;}else{pa=na.getUTCFullYear();qa=na.getUTCMonth();ra=na.getUTCDate();ta=na.getUTCHours();ua=na.getUTCMinutes();va=na.getUTCSeconds();wa=na.getUTCMilliseconds();}na=(pa<=0||pa>=10000?(pa<0?"-":"+")+o(6,pa<0?-pa:pa):o(4,pa))+"-"+o(2,qa+1)+"-"+o(2,ra)+"T"+o(2,ta)+":"+o(2,ua)+":"+o(2,va)+"."+o(3,wa)+"Z";}else na=null;}else if(typeof na.toJSON=="function"&&((oa!="[object Number]"&&oa!="[object String]"&&oa!="[object Array]")||h.call(na,"toJSON")))na=na.toJSON(ga);}if(ia)na=ia.call(ha,ga,na);if(na===null)return "null";oa=g.call(na);if(oa=="[object Boolean]"){return ""+na;}else if(oa=="[object Number]"){return na>-1/0&&na<1/0?""+na:"null";}else if(oa=="[object String]")return p(na);if(typeof na=="object"){for(ab=ma.length;ab--;)if(ma[ab]===na)throw TypeError();ma.push(na);xa=[];bb=la;la+=ka;if(oa=="[object Array]"){for(za=0,ab=na.length;za<ab;cb||(cb=true),za++){ya=q(za,na,ia,ja,ka,la,ma);xa.push(ya===j?"null":ya);}return cb?(ka?"[\n"+la+xa.join(",\n"+la)+"\n"+bb+"]":("["+xa.join(",")+"]")):"[]";}else{i(ja||na,function(db){var eb=q(db,na,ia,ja,ka,la,ma);if(eb!==j)xa.push(p(db)+":"+(ka?" ":"")+eb);cb||(cb=true);});return cb?(ka?"{\n"+la+xa.join(",\n"+la)+"\n"+bb+"}":("{"+xa.join(",")+"}")):"{}";}ma.pop();}};k.stringify=function(ga,ha,ia){var ja,ka,la,ma,na,oa;if(typeof ha=="function"||typeof ha=="object"&&ha)if(g.call(ha)=="[object Function]"){ka=ha;}else if(g.call(ha)=="[object Array]"){la={};for(ma=0,na=ha.length;ma<na;oa=ha[ma++],((g.call(oa)=="[object String]"||g.call(oa)=="[object Number]")&&(la[oa]=1)));}if(ia)if(g.call(ia)=="[object Number]"){if((ia-=ia%1)>0)for(ja="",ia>10&&(ia=10);ja.length<ia;ja+=" ");}else if(g.call(ia)=="[object String]")ja=ia.length<=10?ia:ia.slice(0,10);return q("",(oa={},oa[""]=ga,oa),ka,la,ja,"",[]);};}if(!r){s=String.fromCharCode;t={"\\":"\\",'"':'"',"/":"/",b:"\b",t:"\t",n:"\n",f:"\f",r:"\r"};u=function(){z=aa=null;throw SyntaxError();};v=function(){var ga=aa,ha=ga.length,ia,ja,ka,la,ma;while(z<ha){ia=ga.charAt(z);if("\t\r\n ".indexOf(ia)>-1){z++;}else if("{}[]:,".indexOf(ia)>-1){z++;return ia;}else if(ia=='"'){for(ja="@",z++;z<ha;){ia=ga.charAt(z);if(ia<" "){u();}else if(ia=="\\"){ia=ga.charAt(++z);if('\\"/btnfr'.indexOf(ia)>-1){ja+=t[ia];z++;}else if(ia=="u"){ka=++z;for(la=z+4;z<la;z++){ia=ga.charAt(z);if(!(ia>="0"&&ia<="9"||ia>="a"&&ia<="f"||ia>="A"&&ia<="F"))u();}ja+=s("0x"+ga.slice(ka,z));}else u();}else{if(ia=='"')break;ja+=ia;z++;}}if(ga.charAt(z)=='"'){z++;return ja;}u();}else{ka=z;if(ia=="-"){ma=true;ia=ga.charAt(++z);}if(ia>="0"&&ia<="9"){if(ia=="0"&&(ia=ga.charAt(z+1),ia>="0"&&ia<="9"))u();ma=false;for(;z<ha&&(ia=ga.charAt(z),ia>="0"&&ia<="9");z++);if(ga.charAt(z)=="."){la=++z;for(;la<ha&&(ia=ga.charAt(la),ia>="0"&&ia<="9");la++);if(la==z)u();z=la;}ia=ga.charAt(z);if(ia=="e"||ia=="E"){ia=ga.charAt(++z);if(ia=="+"||ia=="-")z++;for(la=z;la<ha&&(ia=ga.charAt(la),ia>="0"&&ia<="9");la++);if(la==z)u();z=la;}return +ga.slice(ka,z);}if(ma)u();if(ga.slice(z,z+4)=="true"){z+=4;return true;}else if(ga.slice(z,z+5)=="false"){z+=5;return false;}else if(ga.slice(z,z+4)=="null"){z+=4;return null;}u();}}return "$";};w=function(ga){var ha,ia,ja;if(ga=="$")u();if(typeof ga=="string"){if(ga.charAt(0)=="@")return ga.slice(1);if(ga=="["){ha=[];for(;;ia||(ia=true)){ga=v();if(ga=="]")break;if(ia)if(ga==","){ga=v();if(ga=="]")u();}else u();if(ga==",")u();ha.push(w(ga));}return ha;}else if(ga=="{"){ha={};for(;;ia||(ia=true)){ga=v();if(ga=="}")break;if(ia)if(ga==","){ga=v();if(ga=="}")u();}else u();if(ga==","||typeof ga!="string"||ga.charAt(0)!="@"||v()!=":")u();ha[ga.slice(1)]=w(v());}return ha;}u();}return ga;};y=function(ga,ha,ia){var ja=x(ga,ha,ia);if(ja===j){delete ga[ha];}else ga[ha]=ja;};x=function(ga,ha,ia){var ja=ga[ha],ka;if(typeof ja=="object"&&ja)if(g.call(ja)=="[object Array]"){for(ka=ja.length;ka--;)y(ja,ka,ia);}else i(ja,function(la){y(ja,la,ia);});return ia.call(ga,ha,ja);};k.parse=function(ga,ha){z=0;aa=ga;var ia=w(v());if(v()!="$")u();z=aa=null;return ha&&g.call(ha)=="[object Function]"?x((ba={},ba[""]=ia,ba),"",ha):ia;};}}}).call(this);}); 
  • Hi @Hunter

    Thanks for the JS errors.

    The fact that acf is not defined is telling me that there is a script tag missing from your front end page.

    Can you view the source and find the script tag including acf/js/input.js? Does it exist?

  • I don’t see that and don’t see any acf scripts loading on the front page however on the backend/admin pages they are loading… is there a simple line of include i could use?

    I tried to include …. This did remove the errors but didn’t fix the issue

    <script type='text/javascript' src='/advanced-custom-fields/js/input.min.js?ver=4.2.2'></script>
    <script type='text/javascript' src='advanced-custom-fields/core/fields/date_picker/jquery.ui.datepicker.js?ver=4.2.2'></script> 
  • Hi @Hunter

    The acf_form_head function should be adding all this in + more.

    It seems that this function is not running correctly. Can you please confirm hat you are using this function before the wp_head() function?

  • It not being used above the wp_head() function because I am using headway theme editor and using a custom code block…. Does it have to be above the wp_head()?

  • Hi @Hunter

    Yes, it has to be above wp_head (as per docs) otherwise it wont work!

  • Will this cause any negative effects if acf_form_head is above every header?

  • Hi @Hunter

    Yes. It should not be above every wp_head, only on the template you need it on.

  • Just had same issue, i am too use headway, best is to use something like this to load functionaliry only on some pages since headway dont use wp template system by default:
    im header.php above wp_head() enter
    if (is_page(2778) or is_page(2792)) acf_form_head();
    where those IDs are pages you need to have forms

  • Try use ACF Frontend display plugin:
    https://wordpress.org/plugins/acf-frontend-display/

    I tested conditional logic on newest version and it’s correct.

Viewing 15 posts - 1 through 15 (of 15 total)

The topic ‘Conditional Logic not working in Front-End’ is closed to new replies.