Skip to content

Commit bd18074

Browse files
committed
Add interfaces for PostMeta and TermMeta to allow using legacy classes for term meta UI
1 parent 8abe835 commit bd18074

File tree

10 files changed

+47
-10
lines changed

10 files changed

+47
-10
lines changed

src/Contracts/PostMeta.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
/**
3+
* PostMeta class.
4+
*
5+
* @since 0.3.3
6+
*/
7+
8+
namespace Required\Common\Contracts;
9+
10+
/**
11+
* Class used to implement post meta.
12+
*
13+
* @since 0.3.3
14+
*/
15+
interface PostMeta {
16+
}

src/Contracts/Taxonomy.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@
1313
* @since 0.3.2
1414
*/
1515
interface Taxonomy {
16-
1716
}

src/Contracts/TermMeta.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
/**
3+
* TermMeta class.
4+
*
5+
* @since 0.3.3
6+
*/
7+
8+
namespace Required\Common\Contracts;
9+
10+
/**
11+
* Class used to implement term meta.
12+
*
13+
* @since 0.3.3
14+
*/
15+
interface TermMeta {
16+
}

src/Legacy/PostMeta.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@
99

1010
namespace Required\Common\Legacy;
1111

12+
use Required\Common\Contracts\PostMeta as PostMetaInterface;
1213
use Required\Common\Contracts\Registrable;
1314

1415
/**
1516
* Class used to implement post meta.
1617
*
1718
* @since 0.1.0
1819
*/
19-
abstract class PostMeta implements Registrable {
20+
abstract class PostMeta implements Registrable, PostMetaInterface {
2021

2122
/**
2223
* Post meta key.

src/Legacy/TermMeta.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@
1010
namespace Required\Common\Legacy;
1111

1212
use Required\Common\Contracts\Registrable;
13+
use Required\Common\Contracts\TermMeta as TermMetaInterface;
1314

1415
/**
1516
* Class used to implement term meta.
1617
*
1718
* @since 0.1.0
1819
*/
19-
abstract class TermMeta implements Registrable {
20+
abstract class TermMeta implements Registrable, TermMetaInterface {
2021

2122
/**
2223
* Term meta key.

src/PostMeta.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@
1010
namespace Required\Common;
1111

1212
use Required\Common\Args\PostMeta as PostMetaArgs;
13+
use Required\Common\Contracts\PostMeta as PostMetaInterface;
1314
use Required\Common\Contracts\Registrable;
1415

1516
/**
1617
* Class used to implement post meta.
1718
*
1819
* @since 0.1.0
1920
*/
20-
abstract class PostMeta implements Registrable {
21+
abstract class PostMeta implements Registrable, PostMetaInterface {
2122

2223
/**
2324
* Post meta key.

src/PostType.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@
1010
namespace Required\Common;
1111

1212
use Required\Common\Args\PostType as PostTypeArgs;
13+
use Required\Common\Contracts\PostType as PostTypeInterface;
1314
use Required\Common\Contracts\Registrable;
1415

1516
/**
1617
* Class used to implement custom post types.
1718
*
1819
* @since 0.1.0
1920
*/
20-
abstract class PostType implements Registrable {
21+
abstract class PostType implements Registrable, PostTypeInterface {
2122

2223
public const NAME = 'post';
2324

src/Taxonomy.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111

1212
use Required\Common\Args\Taxonomy as TaxonomyArgs;
1313
use Required\Common\Contracts\Registrable;
14+
use Required\Common\Contracts\Taxonomy as TaxonomyInterface;
1415

1516
/**
1617
* Class used to implement custom taxonomies.
1718
*
1819
* @since 0.1.0
1920
*/
20-
abstract class Taxonomy implements Registrable {
21+
abstract class Taxonomy implements Registrable, TaxonomyInterface {
2122

2223
public const NAME = 'category';
2324

src/TermMeta.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111

1212
use Required\Common\Args\TermMeta as TermMetaArgs;
1313
use Required\Common\Contracts\Registrable;
14+
use Required\Common\Contracts\TermMeta as TermMetaInterface;
1415

1516
/**
1617
* Class used to implement term meta.
1718
*
1819
* @since 0.1.0
1920
*/
20-
abstract class TermMeta implements Registrable {
21+
abstract class TermMeta implements Registrable, TermMetaInterface {
2122

2223
/**
2324
* Term meta key.

src/TermMetaAdminUI.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ abstract class TermMetaAdminUI implements Registrable {
2121
/**
2222
* The taxonomy.
2323
*
24-
* @var \Required\Common\Taxonomy
24+
* @var \Required\Common\Contracts\Taxonomy
2525
*/
2626
protected $taxonomy;
2727

2828
/**
2929
* The term meta.
3030
*
31-
* @var \Required\Common\TermMeta
31+
* @var \Required\Common\Contracts\TermMeta
3232
*/
3333
protected $term_meta;
3434

@@ -38,7 +38,7 @@ abstract class TermMetaAdminUI implements Registrable {
3838
* @since 0.1.0
3939
*
4040
* @param \Required\Common\Contracts\Taxonomy $taxonomy The taxonomy.
41-
* @param \Required\Common\TermMeta $term_meta The term meta.
41+
* @param \Required\Common\Contracts\TermMeta $term_meta The term meta.
4242
*/
4343
public function __construct( Taxonomy $taxonomy, TermMeta $term_meta ) {
4444
$this->taxonomy = $taxonomy;

0 commit comments

Comments
 (0)