Version Description
Download this release
Release Info
Developer | mreishus |
Plugin | Full Site Editing |
Version | 3.38384 |
Comparing to | |
See all releases |
Code changes from version 3.38371 to 3.38384
- build_meta.txt +3 -3
- full-site-editing-plugin.php +2 -2
- readme.txt +1 -1
- starter-page-templates/class-starter-page-templates.php +24 -13
build_meta.txt
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
commit_hash=
|
2 |
-
commit_url=https://github.com/Automattic/wp-calypso/commit/
|
3 |
-
build_number=3.
|
1 |
+
commit_hash=bead980333146ed658e0a7a100d5ae653f02acfe
|
2 |
+
commit_url=https://github.com/Automattic/wp-calypso/commit/bead980333146ed658e0a7a100d5ae653f02acfe
|
3 |
+
build_number=3.38384
|
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';
|
2 |
/**
|
3 |
* Plugin Name: WordPress.com Editing Toolkit
|
4 |
* Description: Enhances your page creation workflow within the Block Editor.
|
5 |
+
* Version: 3.38384
|
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.38384' );
|
46 |
|
47 |
// Always include these helper files for dotcom FSE.
|
48 |
require_once __DIR__ . '/dotcom-fse/helpers.php';
|
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: 6.0
|
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: 6.0
|
6 |
+
Stable tag: 3.38384
|
7 |
Requires PHP: 5.6.20
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
starter-page-templates/class-starter-page-templates.php
CHANGED
@@ -21,6 +21,7 @@ class Starter_Page_Templates {
|
|
21 |
|
22 |
/**
|
23 |
* Cache key for templates array.
|
|
|
24 |
*
|
25 |
* @var string
|
26 |
*/
|
@@ -30,16 +31,6 @@ class Starter_Page_Templates {
|
|
30 |
* Starter_Page_Templates constructor.
|
31 |
*/
|
32 |
private function __construct() {
|
33 |
-
$this->templates_cache_key = implode(
|
34 |
-
'_',
|
35 |
-
array(
|
36 |
-
'starter_page_templates',
|
37 |
-
A8C_ETK_PLUGIN_VERSION,
|
38 |
-
get_option( 'site_vertical', 'default' ),
|
39 |
-
$this->get_verticals_locale(),
|
40 |
-
)
|
41 |
-
);
|
42 |
-
|
43 |
add_action( 'init', array( $this, 'register_scripts' ) );
|
44 |
add_action( 'init', array( $this, 'register_meta_field' ) );
|
45 |
add_action( 'rest_api_init', array( $this, 'register_rest_api' ) );
|
@@ -48,6 +39,26 @@ class Starter_Page_Templates {
|
|
48 |
add_action( 'switch_theme', array( $this, 'clear_templates_cache' ) );
|
49 |
}
|
50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
/**
|
52 |
* Creates instance.
|
53 |
*
|
@@ -200,7 +211,7 @@ class Starter_Page_Templates {
|
|
200 |
* @return array Containing page templates or nothing if an error occurred.
|
201 |
*/
|
202 |
public function get_page_templates() {
|
203 |
-
$page_template_data = get_transient( $this->
|
204 |
|
205 |
$override_source_site = apply_filters( 'a8c_override_patterns_source_site', false );
|
206 |
|
@@ -234,7 +245,7 @@ class Starter_Page_Templates {
|
|
234 |
|
235 |
// Only save to cache if we have not overridden the source site.
|
236 |
if ( false === $override_source_site ) {
|
237 |
-
set_transient( $this->
|
238 |
}
|
239 |
|
240 |
return $page_template_data;
|
@@ -259,7 +270,7 @@ class Starter_Page_Templates {
|
|
259 |
* Deletes cached templates data when theme switches.
|
260 |
*/
|
261 |
public function clear_templates_cache() {
|
262 |
-
delete_transient( $this->
|
263 |
}
|
264 |
|
265 |
/**
|
21 |
|
22 |
/**
|
23 |
* Cache key for templates array.
|
24 |
+
* Please access with the ->get_templates_cache_key() getter.
|
25 |
*
|
26 |
* @var string
|
27 |
*/
|
31 |
* Starter_Page_Templates constructor.
|
32 |
*/
|
33 |
private function __construct() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
add_action( 'init', array( $this, 'register_scripts' ) );
|
35 |
add_action( 'init', array( $this, 'register_meta_field' ) );
|
36 |
add_action( 'rest_api_init', array( $this, 'register_rest_api' ) );
|
39 |
add_action( 'switch_theme', array( $this, 'clear_templates_cache' ) );
|
40 |
}
|
41 |
|
42 |
+
/**
|
43 |
+
* Gets the cache key for templates array, after setting it if it hasn't been set yet.
|
44 |
+
*
|
45 |
+
* @return string
|
46 |
+
*/
|
47 |
+
public function get_templates_cache_key() {
|
48 |
+
if ( empty( $this->templates_cache_key ) ) {
|
49 |
+
$this->templates_cache_key = implode(
|
50 |
+
'_',
|
51 |
+
array(
|
52 |
+
'starter_page_templates',
|
53 |
+
A8C_ETK_PLUGIN_VERSION,
|
54 |
+
get_option( 'site_vertical', 'default' ),
|
55 |
+
$this->get_verticals_locale(),
|
56 |
+
)
|
57 |
+
);
|
58 |
+
}
|
59 |
+
return $this->templates_cache_key;
|
60 |
+
}
|
61 |
+
|
62 |
/**
|
63 |
* Creates instance.
|
64 |
*
|
211 |
* @return array Containing page templates or nothing if an error occurred.
|
212 |
*/
|
213 |
public function get_page_templates() {
|
214 |
+
$page_template_data = get_transient( $this->get_templates_cache_key() );
|
215 |
|
216 |
$override_source_site = apply_filters( 'a8c_override_patterns_source_site', false );
|
217 |
|
245 |
|
246 |
// Only save to cache if we have not overridden the source site.
|
247 |
if ( false === $override_source_site ) {
|
248 |
+
set_transient( $this->get_templates_cache_key(), $page_template_data, DAY_IN_SECONDS );
|
249 |
}
|
250 |
|
251 |
return $page_template_data;
|
270 |
* Deletes cached templates data when theme switches.
|
271 |
*/
|
272 |
public function clear_templates_cache() {
|
273 |
+
delete_transient( $this->get_templates_cache_key() );
|
274 |
}
|
275 |
|
276 |
/**
|