Code completion for WordPress

Hi,

I'm trying to include the WordPress code base, so it will auto complete or give suggestions for classes of WordPress. But so far luck.

Did anyone get PhpStorm to include the WordPress code base in a project?

0
3 comments
Avatar
Permanently deleted user

I use phpStorm all the time for WordPress projects, almost daily.

Which classes/methods are you having issues with?

I extended wpdb() in my projects like this.

https://gist.github.com/1105126

Now when I work with WP queries they look like this

$my_query = new WP_Query("showposts=$limit");

          while ($my_query->have_posts()) : $my_query->the_post();
               /** @var wpdb_docs $post  */
               $post = $my_query->post;

               $do_not_duplicate = $post->ID;

               $permalink = get_permalink($post->ID);
               $post_title = stripslashes($post->post_title);
              endwhile;


The $post-> instance now has all wpdb properties avalible.
ID, post_title, etc......

This can be done with any of the others also.

0
Avatar
Permanently deleted user

Jeff,

Thanks for sharing!

0

where do you but that snippet...in the functions.php?

0

Please sign in to leave a comment.