Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@topdown
Created July 25, 2011 20:35
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save topdown/1105126 to your computer and use it in GitHub Desktop.
Save topdown/1105126 to your computer and use it in GitHub Desktop.
WPDB extend for properties for phpStorm
<?php
/* Use an autoloader on include to load this but do not instance it
* OPTION ONE (autoloaded or included)
* Name the class like this
* class wpdb_docs extends wpdb {}
*
* /** @var $tag wpdb_docs */
* $tag_urls = get_tag_link($tag->term_id);
*
* OPTION TWO and probably the best
* Alternatively you can just have it class wpdb {} and put it in the project root and phpStorm will find it
* This way it does not need to be autoloaded or inlcuded
*
* /** @var $tag wpdb */
* $tag_urls = get_tag_link($tag->term_id);
*
*/
/**
* @property wpdb $ID
* @property wpdb $post_author
* @property wpdb $post_date
* @property wpdb $post_date_gmt
* @property wpdb $post_content
* @property wpdb $post_title
* @property wpdb $post_excerpt
* @property wpdb $post_status
* @property wpdb $comment_status
* @property wpdb $ping_status
* @property wpdb $post_password
* @property wpdb $post_name
* @property wpdb $to_ping
* @property wpdb $pinged
* @property wpdb $post_modified
* @property wpdb $post_modified_gmt
* @property wpdb $post_content_filtered
* @property wpdb $post_parent
* @property wpdb $guid
* @property wpdb $menu_order
* @property wpdb $post_type
* @property wpdb $post_mime_type
* @property wpdb $comment_count
* @property wpdb $filter
* @property wpdb $term_id
* @property wpdb $name
*
*/
class wpdb {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment