File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed
Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 66class Category extends WPTerm
77{
88 public const TAXONOMY = 'category ' ;
9+
10+ public function posts ()
11+ {
12+ return $ this ->belongsToPost (Post::class);
13+ }
914}
Original file line number Diff line number Diff line change @@ -9,11 +9,11 @@ class Post extends WPPost
99
1010 public function categories ()
1111 {
12- return $ this ->belongsToTaxonomy (Category::class, ' category ' );
12+ return $ this ->belongsToTaxonomy (Category::class, Category:: TAXONOMY );
1313 }
1414
1515 public function tags ()
1616 {
17- return $ this ->belongsToTaxonomy (Tag::class, ' post_tag ' );
17+ return $ this ->belongsToTaxonomy (Tag::class, Tag:: TAXONOMY );
1818 }
1919}
Original file line number Diff line number Diff line change 66class Tag extends WPTerm
77{
88 public const TAXONOMY = 'post_tag ' ;
9+
10+ public function posts ()
11+ {
12+ return $ this ->belongsToPost (Post::class);
13+ }
914}
You can’t perform that action at this time.
0 commit comments