When trying to fix this issue Search ajax script "not a valid JavaScript MIME type" by attempting to bypass added editor plugins, I'm using the WordPress plugin Advanced Custom Fields to add another WYSIWYG editor.

I'm using the standard get_field call with do_shortcode in the page template file:

if( get_field('civicrm_shortcode') ) {
echo do_shortcode(get_field('civicrm_shortcode')); }

I can use a simple shortcode with no parameters in the WYSIWYG editor, i.e. [a_simple_shortcode] and it works; but using the CiviCRM shortcode with parameters, i.e. [civicrm component="profile" gid="14" mode="create" hijack="0"] shows nothing.

Is this a ACF or CiviCRM issue? Is it possible to get ACF or CiviCRM to parse the CiviCRM shortcode?

  • Works for me - the shortcode renders just fine. I have a field of type "text" attached to a field group which shows on WordPress pages. I added your code to a custom template for a page. With the demo data loaded into CiviCRM, I then added [civicrm component="profile" gid="1" mode="create" hijack="0"] to the field. The "Name and Address" profile rendered perfectly. Nov 14 '19 at 11:29
  • What I'm saying is... I think we need more info about your setup... Nov 14 '19 at 11:30
  • Ah, hold on... it renders fine, but the CiviCRM resources are not added to the page header... See this answer for the solution to that civicrm.stackexchange.com/a/16723/520 Nov 14 '19 at 11:44
  • Thanks, tried that, but now with CiviCRM loading, I get the same console errors as civicrm.stackexchange.com/questions/33700/… Nov 14 '19 at 16:15
  • Something must be a conflict in your setup. As I said, on a vanilla install (just CiviCRM and ACF) everything works as expected. Nov 14 '19 at 16:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.