https://github.com/gedex/wphd
The wphd package allows Go programs to retrieve header data from plugin and theme file headers.
https://github.com/gedex/wphd
Last synced: 5 days ago
JSON representation
The wphd package allows Go programs to retrieve header data from plugin and theme file headers.
- Host: GitHub
- URL: https://github.com/gedex/wphd
- Owner: gedex
- License: bsd-3-clause
- Created: 2016-10-23T00:04:02.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-10-23T00:49:08.000Z (almost 10 years ago)
- Last Synced: 2026-03-29T16:13:36.482Z (4 months ago)
- Language: Go
- Size: 6.84 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
wphd
====
> WordPress [Header Data](https://codex.wordpress.org/File_Header) parser.
The wphd package allows Go programs to retrieve header data from plugin and
theme file headers.
[](https://travis-ci.org/gedex/wphd)
[](https://coveralls.io/r/gedex/wphd?branch=master)
[](https://godoc.org/github.com/gedex/wphd)
## Example
~~~go
package main
import (
"fmt"
"github.com/gedex/wphd"
)
func main() {
in := `Hello, Dolly in the upper right of your admin screen on every page.
Author: Matt Mullenweg
Version: 1.6
Author URI: http://ma.tt/
*/`
p := wphd.GetPluginData([]byte(in))
fmt.Printf("%+v\n", p)
// Output:
// &{Name:Hello Dolly PluginURI:https://wordpress.org/plugins/hello-dolly/ Version:1.6 Description:This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong: Hello, Dolly. When activated you will randomly see a lyric from Hello, Dolly in the upper right of your admin screen on every page. Author:Matt Mullenweg AuthorURI:http://ma.tt/ TextDomain: DomainPath: Network:false License: LicenseURI:}
}
~~~
## Known Limitations
* Return the raw value for each field
* No translation for each field
* Markup is not applied for each field
* Extra fields are not considered