Skip to content

Commit

Permalink
Merge pull request #3 from RRZE-Webteam/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
rvdforst authored Nov 17, 2022
2 parents 0c3d92b + ffe5948 commit 984aaf7
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 4 deletions.
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
### vscode ###
.vscode/
### NetBeans ###
**/nbproject/
### PhpStorm ###
.idea/
### macOS ###
.DS_Store
### Node ###
node_modules/
### Tmp ###
_tmp/
6 changes: 6 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "rrze/wp",
"description": "A general purpose library for WordPress.",
"version": "1.0.0",
"type": "library",
"keywords": [
"wordpress"
Expand All @@ -12,6 +13,11 @@
"name": "Rolf v. d. Forst",
"email": "[email protected]",
"homepage": "https://www.rrze.fau.de"
},
{
"name": "Benjamin Klemencic",
"email": "[email protected]",
"homepage": "https://www.rrze.fau.de"
}
],
"require": {
Expand Down
6 changes: 3 additions & 3 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function setDirectory(): object
*/
public function getPath(string $path = ''): string
{
return $this->directory . ltrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
return $this->directory . ($path ? trim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR : '');
}

/**
Expand All @@ -127,7 +127,7 @@ public function getPath(string $path = ''): string
*/
public function getUrl(string $path = ''): string
{
return $this->url . ltrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
return $this->url . ($path ? trim($path, '/') . '/' : '');
}

/**
Expand All @@ -137,7 +137,7 @@ public function getUrl(string $path = ''): string
*/
public function setUrl(): object
{
$this->url = rtrim(plugin_dir_url($this->pluginFile), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
$this->url = rtrim(plugin_dir_url($this->pluginFile), '/') . '/';
return $this;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Helper.php → src/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

defined('ABSPATH') || exit;

class Helper
class Utils
{
public static function debug($input, string $level = 'i')
{
Expand Down
13 changes: 13 additions & 0 deletions src/languages/rrze-wp.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2022-11-17T09:13:39+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.7.1\n"
"X-Domain: rrze-wp\n"

0 comments on commit 984aaf7

Please sign in to comment.