@@ -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
0 commit comments