Skip to content

Commit

Permalink
Lint php.
Browse files Browse the repository at this point in the history
  • Loading branch information
jffng committed Mar 28, 2023
1 parent ebdf773 commit 4870efb
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions admin/class-create-block-theme-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ class Create_Block_Theme_Admin {
public function __construct() {
add_action( 'admin_menu', array( $this, 'create_admin_menu' ) );
add_action( 'admin_init', array( $this, 'blockbase_save_theme' ) );
add_action( 'enqueue_block_editor_assets', array( $this, 'create_block_theme_enqueue' ));
add_action( 'rest_api_init', array( $this, 'register_theme_export' ));
add_action( 'enqueue_block_editor_assets', array( $this, 'create_block_theme_enqueue' ) );
add_action( 'rest_api_init', array( $this, 'register_theme_export' ) );
}

function create_block_theme_enqueue() {
$asset_file = include( plugin_dir_path( dirname( __FILE__ ) ) . 'build/editor.asset.php');
$asset_file = include( plugin_dir_path( dirname( __FILE__ ) ) . 'build/editor.asset.php' );

wp_register_script(
'create-block-theme-slot-fill',
plugins_url( 'build/editor.js', dirname( __FILE__ ) ),
Expand Down Expand Up @@ -210,18 +210,22 @@ function clone_theme( $theme, $screenshot ) {

function rest_export_theme( $request ) {
$theme = $request->get_params();
$this->clone_theme($theme, null);
$this->clone_theme( $theme, null );
}

public function register_theme_export() {
register_rest_route('create-block-theme/v1', '/export', array(
'methods' => 'POST',
'callback' => array( $this, 'rest_export_theme' ),
'permission_callback' => function () {
return true;
// return current_user_can( 'edit_theme_options' );
}
));
register_rest_route(
'create-block-theme/v1',
'/export',
array(
'methods' => 'POST',
'callback' => array( $this, 'rest_export_theme' ),
'permission_callback' => function () {
return true;
// return current_user_can( 'edit_theme_options' );
},
)
);
}

/**
Expand Down

0 comments on commit 4870efb

Please sign in to comment.