https://www.reddit.com/r/elementaryos/comments/3fzd6s/tutorial_how_to_replace_the_applications_text_on/
Open file manager up as administrator and go to: /usr/share/themes/name-of-your-theme-folder/gtk-3.0
Place the icon you want to use in that folder.
Make sure the icon has proper permissions by right clicking on it, choosing properties > more > and making it 644-777 (read, write, and executable by owner, group, everyone) or else wingpanel may not load.
Open up /usr/share/themes/name-of-your-theme-folder/gtk-3.0/apps.css in Scratch, scroll down to the panel settings, find .panel-app-button, and change what's in the {brackets} to what's below.
.panel-app-button > GtkWidget > GtkWidget:first-child { padding: 0px 24px 0px 0px; font-size: 0px; background-image: url("icon.svg"); background-repeat: no-repeat; }
Change the background image url to the name of the icon that you placed in the gtk-3.0 folder.
The padding above is adjusted for a 24x24 icon but you can adjust it to fit something bigger/smaller/wider, just change "24px" to the width of your image.
In terminal type: killall wingpanel to see the changes.