Skip to content

Commit 3ab8b24

Browse files
authored
Merge pull request #8 from udx/develop-alexey
Fix text domain initialization to prevent PHP notices
2 parents 3284f82 + 81cd474 commit 3ab8b24

File tree

5 files changed

+29
-22
lines changed

5 files changed

+29
-22
lines changed

changes.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1+
### 1.2.5
2+
3+
* Fix text domain initialization to prevent PHP notices.
4+
15
### 1.2.4
6+
27
* Require user to be logged in while dismissing Admin Panel notices.
38

49
### 1.2.3

gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Build Plugin.
33
*
44
* @author potanin@UD
5-
* @version 1.2.4
5+
* @version 1.2.5
66
* @param grunt
77
*/
88
module.exports = function( grunt ) {

lib/classes/class-admin.php

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -82,25 +82,27 @@ public function __construct( $args = array() ) {
8282
) ) );
8383

8484
//** Set available screens */
85-
$screens = array();
86-
if( $this->type == 'theme' ) {
87-
$screens =array_filter( array(
88-
'licenses' => __( 'License', $this->domain ),
89-
'more_products' => false,
90-
) );
91-
} elseif ( $this->type == 'plugin' ) {
92-
$screens =array_filter( array(
93-
'licenses' => __( 'Licenses', $this->domain ),
94-
'more_products' => __( 'More Products', $this->domain ),
95-
) );
96-
}
97-
98-
//** UI */
99-
$this->ui = new UI( array_merge( $args, array(
100-
'token' => $this->token,
101-
'screens' => $screens,
102-
) ) );
103-
85+
add_action('init', function () use ($args) {
86+
$screens = array();
87+
if( $this->type == 'theme' ) {
88+
$screens =array_filter( array(
89+
'licenses' => __( 'License', $this->domain ),
90+
'more_products' => false,
91+
) );
92+
} elseif ( $this->type == 'plugin' ) {
93+
$screens =array_filter( array(
94+
'licenses' => __( 'Licenses', $this->domain ),
95+
'more_products' => __( 'More Products', $this->domain ),
96+
) );
97+
}
98+
99+
// Initialize UI
100+
$this->ui = new UI( array_merge( $args, array(
101+
'token' => $this->token,
102+
'screens' => $screens,
103+
) ) );
104+
}, 20);
105+
104106
$path = wp_normalize_path( dirname( dirname( __DIR__ ) ) );
105107
$this->screens_path = trailingslashit( $path . '/static/templates' );
106108
if( $this->type == 'theme' && strpos( $path, wp_normalize_path( WP_PLUGIN_DIR ) ) === false ) {

lib/classes/class-bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Bootstrap extends Scaffold {
1818
/**
1919
*
2020
*/
21-
public static $version = '1.2.4';
21+
public static $version = '1.2.5';
2222

2323
/**
2424
*

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lib-ud-api-client",
3-
"version": "1.2.4",
3+
"version": "1.2.5",
44
"description": "UD Client for WooCommerce API Manager",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)