This is now taken care of with the new code completion of action and filter names. There are so many action and filter hooks in the WordPress codebase that I find myself frequently checking the Code Reference for the correct naming. Have you ever hooked a function to a WordPress core action or filter and wondered where that code will get executed? Previously that meant doing another search of the codebase, but now just click on in the left gutter next to the hook, et voilà:
Simply CMD+Click (Ctrl+Click on Windows/Linux) on the callback:
Navigation to a Hook’s Callbackĭo you find yourself copying the callback function name of a hook and using it to find the function declaration in your codebase? No more my friend, no more. This is probably my favourite feature and it comes in a number of parts. PhpStorm’s indexing of the WordPress codebase really supercharges the use of action and filter hooks. If your wp-content directory is outside of the installation path, you may want to also add that as an extra ‘included path’, to allow indexing of plugin and theme files. This will enable the IDE to fully understand the WordPress codebase giving you some excellent benefits. It will also check to see if you want to add the installation to the PHP Include paths: PhpStorm recognizes a WordPress related project and will ask you to point it in the direction of your installation path. A complete rundown of the new WordPress features can be found here. PhpStorm comes packed with very neat WordPress support which makes using PhpStorm for WordPress theme, plugin, and site development even easier. In this article, I will walk you through some of the features that make it great for WordPress development and show you why I, and many others, love it. However, as an integrated development environment, PhpStorm offers so much more than just editing code. Some on the team swear by using a lean and fast code editor like Sublime Text and Visual Studio Code, and would find PhpStorm much slower, larger and possibly daunting to use. Remember: Ctrl + v and Cmd + Shift + a.Many of the Delicious Brains team use PhpStorm, the PHP IDE from JetBrains, as their go-to code editor, development environment, and all-round PHP best friend.
Those two shortcuts save me a lot of time, not mentioning pro impression they gave to me ? They are very simple (hey, there is only two of them!) yet very powerful, so use it wisely, use it often or even better – use it all the time. I use this shortcut mainly for those operations but I’m sure you’ll find more use cases (don’t forget to share them in the comments!) Summary Or if you want to quickly switch soft wrap for files then use Cmd + Shift + a -> wrap -> enter, and so on,
Or if you want to annotate the code (to blame your coworker for crappy code )) use Cmd + Shift + a -> anno -> enter. If you want to create pull request just use Cmd + Shift + a -> creapull -> fill dialog form -> enter. Cmd + Shift + a opens application vide operation search. So lame ?įortunately, there is a... yes, shortcut. You can use operation search in the menu bar (Help -> search) but you have to click etc. I learned recently that you can create a Pull Request on Github strait from the PhpStorm, and I find it very useful, but searching for it is a little bit annoying (VCS -> Git -> Create pull request). Try it and impress your collegues! see? no mouse! Quick, global operation search Create a stash? Ctrl + v -> stas -> type name -> enter. So if you want to create a new branch you should use Ctrl + v -> bran -> new -> type branch name and push enter (yes, it has filters options when you type, no need to type whole commands :)).ĭo you want to resolve conflicts? Ctrl + v -> resol -> enter. It opens VCS menu immediately and let you start typing to find your operation.
There is one very handy and universal shortcut: Ctrl + v. But if you want to create a branch, or checkout to one, you go to VCS menu, find your option and click it. There are also some handy shortcuts, like Cmd + t for git pull or Cmd + k for git commit. If you’re using Git then you can use it in PhpStorm in two ways: console and in version control (VCS) menu.
I’m working on a Mac so presented shortcuts are for its keyboard. So I want to present to you my favorite shortcuts in PhpStorm. It’s always a good opportunity to learn something new. I changed my job recently, so I changed my coworkers as well. Use Ctrl + v and Cmd + Shift + a shortcuts in PhpStorm.