Support

Account

Home Forums Backend Issues (wp-admin) Disable ACF in Backend

Solving

Disable ACF in Backend

  • Hey there, i’ve recently discovered a backend-error (luckily only on Win XP-IE 8-11). We use the Avia-Template Builder to style the different pages and when we want to insert a image in a text-box, it only responds with a tiny_mce.js error.

    Nevertheless we’ve found a dirty workaround: Is it possible to disable all the ACF-Stuff except for a special Post-Type?

    I know, you can enable/disable the customfields based on pages, categories… but the backend still loads the js & css – stuff!

  • Hi @pixelsmart

    Is the issue stemming from an ACF field, or is the ‘image insert’ a part of the Avia-Template Builder plugin?

    You should be able to hook into the “acf/input/admin_enqueue_scripts” action as documented here http://www.advancedcustomfields.com/resources/actions/acfinputadmin_enqueue_scripts/

    and register the ACF scripts.

    The ACF scripts are:
    ‘acf-input’
    ‘acf-datepicker’

    and the styles are
    ‘acf-global’
    ‘acf-input’
    ‘acf-datepicker’

    Hope that helps.

    P.S. I would also contact the developer of the other plugin to ask that they provide compatibility with ACF

    Thanks
    E

  • Hey Elliot, thanks for your fast reply.

    Dequeue-ing the .js files works, but now i get the error
    “Uncaught ReferenceError: acf is not defined”

    the Admin-Page still loads some .js stuff:

    <script type="text/javascript">
    (function($) {
    
    	// vars
    	acf.post_id = 3590;
    	acf.nonce = "341a2fa2dd";
    	acf.admin_url = "http://beta.qm-leinerstift.de/wp-admin/";
    	acf.ajaxurl = "http://beta.qm-leinerstift.de/wp-admin/admin-ajax.php";
    	acf.wp_version = "3.7.1";
    	
    	
    	// new vars
    	acf.o = {"post_id":3590,"nonce":"341a2fa2dd","admin_url":"http:\/\/beta.qm-leinerstift.de\/wp-admin\/","ajaxurl":"http:\/\/beta.qm-leinerstift.de\/wp-admin\/admin-ajax.php","wp_version":"3.7.1"};
    	acf.l10n = {"core":{"expand_details":"Details anzeigen","collapse_details":"Details ausblenden"},"validation":{"error":"Fehler bei \u00dcberpr\u00fcfung: Ein oder mehrere Felder werden ben\u00f6tigt."},"image":{"select":"Bild ausw\u00e4hlen","edit":"Bild bearbeiten","update":"Bild aktualisieren","uploadedTo":"zu diesem Artikel hochgeladen"},"file":{"select":"Datei ausw\u00e4hlen","edit":"Datei bearbeiten","update":"Datei aktualisieren","uploadedTo":"zu diesem Artikel hochgeladen"},"relationship":{"max":"Max. Werte erreicht ( {max} Werte )","tmpl_li":"\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<a href=\"#\" data-post_id=\"<%= post_id %>\"><%= title %><span class=\"acf-button-remove\"><\/span><\/a>\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"<%= name %>[]\" value=\"<%= post_id %>\" \/>\n\t\t\t\t\t\t\t<\/li>\n\t\t\t\t\t\t\t"},"google_map":{"locating":"Locating","browser_support":"Sorry, this browser does not support geolocation"},"date_picker":{"closeText":"Fertig","currentText":"Heute","monthNames":["Januar","Februar","M\u00e4rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],"monthNamesShort":["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],"monthStatus":"Zeige einen anderen Monat","dayNames":["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],"dayNamesShort":["So","Mo","Di","Mi","Do","Fr","Sa"],"dayNamesMin":["S","M","D","M","D","F","S"],"isRTL":false}};
    	acf.fields.wysiwyg.toolbars = {"full":{"theme_advanced_buttons1":"bold,italic,strikethrough,bullist,numlist,blockquote,justifyleft,justifycenter,justifyright,link,unlink,wp_more,spellchecker,fullscreen,wp_adv,separator,wpUserAvatar,avia_builder_button","theme_advanced_buttons2":"formatselect,underline,justifyfull,forecolor,pastetext,pasteword,removeformat,charmap,outdent,indent,undo,redo,wp_help,code","theme_advanced_buttons3":"","theme_advanced_buttons4":""},"basic":{"theme_advanced_buttons1":"bold,italic,underline,blockquote,strikethrough,bullist,numlist,justifyleft,justifycenter,justifyright,undo,redo,link,unlink,fullscreen"}};
    
    })(jQuery);	
    </script>
  • Hi @pixelsmart

    Yes, the acf object needs to exist for some variables. Perhaps you can define it like so:

    
    acf = {};
    

    If you put that in your js file or even in an inline script tag on the admin page, ACF should work.

    Thanks
    E

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

The topic ‘Disable ACF in Backend’ is closed to new replies.