Skip to content

Instantly share code, notes, and snippets.

@torounit
Created June 18, 2015 04:29
Show Gist options
  • Save torounit/595f7e8e0ffa9868101c to your computer and use it in GitHub Desktop.
Save torounit/595f7e8e0ffa9868101c to your computer and use it in GitHub Desktop.
PHPStorm等でWordPressのグローバル変数の入力補完を有効にする。プロジェクトのどこかに置いておくと補完されるようになる。
<?php
trigger_error("This file should not be included, only analyzed by your IDE", E_USER_ERROR);
$wp_the_query = new WP_Query();
/** @var WP_Query $wp_query */
$wp_query = $wp_the_query;
$wp_rewrite = new WP_Rewrite();
$wp = new WP();
$wp_widget_factory = new WP_Widget_Factory();
$wp_roles = new WP_Roles();
/** @var WP_Post[] $posts */
$posts = get_posts();
$posts[0]->ID;
/** @var WP_Post $post */
$post = get_post();
$wpdb = new wpdb( DB_USER, DB_PASSWORD, DB_NAME, DB_HOST );
$wp_object_cache = new WP_Object_Cache();
$wp_embed = new WP_Embed();
$current_user = new WP_User();
$userdata = new WP_User();
$wp_list_table = new WP_List_Table();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment