Support » Theme: Hueman » Getting an Error when trying to create a Front-end form using ACF

  • Hey,

    I’m working on a custom project with this theme. I use Advanced Custom fields plugin, and I created a new page template for my front-end form. But when I add the acf_form_head(); function to the template, I get the following error:

    Fatal error: Call to undefined function ot_get_media_post_ID() in E:\htdocs\\wp-content\themes\hueman\option-tree\ot-loader.php on line 667


Viewing 7 replies - 1 through 7 (of 7 total)
  • I’m getting this very issue, a conflict between the Option Tree in the Hueman theme and the ACF plugin…

    Found this link, which helps somewhat:

    especially the link in that post to this:

    I’ve done as the op said and removed this part from ot-loader.php:

    public function shortcode( $settings, $post ) {
    // Set the OptionTree post ID
    if ( ! is_object( $post ) )
    $settings['post']['id'] = ot_get_media_post_ID();
    // No ID return settings
    if ( $settings['post']['id'] == 0 )
    return $settings;
    // Set the fake shortcode
    $settings['ot_gallery'] = array( 'shortcode' => "[gallery id='{$settings['post']['id']}']" );
    // Return settings
    return $settings;

    Now I’m getting the following error message though:

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'OT_Loader' does not have a method 'shortcode' in /[ROOT]/wp-includes/plugin.php on line 192

    I really hate doing this, but I went ahead and just commented out this portion of the above referenced code and I’m not getting errors anymore.

    $settings['post']['id'] = ot_get_media_post_ID();

    Fingers crossed it will do the job. I’ve seen this issue brought up on the theme dev’s site but still no solution.

    A cleaner fix is to change this line:
    if ( ! is_object( $post ) )
    To this:
    if ( ! is_object( $post ) && function_exists('ot_get_media_post_ID'))

    That fixed it for me. Let’s hope the next Hueman release includes a fix for this bug.

    Ah, that’s what I needed, thanks azherahmed!

    Thanks a lot!!! It saved my life. Hope it gets fixed in the next release.

    your topic is very interesting. I have made similar experiences. take a closer look at . This could solve your problem.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Getting an Error when trying to create a Front-end form using ACF’ is closed to new replies.