Skip to content

Commit cdcafc3

Browse files
committed
feat: rewrite userId
1 parent 5a6f8df commit cdcafc3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

inc/classes/Admin/CPT.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ public function save_metabox( $post_id, $post ) { // phpcs:ignore
274274
*
275275
* @param string $template Template.
276276
*/
277-
public function load_custom_template( $template ) {
277+
public function load_custom_template( $template ):string {
278278
$repor_template_path = Plugin::$dir . '/inc/templates/' . $this->rewrite['template_path'];
279279

280280
if ( \get_query_var( $this->rewrite['var'] ) ) {

inc/classes/Bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public static function enqueue_script(): void {
7979
'env' => [
8080
'siteUrl' => \untrailingslashit( \site_url() ),
8181
'ajaxUrl' => \untrailingslashit( \admin_url( 'admin-ajax.php' ) ),
82-
'userId' => \wp_get_current_user()->data->ID ?? null,
82+
'userId' => \get_current_user_id(),
8383
'postId' => $post_id,
8484
'APP_NAME' => Plugin::$app_name,
8585
'KEBAB' => Plugin::$kebab,

0 commit comments

Comments
 (0)