-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f3e888
commit e279c1d
Showing
8 changed files
with
18,127 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace TodoApp; | ||
|
||
add_action('admin_menu', __NAMESPACE__ . '\\menu'); | ||
|
||
function menu() { | ||
add_menu_page( | ||
'Todo App', | ||
'Todo App', | ||
'manage_options', | ||
'todoapp', | ||
__NAMESPACE__ . '\\admin_page', | ||
); | ||
} | ||
|
||
function admin_page() { | ||
echo '<div id="todo-app"></div>'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace TodoApp; | ||
|
||
add_action('admin_enqueue_scripts', __NAMESPACE__ . '\\scripts'); | ||
|
||
function scripts() { | ||
$screen = get_current_screen(); | ||
|
||
if ($screen->id !== 'toplevel_page_todoapp') { | ||
return; | ||
} | ||
|
||
$admin_deps = require_once TODOAPP_PLUGIN_DIR_PATH . '/build/index.asset.php'; | ||
|
||
wp_enqueue_script( | ||
'todoapp', | ||
TODOAPP_PLUGIN_DIR_URL . 'build/index.js', | ||
$admin_deps['dependencies'], | ||
$admin_deps['version'], | ||
true | ||
); | ||
} |
Oops, something went wrong.