diff --git a/format-api/.eslintrc b/format-api/.eslintrc new file mode 100644 index 00000000..371f02e3 --- /dev/null +++ b/format-api/.eslintrc @@ -0,0 +1,3 @@ +{ + "extends": [ "plugin:@wordpress/eslint-plugin/recommended" ] +} diff --git a/format-api/index.php b/format-api/index.php new file mode 100644 index 00000000..4a0419cc --- /dev/null +++ b/format-api/index.php @@ -0,0 +1,36 @@ + { + return ( + { + onChange( + toggleFormat(value, { + type: "my-custom-format/sample-output", + }) + ); + } } + isActive={ isActive } + /> + ); +}; + +registerFormatType( "my-custom-format/sample-output", { + title: __( "Sample output" ), + tagName: "samp", + className: null, + edit: MyCustomButton, +} ); diff --git a/index.php b/index.php index 1027dd7b..0874d357 100644 --- a/index.php +++ b/index.php @@ -24,3 +24,4 @@ include '06-inner-blocks/index.php'; include '06-inner-blocks-esnext/index.php'; include '07-slotfills-esnext/index.php'; +include 'format-api/index.php';