PHP 79
WP CPT Custom Icon (SVG) By micha on 4th July 2024 03:33:48 PM
  1. 1. Choose Icon from Font-Awesome
  2. 2. Download SVG
  3. 3. Add "fill" option to the svg, otherwise it will be black
  4. 4. Insert directly into "menu_icon" parameter with `data:image/svg+xml;base64,` and `base64_encode`
  5.  
  6.  
  7. 'menu_icon'           => 'data:image/svg+xml;base64,' . base64_encode('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Pro 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path fill="#ffffff" d="M96 352V480v32h32 32 64 19.8l8.8-17.7 224-448L419.4 17.7 252.2 352H96zM0 352V512H64V352H0zm640 64H384v96H640V416z"/></svg>'),

Paste is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.