Skip to content

Commit c5a59c4

Browse files
committed
Initializes at init so that just in time translations dont run too early (since WP 6.7)
1 parent 325c46d commit c5a59c4

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

languages/wpgpt.pot

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# Copyright (C) 2023 Dreamsicle
1+
# Copyright (C) 2025 Dreamsicle
22
# This file is distributed under the UNLICENSED.
33
msgid ""
44
msgstr ""
5-
"Project-Id-Version: WPGPT 0.3.1\n"
5+
"Project-Id-Version: WPGPT 0.4.0\n"
66
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wpgpt\n"
77
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
88
"Language-Team: LANGUAGE <LL@li.org>\n"
99
"MIME-Version: 1.0\n"
1010
"Content-Type: text/plain; charset=UTF-8\n"
1111
"Content-Transfer-Encoding: 8bit\n"
12-
"POT-Creation-Date: 2023-04-01T23:47:40+00:00\n"
12+
"POT-Creation-Date: 2025-05-08T04:46:21+00:00\n"
1313
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1414
"X-Generator: WP-CLI 2.7.1\n"
1515
"X-Domain: wpgpt\n"

wpgpt.php

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: WPGPT
44
* Plugin URI: https://github.com/dreamsicle-io/wpgpt/
55
* Description: An experimental plugin integrating ChatGPT with WordPress.
6-
* Version: 0.3.1
6+
* Version: 0.4.0
77
* Requires at least: 6.0.0
88
* Requires PHP: 8.1.0
99
* Author: Dreamsicle
@@ -29,8 +29,17 @@
2929
require WPGPT_PATH . '/includes/class-wpgpt-caption-generator.php';
3030
require WPGPT_PATH . '/includes/class-wpgpt-utils.php';
3131

32-
add_action( 'plugins_loaded', array( new WPGPT_API(), 'init' ), 10 );
33-
add_action( 'plugins_loaded', array( new WPGPT_Settings(), 'init' ), 10 );
34-
add_action( 'plugins_loaded', array( new WPGPT_Post_Generator(), 'init' ), 10 );
35-
add_action( 'plugins_loaded', array( new WPGPT_Elaborator(), 'init' ), 10 );
36-
add_action( 'plugins_loaded', array( new WPGPT_Caption_Generator(), 'init' ), 10 );
32+
/**
33+
* Initialize
34+
*
35+
* @since 0.4.0
36+
*/
37+
function wpgpt_init() {
38+
add_action( 'init', array( new WPGPT_API(), 'init' ), 10 );
39+
add_action( 'init', array( new WPGPT_Settings(), 'init' ), 10 );
40+
add_action( 'init', array( new WPGPT_Post_Generator(), 'init' ), 10 );
41+
add_action( 'init', array( new WPGPT_Elaborator(), 'init' ), 10 );
42+
add_action( 'init', array( new WPGPT_Caption_Generator(), 'init' ), 10 );
43+
}
44+
45+
add_action( 'init', 'wpgpt_init', 0 );

0 commit comments

Comments
 (0)