Version Description
Download this release
Release Info
Developer | addiestavlo |
Plugin | Full Site Editing |
Version | 3.14565 |
Comparing to | |
See all releases |
Code changes from version 3.14546 to 3.14565
- full-site-editing-plugin.php +11 -2
- readme.txt +1 -1
- wpcom-site-editor/dist/wpcom-site-editor.asset.php +1 -0
- wpcom-site-editor/dist/wpcom-site-editor.css +1 -0
- wpcom-site-editor/dist/wpcom-site-editor.js +1 -0
- wpcom-site-editor/dist/wpcom-site-editor.rtl.css +1 -0
- wpcom-site-editor/index.js +1 -0
- wpcom-site-editor/index.php +34 -0
- wpcom-site-editor/navigation-toggle/index.js +54 -0
- wpcom-site-editor/navigation-toggle/style.scss +3 -0
full-site-editing-plugin.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Plugin Name: WordPress.com Editing Toolkit
|
4 |
* Description: Enhances your page creation workflow within the Block Editor.
|
5 |
-
* Version: 3.
|
6 |
* Author: Automattic
|
7 |
* Author URI: https://automattic.com/wordpress-plugins/
|
8 |
* License: GPLv2 or later
|
@@ -42,7 +42,7 @@ namespace A8C\FSE;
|
|
42 |
*
|
43 |
* @var string
|
44 |
*/
|
45 |
-
define( 'A8C_ETK_PLUGIN_VERSION', '3.
|
46 |
|
47 |
// Always include these helper files for dotcom FSE.
|
48 |
require_once __DIR__ . '/dotcom-fse/helpers.php';
|
@@ -340,3 +340,12 @@ function load_tags_education() {
|
|
340 |
require_once __DIR__ . '/tags-education/class-tags-education.php';
|
341 |
}
|
342 |
add_action( 'plugins_loaded', __NAMESPACE__ . '\load_tags_education' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
/**
|
3 |
* Plugin Name: WordPress.com Editing Toolkit
|
4 |
* Description: Enhances your page creation workflow within the Block Editor.
|
5 |
+
* Version: 3.14565
|
6 |
* Author: Automattic
|
7 |
* Author URI: https://automattic.com/wordpress-plugins/
|
8 |
* License: GPLv2 or later
|
42 |
*
|
43 |
* @var string
|
44 |
*/
|
45 |
+
define( 'A8C_ETK_PLUGIN_VERSION', '3.14565' );
|
46 |
|
47 |
// Always include these helper files for dotcom FSE.
|
48 |
require_once __DIR__ . '/dotcom-fse/helpers.php';
|
340 |
require_once __DIR__ . '/tags-education/class-tags-education.php';
|
341 |
}
|
342 |
add_action( 'plugins_loaded', __NAMESPACE__ . '\load_tags_education' );
|
343 |
+
|
344 |
+
/**
|
345 |
+
* WP.com-specific Site Editor changes.
|
346 |
+
* (Core Full Site Editing)
|
347 |
+
*/
|
348 |
+
function load_wpcom_site_editor() {
|
349 |
+
require_once __DIR__ . '/wpcom-site-editor/index.php';
|
350 |
+
}
|
351 |
+
add_action( 'plugins_loaded', __NAMESPACE__ . '\load_wpcom_site_editor', 11 ); // load just after the Gutenberg plugin.
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: automattic
|
|
3 |
Tags: block, blocks, editor, gutenberg, page
|
4 |
Requires at least: 5.5
|
5 |
Tested up to: 5.6
|
6 |
-
Stable tag: 3.
|
7 |
Requires PHP: 5.6.20
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
3 |
Tags: block, blocks, editor, gutenberg, page
|
4 |
Requires at least: 5.5
|
5 |
Tested up to: 5.6
|
6 |
+
Stable tag: 3.14565
|
7 |
Requires PHP: 5.6.20
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
wpcom-site-editor/dist/wpcom-site-editor.asset.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php return array('dependencies' => array('wp-dom-ready', 'wp-polyfill'), 'version' => 'bfd979a077db2c80702c7423f9acc62c');
|
wpcom-site-editor/dist/wpcom-site-editor.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.edit-site-template-details__show-all-button.components-button{display:none}
|
wpcom-site-editor/dist/wpcom-site-editor.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(){"use strict";var t={266:function(){},538:function(t,e,n){var o=n(531),i=n.n(o);n(266);function r(){if(!document.querySelector(".wpcom-edit-site-navigation-toggle__button")){var t=document.querySelector(".edit-site-navigation-toggle");t&&(t.classList.add("wpcom-edit-site-navigation-toggle__button"),t.addEventListener("click",(function(t){var e,n;t.preventDefault(),t.stopPropagation();var o=null===(e=window)||void 0===e||null===(n=e.calypsoifyGutenberg)||void 0===n?void 0:n.closeUrl;o?window.top.location.href=o:window.location.href="./index.php"})))}}i()((function(){if(window.wp.editSite)var t=setInterval((function(){if(document.querySelector(".edit-site-navigation-toggle__button")){clearInterval(t),r();var e=document.getElementById("wpbody");if(e&&void 0!==window.MutationObserver)new window.MutationObserver(r).observe(e,{subtree:!0,childList:!0})}}))}))},531:function(t){t.exports=window.wp.domReady}},e={};function n(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return t[o](r,r.exports,n),r.exports}n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};!function(){n.r(o);n(538)}(),window.EditingToolkit=o}();
|
wpcom-site-editor/dist/wpcom-site-editor.rtl.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.edit-site-template-details__show-all-button.components-button{display:none}
|
wpcom-site-editor/index.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
import './navigation-toggle';
|
wpcom-site-editor/index.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Customize the look and feel of the Site Editor on WP.com.
|
4 |
+
*
|
5 |
+
* @package A8C\FSE
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace A8C\FSE;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Enqueue block editor assets.
|
12 |
+
*/
|
13 |
+
function wpcom_site_editor_script_and_style() {
|
14 |
+
$asset_file = include plugin_dir_path( __FILE__ ) . 'dist/wpcom-site-editor.asset.php';
|
15 |
+
$script_dependencies = $asset_file['dependencies'];
|
16 |
+
$version = $asset_file['version'];
|
17 |
+
|
18 |
+
wp_enqueue_script(
|
19 |
+
'wpcom-site-editor-script',
|
20 |
+
plugins_url( 'dist/wpcom-site-editor.js', __FILE__ ),
|
21 |
+
is_array( $script_dependencies ) ? $script_dependencies : array(),
|
22 |
+
$version,
|
23 |
+
true
|
24 |
+
);
|
25 |
+
|
26 |
+
$style_path = 'dist/wpcom-site-editor' . ( is_rtl() ? '.rtl' : '' ) . '.css';
|
27 |
+
wp_enqueue_style(
|
28 |
+
'wpcom-site-editor-style',
|
29 |
+
plugins_url( $style_path, __FILE__ ),
|
30 |
+
array(),
|
31 |
+
filemtime( plugin_dir_path( __FILE__ ) . $style_path )
|
32 |
+
);
|
33 |
+
}
|
34 |
+
add_action( 'enqueue_block_editor_assets', __NAMESPACE__ . '\wpcom_site_editor_script_and_style' );
|
wpcom-site-editor/navigation-toggle/index.js
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import domReady from '@wordpress/dom-ready';
|
2 |
+
import './style.scss';
|
3 |
+
|
4 |
+
function injectNavigationToggleOnClickHandler() {
|
5 |
+
// Prevent adding the event listener multiple times
|
6 |
+
if ( document.querySelector( '.wpcom-edit-site-navigation-toggle__button' ) ) {
|
7 |
+
return;
|
8 |
+
}
|
9 |
+
|
10 |
+
const toggle = document.querySelector( '.edit-site-navigation-toggle' );
|
11 |
+
if ( ! toggle ) {
|
12 |
+
return;
|
13 |
+
}
|
14 |
+
|
15 |
+
// Add a CSS class to determine if the event listener has been added already
|
16 |
+
toggle.classList.add( 'wpcom-edit-site-navigation-toggle__button' );
|
17 |
+
|
18 |
+
toggle.addEventListener( 'click', ( event ) => {
|
19 |
+
event.preventDefault();
|
20 |
+
event.stopPropagation();
|
21 |
+
const calypsoCloseUrl = window?.calypsoifyGutenberg?.closeUrl;
|
22 |
+
if ( calypsoCloseUrl ) {
|
23 |
+
window.top.location.href = calypsoCloseUrl;
|
24 |
+
} else {
|
25 |
+
window.location.href = './index.php';
|
26 |
+
}
|
27 |
+
} );
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Customize the navigation sidebar toggle click handler to simply navigate back home.
|
32 |
+
*/
|
33 |
+
domReady( () => {
|
34 |
+
if ( ! window.wp.editSite ) {
|
35 |
+
return;
|
36 |
+
}
|
37 |
+
|
38 |
+
const waitForNavigationToggleButton = setInterval( () => {
|
39 |
+
const toggleButton = document.querySelector( '.edit-site-navigation-toggle__button' );
|
40 |
+
if ( ! toggleButton ) {
|
41 |
+
return;
|
42 |
+
}
|
43 |
+
clearInterval( waitForNavigationToggleButton );
|
44 |
+
|
45 |
+
injectNavigationToggleOnClickHandler();
|
46 |
+
|
47 |
+
// Re-inject the navigation toggle click handler as needed in case React re-renders the navigation sidebar
|
48 |
+
const wpbody = document.getElementById( 'wpbody' );
|
49 |
+
if ( wpbody && typeof window.MutationObserver !== 'undefined' ) {
|
50 |
+
const observer = new window.MutationObserver( injectNavigationToggleOnClickHandler );
|
51 |
+
observer.observe( wpbody, { subtree: true, childList: true } );
|
52 |
+
}
|
53 |
+
} );
|
54 |
+
} );
|
wpcom-site-editor/navigation-toggle/style.scss
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
.edit-site-template-details__show-all-button.components-button {
|
2 |
+
display: none;
|
3 |
+
}
|