Skip to content

mthaichi/bf-auto-writer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

d8477a2 · Apr 15, 2023

History

28 Commits
Apr 7, 2023
Apr 15, 2023
Apr 6, 2023
Apr 15, 2023
Jan 31, 2022
Apr 7, 2023
Jan 31, 2022
Jan 31, 2022
Apr 7, 2023
Apr 15, 2023
Apr 15, 2023
Apr 7, 2023
Apr 15, 2023
Apr 6, 2023
Apr 6, 2023
Apr 15, 2023
Apr 6, 2023

Repository files navigation

vk-sample-blocks-plugin

社内勉強会用。複数のブロックを持つプラグインの設計について考える

環境構築

$ npm install
$ npm run build

ディレクトリ構成

  • /build ... ビルドで生成
  • /inc ... 実装するPHPコード
  • /lib ... 汎用的に使えるクラス群
  • /src ... ブロック毎のJS

コーディングの時に気をつけること。

  • コンストラクタに Wordpress関数をかかない。インスタンス化してもWordPressとは接続しない。(ユニットテストしやすくなるらしい)
  • add_filteradd_action などのフックは register() というメソッドから呼び出す。
  • グローバル関数は極力使わない。たとえばBlock内からプラグインのバージョンを調べるには、$this->plugin->get_version(); でいける。

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published