Skip to content

Commit a1153c8

Browse files
committed
Bumped version of jjgrainger/posttypes to ^2.0
1 parent 9d4d8a5 commit a1153c8

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Here are some ways that you can contribute:
3535
* Version checking (PHP, Carbon Fields)
3636
* Powered by [Composer](https://getcomposer.org/), [Gulp](https://gulpjs.com/) and [Bower](https://bower.io/)
3737
* Object caching (where available; [usage examples](https://github.com/dmhendricks/wordpress-toolkit/wiki/ObjectCache))
38+
* Easy installable ZIP file generation: `npm run zip`
3839
* Automatic translation file (`.pot`) creation. See [Translation](https://github.com/dmhendricks/wordpress-base-plugin/wiki/Translation).
3940
* Shortcodes, widgets (via [Carbon Fields](https://carbonfields.net)) and custom post types (via [PostTypes](https://github.com/jjgrainger/PostTypes/)) examples
4041
* Configuration registry ([docs](https://github.com/dmhendricks/wordpress-toolkit/wiki/ConfigRegistry)) and optional `wp-config.php` [constants](https://github.com/dmhendricks/wordpress-base-plugin/wiki/Configuration-&-Constants)
@@ -86,6 +87,7 @@ Release changes are noted on the [Releases](https://github.com/dmhendricks/wordp
8687
#### Branch: `master`
8788

8889
* Fixed non-static deprecation notice
90+
* Added support for before/after strings to prefix()
8991

9092
## Credits
9193

app/PostTypes/Clients.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ class Clients extends Plugin {
1010
public function __construct() {
1111

1212
// Sample Custom Post Type - Client
13-
//add_action( 'carbon_fields_loaded', array( $this, 'add_post_type_client' ) );
1413
$this->add_post_type_client();
1514

1615
// Hide unnecessary publishing options like Draft, visibility, etc.
@@ -49,10 +48,12 @@ public function add_post_type_client() {
4948
'slug' => 'client'
5049
), $options
5150
);
51+
5252
$cpt->icon('dashicons-star-filled');
53+
$cpt->register();
5354

5455
// Add fields
55-
Container::make( 'post_meta', __('Client Details', self::$textdomain ) )
56+
Container::make( 'post_meta', __( 'Client Details', self::$textdomain ) )
5657
->show_on_post_type( $cpt->name )
5758
->add_fields( array(
5859
Field::make( 'text', $this->prefix( 'name' ), __( 'Name', self::$textdomain ) ),
@@ -64,7 +65,8 @@ public function add_post_type_client() {
6465
->add_fields( array(
6566
Field::make( 'text', $this->prefix( 'url' ), __( 'Web Site', self::$textdomain ) ),
6667
Field::make( 'text', $this->prefix( 'phone' ), __( 'Phone Number', self::$textdomain ) ),
67-
Field::make( 'textarea', $this->prefix( 'address' ), __( 'Address', self::$textdomain ) )->set_rows( 4 )
68+
Field::make( 'textarea', $this->prefix( 'address' ), __( 'Address', self::$textdomain ) )
69+
->set_rows( 4 )
6870
)
6971
);
7072

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
"require": {
2222
"php": ">=5.6.0",
23-
"jjgrainger/posttypes": "dev-master",
23+
"jjgrainger/posttypes": "^2.0",
2424
"tgmpa/tgm-plugin-activation": "^2.6.1",
2525
"tareq1988/wordpress-settings-api-class": "dev-master",
2626
"dmhendricks/wordpress-toolkit": "dev-master",

0 commit comments

Comments
 (0)