Skip to content

Commit

Permalink
Merge pull request #109 from mgroensmit/main
Browse files Browse the repository at this point in the history
Update IndexBlogUrls.php
  • Loading branch information
mgroensmit committed Jan 19, 2023
2 parents 7593445 + 902959a commit bb8a974
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Fixed
- Fix second parameter non-default error for Mooore\WordpressIntegrationCms\Cron\IndexBlogUrls::createUrl()

## [0.10.9] - 2023-01-11
### Fixed
Expand Down
6 changes: 5 additions & 1 deletion Cron/IndexBlogUrls.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,12 @@ public function createRewriteRules($siteId, $postId, $entityId, $slug)
return $rewrites;
}

public function createUrl($prefix = '', $slug)
public function createUrl($prefix = '', $slug = '')
{
if (empty($slug)) {
throw new \InvalidArgumentException('Slug can not be empty');
}

$prefix = ltrim($prefix, '/'); // Remove trailing slash

return "$prefix/$slug";
Expand Down

0 comments on commit bb8a974

Please sign in to comment.