Skip to content

Commit

Permalink
Adding missing $leaveName argument for permalinks
Browse files Browse the repository at this point in the history
  • Loading branch information
rasmuswinter committed Aug 10, 2017
1 parent f5269d8 commit 1c0e537
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "A plugin for WordPress that makes post types easier to manage",
"minimum-stability": "stable",
"license": "GPL-3.0",
"version": "2.0.6",
"version": "2.0.7",
"autoload": {
"psr-4": {
"Outlandish\\Wordpress\\Oowp\\": "src/"
Expand Down
4 changes: 2 additions & 2 deletions src/PostTypes/FakePost.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ public function __construct($args = array()) {
parent::__construct($postArray);
}

public function permalink() {
public function permalink($leaveName = false) {
if (!empty($this->permalink)) {
return $this->permalink;
}
return parent::permalink();
return parent::permalink($leaveName);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/PostTypes/WordpressPost.php
Original file line number Diff line number Diff line change
Expand Up @@ -498,11 +498,11 @@ function excerpt($chars = 400, $stuff = null) {
return ($excerpt);
}

public function permalink() {
public function permalink($leaveName = false) {
if ($this->isHomepage()) {
return rtrim(get_bloginfo('url'), '/') . '/';
}
return get_permalink($this->ID);
return get_permalink($this->ID, $leaveName);
}

/**
Expand Down

0 comments on commit 1c0e537

Please sign in to comment.