porterwp
  • Welcome
  • Quick Start
    • Create your first site
      • Getting started
    • FAQs
  • Config
    • porter.json
      • Theme Support
      • Admin
      • Public
      • Full porter.json example
    • posttypes.json
    • taxonomies.json
    • acf.json
    • blocks.json
  • Filters
    • porter_default_object_args
  • Custom blocks
    • Build script
    • ACF integration
    • Inner blocks
  • INC
    • Block Filters
Powered by GitBook
On this page
  1. Config
  2. porter.json

Admin

Admin lets you register scripts and styles for the editor.

...
	"admin" : {
		"editor_styles" : {
			"admin_css" : {
				"src" : "./assets/dist/css/editor.min.css"
			}
		},
		"editor_scripts" : {
			"font-awesome" : {
				"src" : "//kit.fontawesome.com/KIT_ID.js",
				"deps" : [],
				"args" : {
				 	"in_footer" : true
				},
				"data" : {
					"crossorigin" : "anonymous"
				}
			}
		}
	}
...
PreviousTheme SupportNextPublic

Last updated 6 months ago

You may notice the data attribute for scripts. This lets you attach custom attributes to the script tag output, avoiding the need to use the filter.

script_loader_tag