Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call to undefined function ot_get_media_post_ID() #349

Closed
RobbyMcCullough opened this issue Jun 18, 2014 · 11 comments
Closed

Call to undefined function ot_get_media_post_ID() #349

RobbyMcCullough opened this issue Jun 18, 2014 · 11 comments

Comments

@RobbyMcCullough
Copy link

Hi there! Thanks for working on and releasing this plugin! I am running into an issue when using Option Tree with my plugin, the FastLine Page Builder. Once both plugins are installed and activated, any time we launch our page builder on a page the following error is thrown:

Fatal error: Call to undefined function ot_get_media_post_ID() in /home/fastr/public_html/chameleon/wp-content/plugins/option-tree/ot-loader.php on line 686

Any thoughts on why this might be happening? I would be happy to help dig into the source and fix the issue, I just need some direction =D. Thanks much!

@valendesigns
Copy link
Owner

If I had to venture a guess, the other plugin is manually reloading WordPress when it makes it's AJAX calls using some sort of file. Since OT loads during an action the direct call to load WP leaves you without the functions you need as OT is not yet loaded in the temporary WP that's used for AJAX. But this is speculative as I'm on my phone and can't test the issue or look at the plugins source right this moment.

@RobbyMcCullough
Copy link
Author

Thanks a ton for the speedy reply. We're going to look into this on our end. I'll let ya know what we find!

@valendesigns
Copy link
Owner

Keep me in the loop, and feel free to ask as many questions as you like. Being able to work with other plugins is an important issue. Cheers!

@guldoe
Copy link

guldoe commented Jul 15, 2014

Hi , any solution al Error. i,m using a classiffied plugin and it appears when i try to create from a Front Page a classiffied

@jefferose
Copy link

Running into the same problem in my own plugin and tracked it down.

Line 686 is
if ( ! is_object( $post ) )
$settings['post']['id'] = ot_get_media_post_ID();

And this seems to fail because the page being displayed isn't a page - it's generated by code on the fly. This code is being invoked because the public function shortcode is attached to the filter for: media_view_settings

That's invoked if you enqueue the new Media modal.

Any idea how to have the 2 play nice? I've disabled the media on the public page in my plugin - it wasn't needed anyway.

@valendesigns
Copy link
Owner

This should be fixed in the next version coming out soon. I've changed the way that code builds the post ID for the shortcode and threw in a check for the existence of the function.

Cheers,
Derek

@Betoniara
Copy link

next version coming out soon - when ?

@valendesigns
Copy link
Owner

Monday.

@Betoniara
Copy link

ok, thank you for the information

@shirg
Copy link

shirg commented Nov 23, 2014

hi, I have the latest version, but still there is seems to be a conflict. When activating advanced custom fields, option tree is not functionioning any longer...

@dknzdesign
Copy link

dknzdesign commented Feb 15, 2023

I know this post and question is super old but here is a quick fix for those of you who are having plugin conflict in admin:
`

  if (!is_object($post) && function_exists('ot_get_media_post_ID'))
    $settings['post']['id'] = ot_get_media_post_ID();

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants