The new version of Adobe’s successful CS series of creative products has just recently launched and Dreamweaver has received an extensive upgrade full of exciting new features for WordPress developers. For a long while, I was content using Notepad++ to do all of my development but, after switching to a Mac, I thought I’d give DreamWeaver another go and this new version has been well worth it.
About Site Specific Code Hinting
This has to be my current favourite new feature. Often times, I’ll find myself developing away from the internet on a local server. The WordPress Codex is a fantastic resource but, unfortunately, it’s all online. Site specific code hints have been a lifesaver. Not only do they save typing time, but they also remind you what arguments a function takes and tell you where in your site tree that function is located.
WordPress’ code is well commented, so sometimes looking up the function in its original file can provide all of the information I need to continue developing (and it sometimes has a lot more information than the Codex). Of course, you could use the site-wide search that has been available in DreamWeaver for many years, but that doesn’t tell me whether or not a function actually exists or whether I’ve just made it up (it happens more than you’d think).
These code hints aren’t limited to WordPress, either. There are defaults available for Joomla and Drupal as well but, better than that, you can actually have it search recursively through your programs and create code hinting from your own functions!
Using Code Hints
Using Site Specific Code Hinting is easy. If you’re looking to use one of the default sets (currently Wordprss, Joomla and Drupal), you first need to set up a site and add a PHP server.
I do all of my development offline on a local testing server using MAMP on the Mac. MAMP stands for Mac Apache MySQL PHP, and is basically an Apache web server in a box. It’s very easy to install, set up and use. Equivalents are available on other platforms – WAMP is available for Windows and you can just install a regular LAMP stack (using apt-get on Ubuntu or Debian, or simply install XAMPP) in Linux
Once that’s done, you’ll need to define your site.
- Go to Site -> New Site…
- Fill in your site’s name and the location of the files on your hard drive
- In ‘Servers’, click the ‘+’ sign to add a new server
- Name it whatever you want, then change the Connect using: to ‘Local/Network’
- The Server Folder is your web root – usually ‘htdocs’ or ‘www’ – and the installation of your local testing server should have told you where it is on your drive. Put that location in this box.
- The Web URL is how you access your site through a browser. This usually defaults to ‘localhost’ (e.g. http://localhost/)
To use Site-Specific Code Hints for a WordPress site, simply go to the Site menu and click Site-Specific Code Hints....
Select WordPress from the Structure: drop-down list and hit OK. Now, open a file and start typing a WordPress function and you should get the hint from that function:
Defining Your Own Sites
It gets better, though. If you’re developing your own site or PHP application, then you can set up your own structure and have it scan through and create code hints for your functions! Let’s take a look.
Here’s a very basic folder structure:
index.php - includes/functions.php
I’ve defined a nonsense function in the functions.php, and I want to be able to access the hinting while I’m coding away in index.php. Go to Site -> Site-Specific Code Hints... and select New from Blank from the drop-down menu.
Click the ‘+’ sign next to File(s): and then click the folder icon next to File/folder: 
Choose the folders you want to include (in this case ‘includes’), and then click Add. If you have nested folders, then click on the folders in the window and make sure that you check ‘recursive’. It will then search through all of the subfolders.
Click OK and it’ll ask you if you want to save it as a custom structure. If it’s a structure you use a lot in different sites, then it’s probably worthwhile – otherwise, just hit cancel.
You should now have access to the defined function and if I go to index.php and start typing the name of the function, I get this:
Of course, there are a bunch of other great new features like Live Preview and the updated CSS panel, but the new code hinting feature is definitely the one I’m using the most. I hope you’ve found this useful – if you have, consider sharing it or subscribing to my RSS feed or to my mailing list.





