Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ build

/vendor/
*.tsbuildinfo
.phpunit.result.cache
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Yes, scheduling can be enabled for any taxonomy that is shown in the admin UI (`
### Unreleased
* Tested WordPress 7.0.
* Drop support for PHP 8.1.
* Renamed the internal PHP namespace from `HAMWORKS\WP\Schedule_Terms` to `Torounit\WP\Schedule_Terms` (old class names are aliased for backward compatibility and will be removed in a future major release).

### 1.3.0
* Tested WordPress 6.5.
Expand Down
9 changes: 6 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@
},
"autoload": {
"psr-4": {
"HAMWORKS\\WP\\Schedule_Terms\\": "./includes",
"HAMWORKS\\WP\\Schedule_Terms\\Tests\\": "./tests/php"
}
"Torounit\\WP\\Schedule_Terms\\": "./includes",
"Torounit\\WP\\Schedule_Terms\\Tests\\": "./tests/php"
},
"files": [
"includes/compat.php"
]
},
"scripts": {
"test": "phpunit",
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion includes/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @package Schedule_Terms
*/

namespace HAMWORKS\WP\Schedule_Terms;
namespace Torounit\WP\Schedule_Terms;

/**
* Class used to register style and js.
Expand Down
2 changes: 1 addition & 1 deletion includes/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @package Schedule_Terms
*/

namespace HAMWORKS\WP\Schedule_Terms;
namespace Torounit\WP\Schedule_Terms;

/**
* Plugin base class.
Expand Down
2 changes: 1 addition & 1 deletion includes/Post_Meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @package Schedule_Terms
*/

namespace HAMWORKS\WP\Schedule_Terms;
namespace Torounit\WP\Schedule_Terms;

/**
* Register post meta.
Expand Down
2 changes: 1 addition & 1 deletion includes/Schedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @package Schedule_Terms
*/

namespace HAMWORKS\WP\Schedule_Terms;
namespace Torounit\WP\Schedule_Terms;

use WP_Term;

Expand Down
2 changes: 1 addition & 1 deletion includes/Term/UI.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @see https://github.com/JJJ/wp-term-meta-ui/blob/master/class-wp-term-meta-ui.php
*/

namespace HAMWORKS\WP\Schedule_Terms\Term;
namespace Torounit\WP\Schedule_Terms\Term;

use WP_Taxonomy;
use WP_Term;
Expand Down
2 changes: 1 addition & 1 deletion includes/Term_Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @package Schedule_Terms
*/

namespace HAMWORKS\WP\Schedule_Terms;
namespace Torounit\WP\Schedule_Terms;

use WP_Term;

Expand Down
2 changes: 1 addition & 1 deletion includes/Term_Meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @package Schedule_Terms
*/

namespace HAMWORKS\WP\Schedule_Terms;
namespace Torounit\WP\Schedule_Terms;

/**
* Term Meta class.
Expand Down
4 changes: 2 additions & 2 deletions includes/Term_UI.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* @package Schedule_Terms
*/

namespace HAMWORKS\WP\Schedule_Terms;
namespace Torounit\WP\Schedule_Terms;

use HAMWORKS\WP\Schedule_Terms\Term\UI;
use Torounit\WP\Schedule_Terms\Term\UI;

/**
* Term meta UI controller.
Expand Down
29 changes: 29 additions & 0 deletions includes/compat.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php
/**
* Backward-compatible class aliases for the deprecated
* HAMWORKS\WP\Schedule_Terms namespace.
*
* TODO: remove this file and the "files" autoload entry in a future
* major release once the old namespace is no longer supported.
*
* @package Schedule_Terms
*/

( function () {
$map = array(
'HAMWORKS\\WP\\Schedule_Terms\\Assets' => 'Torounit\\WP\\Schedule_Terms\\Assets',
'HAMWORKS\\WP\\Schedule_Terms\\Plugin' => 'Torounit\\WP\\Schedule_Terms\\Plugin',
'HAMWORKS\\WP\\Schedule_Terms\\Post_Meta' => 'Torounit\\WP\\Schedule_Terms\\Post_Meta',
'HAMWORKS\\WP\\Schedule_Terms\\Schedule' => 'Torounit\\WP\\Schedule_Terms\\Schedule',
'HAMWORKS\\WP\\Schedule_Terms\\Term_Manager' => 'Torounit\\WP\\Schedule_Terms\\Term_Manager',
'HAMWORKS\\WP\\Schedule_Terms\\Term_Meta' => 'Torounit\\WP\\Schedule_Terms\\Term_Meta',
'HAMWORKS\\WP\\Schedule_Terms\\Term_UI' => 'Torounit\\WP\\Schedule_Terms\\Term_UI',
'HAMWORKS\\WP\\Schedule_Terms\\Term\\UI' => 'Torounit\\WP\\Schedule_Terms\\Term\\UI',
);

foreach ( $map as $old_class => $new_class ) {
if ( ! class_exists( $old_class ) && class_exists( $new_class ) ) {
class_alias( $new_class, $old_class );
}
}
Comment thread
torounit marked this conversation as resolved.
} )();
2 changes: 1 addition & 1 deletion schedule-terms.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @package Schedule_Terms
*/

use HAMWORKS\WP\Schedule_Terms\Plugin;
use Torounit\WP\Schedule_Terms\Plugin;

require_once __DIR__ . '/vendor/autoload.php';

Expand Down
4 changes: 2 additions & 2 deletions tests/php/Schedule_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* @package Schedule_Terms
*/

namespace HAMWORKS\WP\Schedule_Terms\Tests;
namespace Torounit\WP\Schedule_Terms\Tests;

use HAMWORKS\WP\Schedule_Terms\Schedule;
use Torounit\WP\Schedule_Terms\Schedule;
use WP_UnitTestCase;

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/php/Term_Manager_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* @package Schedule_Terms
*/

namespace HAMWORKS\WP\Schedule_Terms\Tests;
namespace Torounit\WP\Schedule_Terms\Tests;

use HAMWORKS\WP\Schedule_Terms\Term_Manager;
use Torounit\WP\Schedule_Terms\Term_Manager;
use WP_UnitTestCase;

/**
Expand Down
Loading