Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions app/public/wp-content/plugins/wp10-midlevel1/wp10-midlevel1.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php
/**
* Plugin Name: Test1
* Description: カリキュラム用プラグインです
* Version: 1.0.0
* Requires at least: 5.5.1
* Requires PHP: 7.2
* Author: Ei Thandar Aung
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

// ①
if ( ! defined( 'ABSPATH' ) ) {
exit;
}

class My_Test1 {
// ②
private static $instance;

public static function get_instance() {
if ( ! isset( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}

public function __construct() {

add_action( 'my_page', array( $this, 'add_my_page' ), 10 );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my_pageというhookは存在していますか?
このpluginは動作していますか? @EiThandarAung-pressman

}

// ④
public function add_my_page() {
add_my_page(
__( 'Test1 Page', '' ),
__( "Test1 Page", '' ),
'administrator',
'my_test1',
array( $this, 'view_test1_page' ),
);
}
public function view_test1_page() {
//please create alert box

?>
<script>alert("Hello World");</script>
<h1>Test1 Page</h1>
<p>This is test page.</p>
<?php
}
}
My_Test1::get_instance();
1 change: 1 addition & 0 deletions curriculum_for_ei
Submodule curriculum_for_ei added at d44332