Commit 4eff05b3 authored by Simonas's avatar Simonas

updates & pre-restore

parent 79494a4c
......@@ -16,10 +16,10 @@
- check if dev.biuro.lt, dev.biuro.lv, dev.biuro.ee works
### DB backup
- `C:\web\dev.biuro> docker exec -i mysql mysqldump -uroot -pIiIjnsLi2wR9i1kWVbVpUAzP --default-character-set=utf8 wordpress > docker/mariadb/db_004.sql`
- `C:\web\dev.biuro> docker exec -i mysql mysqldump -uroot -pIiIjnsLi2wR9i1kWVbVpUAzP --default-character-set=utf8 wordpress > docker/mariadb/db_005.sql`
### DB restore
- `C:\web\dev.biuro> docker exec -i mysql mysql -uroot -pIiIjnsLi2wR9i1kWVbVpUAzP --default-character-set=utf8 wordpress < docker/mariadb/db_003.sql`
- `C:\web\dev.biuro> docker exec -i mysql mysql -uroot -pIiIjnsLi2wR9i1kWVbVpUAzP --default-character-set=utf8 wordpress < docker/mariadb/db_004.sql`
## Development
- `C:\web\dev.biuro\wordpress>yarn (or npm install)`
......
......@@ -20,6 +20,8 @@ services:
mysql:
image: mariadb:10.3
container_name: mysql
ports:
- '3306:3306'
volumes:
- ./docker/mariadb:/docker-entrypoint-initdb.d/
- ./var/mariadb:/var/lib/mysql
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
-- phpMyAdmin SQL Dump
-- version 3.5.8.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 05, 2018 at 09:46 AM
-- Server version: 5.5.9
-- PHP Version: 5.3.29
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `biuro_lt`
--
-- --------------------------------------------------------
--
-- Table structure for table `SiteTree_Live`
--
DROP TABLE IF EXISTS `SiteTree_Live`;
CREATE TABLE IF NOT EXISTS `SiteTree_Live` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`ClassName` enum('SiteTree','Page','WidgetHolder','WidgetPage','ContactPage','ContactPageEmployee','GMapPage','HoldingPage','JobOffersHolder','Frontpage','NewsArticle','NewsHolder','ErrorPage','RedirectorPage','VirtualPage') CHARACTER SET utf8 DEFAULT 'SiteTree',
`Created` datetime DEFAULT NULL,
`LastEdited` datetime DEFAULT NULL,
`URLSegment` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
`Title` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
`MenuTitle` varchar(100) CHARACTER SET utf8 DEFAULT NULL,
`Content` mediumtext CHARACTER SET utf8,
`MetaTitle` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
`MetaDescription` mediumtext CHARACTER SET utf8,
`MetaKeywords` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
`ExtraMeta` mediumtext CHARACTER SET utf8,
`ShowInMenus` tinyint(1) unsigned NOT NULL DEFAULT '0',
`ShowInSearch` tinyint(1) unsigned NOT NULL DEFAULT '0',
`HomepageForDomain` varchar(100) CHARACTER SET utf8 DEFAULT NULL,
`ProvideComments` tinyint(1) unsigned NOT NULL DEFAULT '0',
`Sort` int(11) NOT NULL DEFAULT '0',
`HasBrokenFile` tinyint(1) unsigned NOT NULL DEFAULT '0',
`HasBrokenLink` tinyint(1) unsigned NOT NULL DEFAULT '0',
`Status` varchar(50) CHARACTER SET utf8 DEFAULT NULL,
`ReportClass` varchar(50) CHARACTER SET utf8 DEFAULT NULL,
`CanViewType` enum('Anyone','LoggedInUsers','OnlyTheseUsers','Inherit') CHARACTER SET utf8 DEFAULT 'Inherit',
`CanEditType` enum('LoggedInUsers','OnlyTheseUsers','Inherit') CHARACTER SET utf8 DEFAULT 'Inherit',
`ToDo` mediumtext CHARACTER SET utf8,
`Version` int(11) NOT NULL DEFAULT '0',
`Locale` varchar(16) CHARACTER SET utf8 DEFAULT NULL,
`ParentID` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`ID`),
KEY `ParentID` (`ParentID`),
KEY `URLSegment` (`URLSegment`),
KEY `ClassName` (`ClassName`),
FULLTEXT KEY `SearchFields` (`Title`,`MenuTitle`,`Content`,`MetaTitle`,`MetaDescription`,`MetaKeywords`),
FULLTEXT KEY `TitleSearchFields` (`Title`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
......@@ -7,7 +7,7 @@
* Learn more: https://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Body_Mind_Soul
* @subpackage Biuro
* @since 1.0
* @version 1.0
*/
......
......@@ -744,56 +744,178 @@ add_action('init', 'init_biuro_theme');
// // http://town.loc.al/wp-json/biuro/v1/index
// if ( ! class_exists( 'Lorem_Endpoint' ) ) :
// class Lorem_Endpoint {
// function __construct() {
// }
// function init() {
// add_filter( 'rest_api_init', [ $this, 'register_routes' ] );
// }
// public static function get_index() {
// $posts = get_posts( array(
// // 'author' => $data['id'],
// 'lang' => 'en',
// 'post_status' => 'publish',
// 'orderby' => 'menu_order',
// 'order' => 'ASC',
// ) );
// if ( empty( $posts ) ) {
// return null;
// }
function setPagesLT () {
return setPages ( 'biuro.lt', '2018/10/' );
}
function setPagesLV () {
return setPages ( 'biuro.lv', 'sites/2/2018/10/' );
}
function setPagesEE () {
return setPages ( 'biuro.ee', 'sites/3/2018/10/' );
}
function setPages ( $domain, $path ) {
global $wpdb;
$data = $wpdb->get_results("SELECT
ID as ID,
Title as post_title,
Content as post_content,
Sort as menu_order,
URLSegment as post_name,
Created as post_date,
LastEdited as post_modified,
MetaTitle as _yoast_wpseo_title,
MetaDescription as _yoast_wpseo_metadesc,
MetaKeywords as _yoast_wpseo_focuskw,
Locale as locale,
ParentID as parentID,
CASE WHEN (ParentID > 0) THEN (select URLSegment from `SiteTree_Live` WHERE ID = a.ParentID) ELSE '' END AS URLSegmentParent,
CASE WHEN (ParentID > 0) THEN CONCAT('/', (select URLSegment from `SiteTree_Live` WHERE ID = a.ParentID), '/', URLSegment) ELSE CONCAT('/', URLSegment) END AS URLSegmentFull,
MenuTitle as menu FROM SiteTree_Live a ORDER BY parentID");
$res = array();
$arr = array();
foreach ($data as $row) {
$res[$row->ID] = $row;
}
foreach ($res as $key => $row) {
$search = array(
'direktorija/boxru4',
'sitetree_link%20id',
'http://' . $domain . '/assets',
'http://www.' . $domain . '/assets',
'href="http://biuro.lt',
'href="http://www.biuro.lt',
'src="http://biuro.lt',
'src="http://www.biuro.lt',
'assets/Nauja-direktorija/Nauja-direktorija/',
'assets/Nauja-direktorija/',
'assets/Files/_resampled/',
'assets/Files/',
'assets/Uploads/Nauji-paveiksleliai/',
'assets/Uploads/blocks/',
'assets/Uploads/',
'assets/',
'mysite/img/',
);
// return $posts;
// }
$replace = array(
'direktorija/boxru6',
'sitetree_link id',
'assets',
'assets',
'href="https://dev.biuro.lt',
'href="https://dev.biuro.lt',
'src="https://dev.biuro.lt',
'src="https://dev.biuro.lt',
'https://dev.' . $domain . '/wp-content/uploads/' . $path,
'https://dev.' . $domain . '/wp-content/uploads/' . $path,
'https://dev.' . $domain . '/wp-content/uploads/' . $path,
'https://dev.' . $domain . '/wp-content/uploads/' . $path,
'https://dev.' . $domain . '/wp-content/uploads/' . $path,
'https://dev.' . $domain . '/wp-content/uploads/' . $path,
'https://dev.' . $domain . '/wp-content/uploads/' . $path,
'https://dev.' . $domain . '/wp-content/uploads/' . $path,
'https://dev.' . $domain . '/wp-content/uploads/' . $path,
);
// public function register_routes() {
// $version = '1';
// $namespace = 'biuro/v' . $version;
// $base = 'index';
$content = str_replace($search, $replace, $row->post_content);
// register_rest_route( $namespace, '/' . $base, array(
// array(
// 'methods' => WP_REST_Server::READABLE,
// 'callback' => array( $this, 'get_index' ),
// // 'permission_callback' => array( $this, 'get_items_permissions_check' ),
// // 'args' => array(
preg_match_all('/\[sitetree_link id=(\d+)\]/mi', $content, $matches);
// // ),
// ),
// ) );
if (count($matches[0]) > 0) {
// }
foreach ($matches[0] as $in => $r) {
// $res[$row->ID] = $row;
$content = str_replace($matches[0][$in], $res[$matches[1][$in]]->URLSegmentFull, $content);
}
}
$parentID = 0;
// }
if ($row->parentID > 0) {
$parentPage = get_page_by_path($row->URLSegmentParent);
$parentID = $parentPage->ID;
}
// endif;
# code...
$postID = wp_insert_post(array(
'post_title' => $row->post_title,
'post_content' => $content,
'menu_order' => $row->menu_order,
'post_name' => $row->post_name,
'post_date' => $row->post_date,
'post_modified' => $row->post_modified,
'post_author' => 1,
'post_type' => 'page',
'post_status' => 'publish',
'post_parent' => $parentID,
));
if ($postID > 0) {
add_post_meta($postID, '_yoast_wpseo_title', $row->_yoast_wpseo_title);
add_post_meta($postID, '_yoast_wpseo_metadesc', $row->_yoast_wpseo_metadesc);
add_post_meta($postID, '_yoast_wpseo_focuskw', $row->_yoast_wpseo_focuskw);
$code = 'lt';
switch ($row->locale) {
case 'lt_LT':
$code = 'lt';
break;
case 'en_US':
$code = 'en';
break;
case 'ru_RU':
$code = 'ru';
break;
case 'de_DE':
$code = 'de';
break;
case 'lv_LV':
$code = 'lv';
break;
case 'et_EE':
$code = 'et';
break;
}
PLL()->model->post->set_language($postID, $code);
}
}
return $arr;
}
add_action( 'rest_api_init', function () {
// https://dev.biuro.lt/wp-json/biuro/v1/pagesLT
// https://dev.biuro.lv/wp-json/biuro/v1/pagesLV
// https://dev.biuro.ee/wp-json/biuro/v1/pagesEE
register_rest_route( 'biuro/v1', '/pagesLT', array(
'methods' => WP_REST_Server::READABLE,
'callback' => 'setPagesLT',
));
register_rest_route( 'biuro/v1', '/pagesLV', array(
'methods' => WP_REST_Server::READABLE,
'callback' => 'setPagesLV',
));
register_rest_route( 'biuro/v1', '/pagesEE', array(
'methods' => WP_REST_Server::READABLE,
'callback' => 'setPagesEE',
));
// $Lorem_Endpoint = new Lorem_Endpoint();
// $Lorem_Endpoint->init();
});
\ No newline at end of file
......@@ -10,7 +10,7 @@
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Our_Demo
* @subpackage Biuro
* @since 1.0
* @version 1.0
*/
......@@ -20,6 +20,11 @@ get_header(); ?>
<main class="l-main" role="main">
<h1>index.php</h1>
<p>main</p>
<hr >
<?php the_title( '<h1>', '</h1>' ); ?>
<?php the_content(); ?>
</main>
<aside role="complementary" class="l-aside">
......
......@@ -43,7 +43,7 @@ export function server() {
// },
host: 'dev.biuro.lt',
open: 'external',
open: false,
port: 2000,
ui: false,
middleware: [
......
This diff is collapsed.
......@@ -48,6 +48,7 @@
"write-file-webpack-plugin": "^4.3.2"
},
"dependencies": {
"npm": "^6.4.1",
"preact": "^8.3.1",
"preact-async-route": "^2.2.1",
"preact-router": "^2.6.1"
......
This diff is collapsed.
This diff is collapsed.
......@@ -2,7 +2,7 @@
# This file is distributed under the same license as the Themes - Twenty Seventeen package.
msgid ""
msgstr ""
"PO-Revision-Date: 2017-11-16 10:20:10+0000\n"
"PO-Revision-Date: 2018-11-04 19:03:56+0000\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
......@@ -23,11 +23,11 @@ msgstr "Twenty Seventeen"
msgid "Footer"
msgstr "Подвал"
#: functions.php:326
#: functions.php:329
msgid "Add widgets here to appear in your sidebar on blog posts and archive pages."
msgstr "Добавить виджеты, которые появятся на боковой панели в записях блога и страницах архива."
#: functions.php:324 sidebar.php:18
#: functions.php:327 sidebar.php:18
msgid "Blog Sidebar"
msgstr "Боковая панель блога"
......@@ -36,26 +36,26 @@ msgstr "Боковая панель блога"
msgid "Scroll down to content"
msgstr "Перейти к содержимому"
#: functions.php:167
#: functions.php:170
msgctxt "Theme starter content"
msgid "Coffee"
msgstr "Кофе"
#: functions.php:163
#: functions.php:166
msgctxt "Theme starter content"
msgid "Sandwich"
msgstr "Сэндвич"
#: functions.php:159
#: functions.php:162
msgctxt "Theme starter content"
msgid "Espresso"
msgstr "Эспрессо"
#: inc/custom-header.php:126
#: inc/custom-header.php:128
msgid "Pause background video"
msgstr "Приостановить фоновое видео"
#: inc/custom-header.php:125
#: inc/custom-header.php:127
msgid "Play background video"
msgstr "Проиграть фоновое видео"
......@@ -63,7 +63,7 @@ msgstr "Проиграть фоновое видео"
msgid "Front Page Section %1$s Placeholder"
msgstr "Заполнитель %1$s раздела главной страницы"
#: inc/customizer.php:99
#: inc/customizer.php:109
msgid "When the two-column layout is assigned, the page title is in one column and content is in the other."
msgstr "При назначении разметки в два столбца, название страницы размещается в первом столбце, а содержимое в другом."
......@@ -106,68 +106,68 @@ msgstr "Пожалуйста, определите имя файла для SVG
msgid "Please define default parameters in the form of an array."
msgstr "Пожалуйста, определите параметры по умолчанию в форме массива."
#: inc/customizer.php:131
#: inc/customizer.php:143
msgid "Select pages to feature in each area from the dropdowns. Add an image to a section by setting a featured image in the page editor. Empty sections will not be displayed."
msgstr "Выберите избранные страницы для каждой области из выпадающих списков. Добавьте изображение в раздел установив избранное изображение в редакторе страницы. Пустые разделы не будут показаны."
#. translators: %d is the front page section number
#: inc/customizer.php:130
#: inc/customizer.php:142
msgid "Front Page Section %d Content"
msgstr "Содержимое %d раздела главной страницы"
#: inc/customizer.php:102 inc/customizer.php:158
#: inc/customizer.php:112 inc/customizer.php:171
msgid "Two Column"
msgstr "Два столбца"
#: inc/customizer.php:101 inc/customizer.php:157
#: inc/customizer.php:111 inc/customizer.php:170
msgid "One Column"
msgstr "Один столбец"
#: inc/customizer.php:96
#: inc/customizer.php:106
msgid "Page Layout"
msgstr "Разметка страницы"
#: inc/customizer.php:81
#: inc/customizer.php:89
msgid "Theme Options"
msgstr "Настройки темы"
#: inc/customizer.php:59
#: inc/customizer.php:64
msgid "Custom"
msgstr "Пользовательская"
#: inc/customizer.php:57
#: inc/customizer.php:62
msgid "Light"
msgstr "Светлая"
#: inc/customizer.php:55
#: inc/customizer.php:60
msgid "Color Scheme"
msgstr "Цветовая схема"
#: inc/custom-header.php:54
#: inc/custom-header.php:56
msgid "Default Header Image"
msgstr "Изображение заголовка по умолчанию"
#: functions.php:348
#: functions.php:351
msgid "Footer 2"
msgstr "Подвал 2"
#: functions.php:338 functions.php:350
#: functions.php:341 functions.php:353
msgid "Add widgets here to appear in your footer."
msgstr "Добавьте сюда виджеты для отображения в подвале сайта."
#: functions.php:336
#: functions.php:339
msgid "Footer 1"
msgstr "Подвал 1"
#. Translators: If there are characters in your language that are not supported
#. by Libre Franklin, translate this to 'off'. Do not translate into your own
#. language.
#: functions.php:277
#: functions.php:280
msgctxt "Libre Franklin font: on or off"
msgid "on"
msgstr "on"
#: functions.php:64 functions.php:191
#: functions.php:64 functions.php:194
#: template-parts/navigation/navigation-top.php:12
msgid "Top Menu"
msgstr "Верхнее меню"
......@@ -221,10 +221,10 @@ msgstr "Искать:"
#: search.php:19
msgid "Search Results for: %s"
msgstr "Результаты поиска: %s"
msgstr "Результаты поиска для: %s"
#. translators: %s: Name of current post
#: functions.php:378 template-parts/page/content-front-page-panels.php:45
#: functions.php:381 template-parts/page/content-front-page-panels.php:45
#: template-parts/page/content-front-page.php:42
#: template-parts/post/content-audio.php:84
#: template-parts/post/content-gallery.php:71
......@@ -233,11 +233,11 @@ msgstr "Результаты поиска: %s"
msgid "Continue reading<span class=\"screen-reader-text\"> \"%s\"</span>"
msgstr "Читать далее<span class=\"screen-reader-text\"> «%s»</span>"
#: inc/customizer.php:58
#: inc/customizer.php:63
msgid "Dark"
msgstr "Тёмная"
#: inc/back-compat.php:39 inc/back-compat.php:52 inc/back-compat.php:68
#: inc/back-compat.php:39 inc/back-compat.php:52 inc/back-compat.php:70
msgid "Twenty Seventeen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again."
msgstr "Тема Twenty Seventeen требует WordPress версии 4.7 или выше. У вас версия %s. Пожалуйста, обновите WordPress и попробуйте ещё раз."
......@@ -262,15 +262,15 @@ msgstr "Меню"
msgid "Skip to content"
msgstr "Перейти к содержимому"
#: functions.php:467
#: functions.php:470
msgid "Collapse child menu"
msgstr "Свернуть дочернее меню"
#: functions.php:466
#: functions.php:469
msgid "Expand child menu"
msgstr "Раскрыть дочернее меню"
#: functions.php:65 functions.php:202
#: functions.php:65 functions.php:205
msgid "Social Links Menu"
msgstr "Меню социальных ссылок"
......
this.wp=this.wp||{},this.wp.a11y=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=195)}({188:function(e,t){!function(){e.exports=this.wp.domReady}()},195:function(e,t,n){"use strict";n.r(t);var r=function(e){e=e||"polite";var t=document.createElement("div");return t.id="a11y-speak-"+e,t.className="a11y-speak-region",t.setAttribute("style","position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;"),t.setAttribute("aria-live",e),t.setAttribute("aria-relevant","additions text"),t.setAttribute("aria-atomic","true"),document.querySelector("body").appendChild(t),t},i=function(){for(var e=document.querySelectorAll(".a11y-speak-region"),t=0;t<e.length;t++)e[t].textContent=""},o=n(188),a=n.n(o),u="",p=function(e){return e=e.replace(/<[^<>]+>/g," "),u===e&&(e+=" "),u=e,e};n.d(t,"setup",function(){return s}),n.d(t,"speak",function(){return c});var s=function(){var e=document.getElementById("a11y-speak-polite"),t=document.getElementById("a11y-speak-assertive");null===e&&(e=r("polite")),null===t&&(t=r("assertive"))};a()(s);var c=function(e,t){i(),e=p(e);var n=document.getElementById("a11y-speak-polite"),r=document.getElementById("a11y-speak-assertive");r&&"assertive"===t?r.textContent=e:n&&(n.textContent=e)}}});
\ No newline at end of file
this.wp=this.wp||{},this.wp.a11y=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=196)}({194:function(e,t){!function(){e.exports=this.wp.domReady}()},196:function(e,t,n){"use strict";n.r(t);var r=function(e){e=e||"polite";var t=document.createElement("div");return t.id="a11y-speak-"+e,t.className="a11y-speak-region",t.setAttribute("style","position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;"),t.setAttribute("aria-live",e),t.setAttribute("aria-relevant","additions text"),t.setAttribute("aria-atomic","true"),document.querySelector("body").appendChild(t),t},i=function(){for(var e=document.querySelectorAll(".a11y-speak-region"),t=0;t<e.length;t++)e[t].textContent=""},o=n(194),a=n.n(o),u="",p=function(e){return e=e.replace(/<[^<>]+>/g," "),u===e&&(e+=" "),u=e,e};n.d(t,"setup",function(){return s}),n.d(t,"speak",function(){return c});var s=function(){var e=document.getElementById("a11y-speak-polite"),t=document.getElementById("a11y-speak-assertive");null===e&&(e=r("polite")),null===t&&(t=r("assertive"))};a()(s);var c=function(e,t){i(),e=p(e);var n=document.getElementById("a11y-speak-polite"),r=document.getElementById("a11y-speak-assertive");r&&"assertive"===t?r.textContent=e:n&&(n.textContent=e)}}});
\ No newline at end of file
this.wp=this.wp||{},this.wp.blob=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=243)}({243:function(e,t,r){"use strict";r.r(t),r.d(t,"createBlobURL",function(){return i}),r.d(t,"getBlobByURL",function(){return f}),r.d(t,"revokeBlobURL",function(){return l});var n=window.URL,o=n.createObjectURL,u=n.revokeObjectURL,c={};function i(e){var t=o(e);return c[t]=e,t}function f(e){return c[e]}function l(e){c[e]&&u(e),delete c[e]}}});
\ No newline at end of file
this.wp=this.wp||{},this.wp.blob=function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=339)}({339:function(e,n,t){"use strict";t.r(n),t.d(n,"createBlobURL",function(){return c}),t.d(n,"getBlobByURL",function(){return f}),t.d(n,"revokeBlobURL",function(){return l}),t.d(n,"isBlobURL",function(){return a});var r=window.URL,o=r.createObjectURL,u=r.revokeObjectURL,i={};function c(e){var n=o(e);return i[n]=e,n}function f(e){return i[e]}function l(e){i[e]&&u(e),delete i[e]}function a(e){return!(!e||!e.indexOf)&&0===e.indexOf("blob:")}}});
\ No newline at end of file
this.wp=this.wp||{},this.wp.blockSerializationDefaultParser=function(r){var t={};function n(e){if(t[e])return t[e].exports;var u=t[e]={i:e,l:!1,exports:{}};return r[e].call(u.exports,u,u.exports,n),u.l=!0,u.exports}return n.m=r,n.c=t,n.d=function(r,t,e){n.o(r,t)||Object.defineProperty(r,t,{configurable:!1,enumerable:!0,get:e})},n.r=function(r){Object.defineProperty(r,"__esModule",{value:!0})},n.n=function(r){var t=r&&r.__esModule?function(){return r.default}:function(){return r};return n.d(t,"a",t),t},n.o=function(r,t){return Object.prototype.hasOwnProperty.call(r,t)},n.p="",n(n.s=242)}({242:function(r,t,n){"use strict";n.r(t),n.d(t,"parse",function(){return f});var e,u,o,c,i=n(33),s=/<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?!}\s+-->)[^])+?}\s+)?(\/)?-->/g;function l(r,t,n,e){return{blockName:r,attrs:t,innerBlocks:n,innerHTML:e}}function a(r){return l(null,{},[],r)}var f=function(r){e=r,u=0,o=[],c=[],s.lastIndex=0;do{}while(p());return o};function p(){var r=function(){var r=s.exec(e);if(null===r)return["no-more-tokens"];var t=r.index,n=Object(i.a)(r,6),u=n[0],o=n[1],c=n[2],l=n[3],a=n[4],f=n[5],p=u.length,b=!!o,v=!!f,h=(c||"core/")+l,d=!!a,k=d?function(r){try{return JSON.parse(r)}catch(r){return null}}(a):{};if(v)return["void-block",h,k,t,p];if(b)return["block-closer",h,null,t,p];return["block-opener",h,k,t,p]}(),t=Object(i.a)(r,5),n=t[0],f=t[1],p=t[2],d=t[3],k=t[4],O=c.length,g=d>u?u:null;switch(n){case"no-more-tokens":if(0===O)return b(),!1;if(1===O)return h(),!1;for(;0<c.length;)h();return!1;case"void-block":return 0===O?(null!==g&&o.push(a(e.substr(g,d-g))),o.push(l(f,p,[],"")),u=d+k,!0):(v(l(f,p,[],""),d,k),u=d+k,!0);case"block-opener":return c.push(function(r,t,n,e,u){return{block:r,tokenStart:t,tokenLength:n,prevOffset:e||t+n,leadingHtmlStart:u}}(l(f,p,[],""),d,k,d+k,g)),u=d+k,!0;case"block-closer":if(0===O)return b(),!1;if(1===O)return h(d),u=d+k,!0;var y=c.pop();return y.block.innerHTML+=e.substr(y.prevOffset,d-y.prevOffset),y.prevOffset=d+k,v(y.block,y.tokenStart,y.tokenLength,d+k),u=d+k,!0;default:return b(),!1}}function b(r){var t=r||e.length-u;0!==t&&o.push(a(e.substr(u,t)))}function v(r,t,n,u){var o=c[c.length-1];o.block.innerBlocks.push(r),o.block.innerHTML+=e.substr(o.prevOffset,t-o.prevOffset),o.prevOffset=u||t+n}function h(r){var t=c.pop(),n=t.block,u=t.leadingHtmlStart,i=t.prevOffset,s=t.tokenStart;n.innerHTML+=r?e.substr(i,r-i):e.substr(i),null!==u&&o.push(a(e.substr(u,s-u))),o.push(n)}},33:function(r,t,n){"use strict";var e=n(45);var u=n(44);function o(r,t){return Object(e.a)(r)||function(r,t){var n=[],e=!0,u=!1,o=void 0;try{for(var c,i=r[Symbol.iterator]();!(e=(c=i.next()).done)&&(n.push(c.value),!t||n.length!==t);e=!0);}catch(r){u=!0,o=r}finally{try{e||null==i.return||i.return()}finally{if(u)throw o}}return n}(r,t)||Object(u.a)()}n.d(t,"a",function(){return o})},44:function(r,t,n){"use strict";function e(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}n.d(t,"a",function(){return e})},45:function(r,t,n){"use strict";function e(r){if(Array.isArray(r))return r}n.d(t,"a",function(){return e})}});
\ No newline at end of file
this.wp=this.wp||{},this.wp.blockSerializationDefaultParser=function(r){var t={};function n(e){if(t[e])return t[e].exports;var u=t[e]={i:e,l:!1,exports:{}};return r[e].call(u.exports,u,u.exports,n),u.l=!0,u.exports}return n.m=r,n.c=t,n.d=function(r,t,e){n.o(r,t)||Object.defineProperty(r,t,{configurable:!1,enumerable:!0,get:e})},n.r=function(r){Object.defineProperty(r,"__esModule",{value:!0})},n.n=function(r){var t=r&&r.__esModule?function(){return r.default}:function(){return r};return n.d(t,"a",t),t},n.o=function(r,t){return Object.prototype.hasOwnProperty.call(r,t)},n.p="",n(n.s=338)}({24:function(r,t,n){"use strict";var e=n(36);var u=n(35);function o(r,t){return Object(e.a)(r)||function(r,t){var n=[],e=!0,u=!1,o=void 0;try{for(var c,i=r[Symbol.iterator]();!(e=(c=i.next()).done)&&(n.push(c.value),!t||n.length!==t);e=!0);}catch(r){u=!0,o=r}finally{try{e||null==i.return||i.return()}finally{if(u)throw o}}return n}(r,t)||Object(u.a)()}n.d(t,"a",function(){return o})},338:function(r,t,n){"use strict";n.r(t),n.d(t,"parse",function(){return f});var e,u,o,c,i=n(24),s=/<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?!}\s+-->)[^])+?}\s+)?(\/)?-->/g;function l(r,t,n,e){return{blockName:r,attrs:t,innerBlocks:n,innerHTML:e}}function a(r){return l(null,{},[],r)}var f=function(r){e=r,u=0,o=[],c=[],s.lastIndex=0;do{}while(p());return o};function p(){var r=function(){var r=s.exec(e);if(null===r)return["no-more-tokens"];var t=r.index,n=Object(i.a)(r,6),u=n[0],o=n[1],c=n[2],l=n[3],a=n[4],f=n[5],p=u.length,b=!!o,v=!!f,h=(c||"core/")+l,d=!!a,k=d?function(r){try{return JSON.parse(r)}catch(r){return null}}(a):{};if(v)return["void-block",h,k,t,p];if(b)return["block-closer",h,null,t,p];return["block-opener",h,k,t,p]}(),t=Object(i.a)(r,5),n=t[0],f=t[1],p=t[2],d=t[3],k=t[4],O=c.length,g=d>u?u:null;switch(n){case"no-more-tokens":if(0===O)return b(),!1;if(1===O)return h(),!1;for(;0<c.length;)h();return!1;case"void-block":return 0===O?(null!==g&&o.push(a(e.substr(g,d-g))),o.push(l(f,p,[],"")),u=d+k,!0):(v(l(f,p,[],""),d,k),u=d+k,!0);case"block-opener":return c.push(function(r,t,n,e,u){return{block:r,tokenStart:t,tokenLength:n,prevOffset:e||t+n,leadingHtmlStart:u}}(l(f,p,[],""),d,k,d+k,g)),u=d+k,!0;case"block-closer":if(0===O)return b(),!1;if(1===O)return h(d),u=d+k,!0;var y=c.pop();return y.block.innerHTML+=e.substr(y.prevOffset,d-y.prevOffset),y.prevOffset=d+k,v(y.block,y.tokenStart,y.tokenLength,d+k),u=d+k,!0;default:return b(),!1}}function b(r){var t=r||e.length-u;0!==t&&o.push(a(e.substr(u,t)))}function v(r,t,n,u){var o=c[c.length-1];o.block.innerBlocks.push(r),o.block.innerHTML+=e.substr(o.prevOffset,t-o.prevOffset),o.prevOffset=u||t+n}function h(r){var t=c.pop(),n=t.block,u=t.leadingHtmlStart,i=t.prevOffset,s=t.tokenStart;n.innerHTML+=r?e.substr(i,r-i):e.substr(i),null!==u&&o.push(a(e.substr(u,s-u))),o.push(n)}},35:function(r,t,n){"use strict";function e(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}n.d(t,"a",function(){return e})},36:function(r,t,n){"use strict";function e(r){if(Array.isArray(r))return r}n.d(t,"a",function(){return e})}});
\ No newline at end of file
this.wp=this.wp||{},this.wp.deprecated=function(t){var e={};function n(o){if(e[o])return e[o].exports;var c=e[o]={i:o,l:!1,exports:{}};return t[o].call(c.exports,c,c.exports,n),c.l=!0,c.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:o})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=235)}({235:function(t,e,n){"use strict";n.r(e),n.d(e,"logged",function(){return c}),n.d(e,"default",function(){return r});var o=n(30),c=Object.create(null);function r(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.version,r=e.alternative,a=e.plugin,i=e.link,u=e.hint,l=a?" from ".concat(a):"",d=n?"".concat(l," in ").concat(n):"",s=r?" Please use ".concat(r," instead."):"",f=i?" See: ".concat(i):"",p=u?" Note: ".concat(u):"",v="".concat(t," is deprecated and will be removed").concat(d,".").concat(s).concat(f).concat(p);v in c||(Object(o.doAction)("deprecated",t,e,v),console.warn(v),c[v]=!0)}},30:function(t,e){!function(){t.exports=this.wp.hooks}()}}).default;
\ No newline at end of file
this.wp=this.wp||{},this.wp.deprecated=function(t){var e={};function n(o){if(e[o])return e[o].exports;var c=e[o]={i:o,l:!1,exports:{}};return t[o].call(c.exports,c,c.exports,n),c.l=!0,c.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:o})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=253)}({23:function(t,e){!function(){t.exports=this.wp.hooks}()},253:function(t,e,n){"use strict";n.r(e),n.d(e,"logged",function(){return c}),n.d(e,"default",function(){return r});var o=n(23),c=Object.create(null);function r(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.version,r=e.alternative,a=e.plugin,i=e.link,u=e.hint,l=a?" from ".concat(a):"",d=n?"".concat(l," in ").concat(n):"",s=r?" Please use ".concat(r," instead."):"",f=i?" See: ".concat(i):"",p=u?" Note: ".concat(u):"",v="".concat(t," is deprecated and will be removed").concat(d,".").concat(s).concat(f).concat(p);v in c||(Object(o.doAction)("deprecated",t,e,v),console.warn(v),c[v]=!0)}}}).default;
\ No newline at end of file
this.wp=this.wp||{},this.wp.domReady=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=234)}({234:function(e,t,n){"use strict";n.r(t);t.default=function(e){if("complete"===document.readyState||"interactive"===document.readyState)return e();document.addEventListener("DOMContentLoaded",e)}}}).default;
\ No newline at end of file
this.wp=this.wp||{},this.wp.domReady=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=252)}({252:function(e,t,n){"use strict";n.r(t);t.default=function(e){if("complete"===document.readyState||"interactive"===document.readyState)return e();document.addEventListener("DOMContentLoaded",e)}}}).default;
\ No newline at end of file
@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes editor_region_focus{0%{box-shadow:inset 0 0 0 0 #33b3db}to{box-shadow:inset 0 0 0 4px #33b3db}}@keyframes rotation{0%{transform:rotate(0deg)}to{transform:rotate(-1turn)}}@keyframes modal-appear{0%{margin-top:32px}to{margin-top:0}}.wp-block{width:610px}body{color:#191e23;font-family:"Noto Serif",serif;line-height:1.8}body,p{font-size:16px}ol,ul{margin:0;padding:0}ul{list-style-type:disc}ol{list-style-type:decimal}ol ul,ul ul{list-style-type:circle}.mce-content-body{line-height:1.8}
\ No newline at end of file
@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes editor_region_focus{0%{box-shadow:inset 0 0 0 0 #33b3db}to{box-shadow:inset 0 0 0 4px #33b3db}}@keyframes rotation{0%{transform:rotate(0deg)}to{transform:rotate(-1turn)}}@keyframes modal-appear{0%{margin-top:32px}to{margin-top:0}}body{color:#191e23;font-family:"Noto Serif",serif}body,p{font-size:16px;line-height:1.8}ol,ul{margin:0;padding:0}ul{list-style-type:disc}ol{list-style-type:decimal}ol ul,ul ul{list-style-type:circle}.mce-content-body{line-height:1.8}
\ No newline at end of file
@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes editor_region_focus{0%{box-shadow:inset 0 0 0 0 #33b3db}to{box-shadow:inset 0 0 0 4px #33b3db}}@keyframes rotation{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes modal-appear{0%{margin-top:32px}to{margin-top:0}}.wp-block{width:610px}body{color:#191e23;font-family:"Noto Serif",serif;line-height:1.8}body,p{font-size:16px}ol,ul{margin:0;padding:0}ul{list-style-type:disc}ol{list-style-type:decimal}ol ul,ul ul{list-style-type:circle}.mce-content-body{line-height:1.8}
\ No newline at end of file
@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes editor_region_focus{0%{box-shadow:inset 0 0 0 0 #33b3db}to{box-shadow:inset 0 0 0 4px #33b3db}}@keyframes rotation{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes modal-appear{0%{margin-top:32px}to{margin-top:0}}body{color:#191e23;font-family:"Noto Serif",serif}body,p{font-size:16px;line-height:1.8}ol,ul{margin:0;padding:0}ul{list-style-type:disc}ol{list-style-type:decimal}ol ul,ul ul{list-style-type:circle}.mce-content-body{line-height:1.8}
\ No newline at end of file
this.wp=this.wp||{},this.wp.escapeHtml=function(t){var e={};function n(r){if(e[r])return e[r].exports;var u=e[r]={i:r,l:!1,exports:{}};return t[r].call(u.exports,u,u.exports,n),u.l=!0,u.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=228)}({228:function(t,e,n){"use strict";n.r(e),n.d(e,"escapeAmpersand",function(){return u}),n.d(e,"escapeQuotationMark",function(){return o}),n.d(e,"escapeLessThan",function(){return c}),n.d(e,"escapeAttribute",function(){return i}),n.d(e,"escapeHTML",function(){return a}),n.d(e,"isValidAttributeName",function(){return f});var r=/[\u007F-\u009F "'>/="\uFDD0-\uFDEF]/;function u(t){return t.replace(/&(?!([a-z0-9]+|#[0-9]+|#x[a-f0-9]+);)/gi,"&amp;")}function o(t){return t.replace(/"/g,"&quot;")}function c(t){return t.replace(/</g,"&lt;")}function i(t){return o(u(t))}function a(t){return c(u(t))}function f(t){return!r.test(t)}}});
\ No newline at end of file
this.wp=this.wp||{},this.wp.escapeHtml=function(t){var e={};function n(r){if(e[r])return e[r].exports;var u=e[r]={i:r,l:!1,exports:{}};return t[r].call(u.exports,u,u.exports,n),u.l=!0,u.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=245)}({245:function(t,e,n){"use strict";n.r(e),n.d(e,"escapeAmpersand",function(){return u}),n.d(e,"escapeQuotationMark",function(){return o}),n.d(e,"escapeLessThan",function(){return c}),n.d(e,"escapeAttribute",function(){return i}),n.d(e,"escapeHTML",function(){return a}),n.d(e,"isValidAttributeName",function(){return f});var r=/[\u007F-\u009F "'>/="\uFDD0-\uFDEF]/;function u(t){return t.replace(/&(?!([a-z0-9]+|#[0-9]+|#x[a-f0-9]+);)/gi,"&amp;")}function o(t){return t.replace(/"/g,"&quot;")}function c(t){return t.replace(/</g,"&lt;")}function i(t){return o(u(t))}function a(t){return c(u(t))}function f(t){return!r.test(t)}}});
\ No newline at end of file
@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes editor_region_focus{0%{box-shadow:inset 0 0 0 0 #33b3db}to{box-shadow:inset 0 0 0 4px #33b3db}}@keyframes rotation{0%{transform:rotate(0deg)}to{transform:rotate(-1turn)}}@keyframes modal-appear{0%{margin-top:32px}to{margin-top:0}}.editor-format-toolbar__link-container-content{display:flex}.editor-format-toolbar__link-container-value{flex-grow:1;flex-shrink:1;margin:7px;max-width:500px;min-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
\ No newline at end of file
@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes editor_region_focus{0%{box-shadow:inset 0 0 0 0 #33b3db}to{box-shadow:inset 0 0 0 4px #33b3db}}@keyframes rotation{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes modal-appear{0%{margin-top:32px}to{margin-top:0}}.editor-format-toolbar__link-container-content{display:flex}.editor-format-toolbar__link-container-value{flex-grow:1;flex-shrink:1;margin:7px;max-width:500px;min-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
\ No newline at end of file
This diff is collapsed.
......@@ -56,12 +56,16 @@ class WP_REST_Autosaves_Controller extends WP_REST_Revisions_Controller {
* @param string $parent_post_type Post type of the parent.
*/
public function __construct( $parent_post_type ) {
$this->parent_post_type = $parent_post_type;
$this->parent_controller = new WP_REST_Posts_Controller( $parent_post_type );
$this->parent_post_type = $parent_post_type;
$post_type_object = get_post_type_object( $parent_post_type );
// Ensure that post type-specific controller logic is available.
$parent_controller_class = ! empty( $post_type_object->rest_controller_class ) ? $post_type_object->rest_controller_class : 'WP_REST_Posts_Controller';
$this->parent_controller = new $parent_controller_class( $post_type_object->name );
$this->revisions_controller = new WP_REST_Revisions_Controller( $parent_post_type );
$this->rest_namespace = 'wp/v2';
$this->rest_base = 'autosaves';
$post_type_object = get_post_type_object( $parent_post_type );
$this->parent_base = ! empty( $post_type_object->rest_base ) ? $post_type_object->rest_base : $post_type_object->name;
}
......
......@@ -21,7 +21,7 @@ class WP_REST_Block_Renderer_Controller extends WP_REST_Controller {
* @access public
*/
public function __construct() {
$this->namespace = 'gutenberg/v1';
$this->namespace = 'wp/v2';
$this->rest_base = 'block-renderer';
}
......
......@@ -33,91 +33,4 @@ class WP_REST_Blocks_Controller extends WP_REST_Posts_Controller {
return parent::check_read_permission( $post );
}
/**
* Handle a DELETE request.
*
* @since 1.10.0
*
* @param WP_REST_Request $request Full details about the request.
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
*/
public function delete_item( $request ) {
// Always hard-delete a block.
$request->set_param( 'force', true );
return parent::delete_item( $request );
}
/**
* Given an update or create request, build the post object that is saved to
* the database.
*
* @since 1.10.0
*
* @param WP_REST_Request $request Request object.
* @return stdClass|WP_Error Post object or WP_Error.
*/
public function prepare_item_for_database( $request ) {
$prepared_post = parent::prepare_item_for_database( $request );
// Force blocks to always be published.
$prepared_post->post_status = 'publish';
return $prepared_post;
}
/**
* Given a block from the database, build the array that is returned from an
* API response.
*
* @since 1.10.0
*
* @param WP_Post $post Post object that backs the block.
* @param WP_REST_Request $request Request object.
* @return WP_REST_Response Response object.
*/
public function prepare_item_for_response( $post, $request ) {
$data = array(
'id' => $post->ID,
'title' => $post->post_title,
'content' => $post->post_content,
);
$response = rest_ensure_response( $data );
return apply_filters( "rest_prepare_{$this->post_type}", $response, $post, $request );
}
/**
* Builds the block's schema, conforming to JSON Schema.
*
* @since 1.10.0
*
* @return array Item schema data.
*/
public function get_item_schema() {
return array(
'$schema' => 'http://json-schema.org/schema#',
'title' => $this->post_type,
'type' => 'object',
'properties' => array(
'id' => array(
'description' => __( 'Unique identifier for the block.', 'gutenberg' ),
'type' => 'integer',
'readonly' => true,
),
'title' => array(
'description' => __( 'The block’s title.', 'gutenberg' ),
'type' => 'string',
'required' => true,
),
'content' => array(
'description' => __( 'The block’s HTML content.', 'gutenberg' ),
'type' => 'string',
'required' => true,
),
),
);
}
}
......@@ -62,7 +62,7 @@ class WP_REST_Search_Controller extends WP_REST_Controller {
* handler instance must extend the `WP_REST_Search_Handler` class.
*/
public function __construct( array $search_handlers ) {
$this->namespace = 'gutenberg/v1';
$this->namespace = 'wp/v2';
$this->rest_base = 'search';
foreach ( $search_handlers as $search_handler ) {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment