• Stars
    star
    120
  • Rank 294,898 (Top 6 %)
  • Language
    PHP
  • License
    Other
  • Created over 11 years ago
  • Updated about 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

WordPress template hierarchy resource

The WordPress Template Hierarchy


Description

wphierarchy.com is a visualization of the WordPress theme template hierarchy.

Official documentation is located at: https://developer.wordpress.org/themes/basics/template-hierarchy.

https://wphierarchy.com

Credits

Installation

  • Requires gulp (npm install -g gulp)
  • git clone https://github.com/ramiabraham/wphierarchy.git
  • npm install

Contributing

  • Create an issue
  • Fork
  • Submit PR

API

WPHierarchy.com has a rest api available at https://wphierarchy.com/api.

The api contains the following data:

  • Stable version (the WordPress version currently supported by wphierarchy.com)

  • Stable link (a link to the relevant WordPress.org release post)

  • An array of objects in hierarchy_items, each structured as an array itself:

      ```
      array(
      	"object_id"      => "c1r1",
      	"semantic_id"    => "archive_page",
      	"name"           => "Archive Page",
      	"description"    => "",
      	"link"           => "https://codex.wordpress.org/Creating_an_Archive_Index#The_Archives_Page",
      	"classification" => "archive",
      	"tip"            => "",
      	"since"          => ""
      )
      ```
      So if you wish to get the names of all items, your request would be for:
      `data.hierarchy_items.name`
    

To-do:

  • Add links to the Codex for each item
  • Add color-coded legend below header
  • Add json api~~
  • Refactor with css that isn't completely insane (complete rewrite with scss)
  • Provide an easier means of l11n
  • Add contextual highlighting via the hierarchy_items.classification variable.
  • Add example loops, template files, and/or semantic data (coming soon; the parameter in the api which will contain this data is tips). An example of the small, desired strings for tips can be seen in the 4.5 embeds addition.
  • Create an easy-to-use submission process on the site for tips.
  • Finish cool secrets (if there are any, which there aren't).

Changelog:

v2, June 28, 2016

  • Introduce API, located at https://wphierarchy.com/api
  • Complete rewrite of the UI, using a single svg element and <foreignobject> nodes.
  • Some other secret things.
  • Specified license.

Licensing:

Code: MIT License

WordPress template hierarchy design: Copyright 2016, Michelle Schulp

Wapuu character, Dashicons: GPL, via the Japanese WordPress Community

The WordPress logo is a trademark of the WordPress Foundation. More info: http://wordpressfoundation.org/trademark-policy.