Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
* develop:
  1.0.4
  Docs: Update change log and file-level DocBlocks
  Add Composer support
  • Loading branch information
GaryJones committed Jan 16, 2018
2 parents 5a30eb0 + 4e5ff87 commit aca9d8a
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 26 deletions.
36 changes: 23 additions & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,41 @@
# Change Log for Gamajo Dashboard Glancer

All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]

_No changes._
## [1.0.4] - 2018-01-16
### Added
- Composer support.
- Registered on Packagist: `https://packagist.org/packages/gamajo/dashboard-glancer`.

### Changed
- Moved repo from `https://github.com/GaryJones/Gamajo-Dashboard-Glancer` to `https://github.com/gamajo/dashboard-glancer`.

## [1.0.3] - 2016-07-31
### Added
- Dashicons support.

- Added support for dashicons.
- Fixed incorrect link in change log.
### Fixed
- Incorrect link in change log.

## [1.0.2] - 2015-08-12

- Fix regression in 1.0.1 for labels.
### Fixed
- Regression in 1.0.1 for labels.

## [1.0.1] - 2015-08-12

- Added PHP 7 compatibility.
### Added
- PHP 7 compatibility.
- Documentation and code standards.

## 1.0.0 - 2014-02-17

### Added
- Initial release.

[Unreleased]: https://github.com/GaryJones/Gamajo-Dashboard-Glancer/compare/1.0.3...HEAD
[1.0.3]: https://github.com/GaryJones/Gamajo-Dashboard-Glancer/compare/1.0.2...1.0.3
[1.0.2]: https://github.com/GaryJones/Gamajo-Dashboard-Glancer/compare/1.0.1...1.0.2
[1.0.1]: https://github.com/GaryJones/Gamajo-Dashboard-Glancer/compare/1.0.0...1.0.1
[Unreleased]: https://github.com/gamajo/dashboard-glancer/compare/1.0.4...HEAD
[1.0.4]: https://github.com/gamajo/dashboard-glancer/compare/1.0.3...1.0.4
[1.0.3]: https://github.com/gamajo/dashboard-glancer/compare/1.0.2...1.0.3
[1.0.2]: https://github.com/gamajo/dashboard-glancer/compare/1.0.1...1.0.2
[1.0.1]: https://github.com/gamajo/dashboard-glancer/compare/1.0.0...1.0.1
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ A class to copy into your WordPress plugin, to make adding custom post type coun

WordPress 3.8 introduced the _At a Glance_ dashboard widget, as a replacement for the _Right Now_ widget. The new widget contains an action hook, `dashboard_glance_items`, which allows developers to insert extra list items into the widget. Although grabbing the number of entries of a certain post type, and maybe a specific status within that post type, and displaying within markup is not tricky, it can't be done as minimally as what this class allows. Add in the desire for wanting to include counts for multiple post types, or multiple statuses, and this class comes into its own. See the Usage section for how simple the code is.

## Installation and Usage
## Installation

This isn't a WordPress plugin on its own, so the usual instructions don't apply. Instead:

### Manually install class

1. Copy [`class-gamajo-dashboard-glancer.php`](class-gamajo-dashboard-glancer.php) into your plugin. It can be into a file in the plugin root, or better, an `includes` directory.
2. Ensure the class file is available to whichever code will be using it.

Expand All @@ -22,6 +24,13 @@ This isn't a WordPress plugin on its own, so the usual instructions don't apply.
}
~~~

or:

### Install class via Composer
1. Tell Composer to install this class as a dependency: `composer require gamajo/dashboard-glancer`
2. Recommended: Install the Mozart package: `composer require coenjacobs/mozart --dev` and [configure it](https://github.com/coenjacobs/mozart#configuration).
3. The class is now renamed to use your own prefix, to prevent collisions with other plugins bundling this class.

## Usage

Within your plugin files, either as a function, or as part of a class, implement something like:
Expand Down
12 changes: 6 additions & 6 deletions class-gamajo-dashboard-glancer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
/**
* Gamajo Dashboard Glancer
*
* @package Gamajo_Dashboard_Glancer
* @package Gamajo\DashboardGlancer
* @author Gary Jones
* @link http://gamajo.com/dashboard-glancer
* @copyright 2013 Gary Jones, Gamajo Tech
* @license GPL-2.0+
* @version 1.0.3
* @link https://github.com/gamajo/dashboard-glancer
* @copyright 2013 Gary Jones, Gamajo
* @license GPL-2.0-or-later
* @version 1.0.4
*/

/**
* Easily add items to the At a Glance Dashboard widget in WordPress 3.8+.
*
* @package Gamajo_Dashboard_Glancer
* @package Gamajo\DashboardGlancer
* @author Gary Jones
*/
class Gamajo_Dashboard_Glancer {
Expand Down
12 changes: 6 additions & 6 deletions class-gamajo-dashboard-rightnow.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
/**
* Gamajo Dashboard Glancer, for WP 3.7 and earlier.
*
* @package Gamajo_Dashboard_Glancer
* @package Gamajo\DashboardGlancer
* @author Gary Jones
* @link http://gamajo.com/dashboard-glancer
* @copyright 2013 Gary Jones, Gamajo Tech
* @license GPL-2.0+
* @version 1.0.2
* @link https://github.com/gamajo/dashboard-glancer
* @copyright 2013 Gary Jones, Gamajo
* @license GPL-2.0-or-later
* @version 1.0.4
*/

/**
* Easily add items to the Right Now Dashboard widget in WordPress 3.7-.
*
* @package Gamajo_Dashboard_Glancer
* @package Gamajo\DashboardGlancer
* @author Gary Jones
*/
class Gamajo_Dashboard_RightNow extends Gamajo_Dashboard_Glancer {
Expand Down
26 changes: 26 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "gamajo/dashboard-glancer",
"description": "A class for your WordPress plugin, to make adding custom post type counts to the At a Glance dashboard widget considerably easier.",
"keywords": ["wordpress", "templates"],
"homepage": "https://github.com/GaryJones/Gamajo-Dashboard-Glancer",
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "Gary Jones",
"homepage": "https://gamajo.com",
"role": "Developer"
}
],
"support": {
"issues": "https://github.com/GaryJones/Gamajo-Dashboard-Glancer/issues"
},
"require": {
"php": ">=5.2.4"
},
"autoload": {
"classmap": ["class-gamajo-dashboard-glancer.php", "class-gamajo-dashboard-rightnow.php"]
},
"suggest": {
"coenjacobs/mozart": "Easily wrap this library with your own prefix, to prevent collisions when multiple plugins use this library"
}
}

0 comments on commit aca9d8a

Please sign in to comment.