Method 'post_title' not found in class.

I'm running some code through phpStorm and am getting an error:

Method 'post_title' not found in class. 

at this line:

echo $post-post_title();

Is that phpStorm getting things wrong or am I accessing post_title incorrectly?

Topic ide post-class debug Wordpress

Category Web


Two lines of code could hide many things but I find an error: post_title is an attribute and not a method.

echo $post->post_title;

Reference: https://codex.wordpress.org/Class_Reference/WP_Post

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.