Browse Source

Styling & display tweaks, escape output throughout

pull/328/head
SteelWagstaff 4 years ago
parent
commit
6ff2104fbc
  1. 40
      assets/styles/layouts/_page-register.scss
  2. 36
      dist/mix-manifest.json
  3. 397
      dist/scripts/aldine.js
  4. 33
      dist/scripts/call-to-action.js
  5. 68
      dist/scripts/catalog-admin.js
  6. 110
      dist/scripts/custom-signup.js
  7. 33
      dist/scripts/customizer-toggle.js
  8. 33
      dist/scripts/customizer.js
  9. 33
      dist/scripts/page-section.js
  10. 2928
      dist/styles/aldine.css
  11. 385
      dist/styles/editor.css
  12. 28
      footer.php
  13. 4
      header.php
  14. 32
      inc/actions/namespace.php
  15. 48
      inc/activation/namespace.php
  16. 8
      inc/admin/namespace.php
  17. 52
      inc/customizer/namespace.php
  18. 2
      inc/filters/namespace.php
  19. 16
      inc/helpers/namespace.php
  20. 62
      page-auth.php
  21. 4
      page-catalog.php
  22. 4
      partials/book.php
  23. 14
      partials/contact-form.php
  24. 6
      partials/content-front-page.php
  25. 28
      partials/content-page-catalog.php
  26. 8
      partials/paged-navigation.php

40
assets/styles/layouts/_page-register.scss

@ -3,12 +3,12 @@
$header-font: 'Karla', sans-serif; $header-font: 'Karla', sans-serif;
$body-font: 'Spectral', serif; $body-font: 'Spectral', serif;
.page.signup .header { .page.signup .header, .page.signin .header {
height: auto; height: auto;
padding: 1.5rem 2.5rem; padding: 1.5rem 2.5rem;
} }
.signup { .signup, .signin {
line-height: 1.4; line-height: 1.4;
height: 100vh; height: 100vh;
@ -24,17 +24,20 @@ $body-font: 'Spectral', serif;
margin-bottom: 0; margin-bottom: 0;
} }
&--tagline::after {
content: '\01F680';
margin-left: .5rem;
}
&--page-title { &--page-title {
padding: 0 2.5rem; padding: 2rem 2.5rem 1rem;
font-size: 2.5rem; font-size: 2.5rem;
font-weight: 700; font-weight: 700;
color: $dark-blue;
background: $light-grey-blue;
} }
&--page-title::after {
content: '\01F680';
margin-left: .5rem;
}
&--page-title, &--header-title { &--page-title, &--header-title {
text-transform: none; text-transform: none;
text-align: left; text-align: left;
@ -52,7 +55,7 @@ $body-font: 'Spectral', serif;
&--wrapper { &--wrapper {
display: flex; display: flex;
min-height: calc(100% - 240px); min-height: calc(100% - 295px);
flex-direction: row; flex-direction: row;
font-family: $header-font; font-family: $header-font;
@ -64,7 +67,7 @@ $body-font: 'Spectral', serif;
&--section { &--section {
flex: 1; flex: 1;
width: 50%; width: 50%;
padding: 2.5rem; padding: 1.5rem 2.5rem;
@media #{$breakpoint-small-to-tablet} { @media #{$breakpoint-small-to-tablet} {
width: 100%; width: 100%;
@ -104,7 +107,8 @@ $body-font: 'Spectral', serif;
height: 30px; height: 30px;
} }
} }
&--social-button:hover {
&--social-button:hover, &--social-button:focus, &--social-button:active {
background: $dark-blue; background: $dark-blue;
color: white; color: white;
@ -113,15 +117,21 @@ $body-font: 'Spectral', serif;
} }
} }
&--social-button:focus {
box-shadow: none;
border: 2px solid white;
outline: 2px solid $dark-blue;
}
.form { .form {
width: 100%; width: 100%;
margin-top: 2rem; margin: 2rem 0 1rem;
&--input-wrapper { &--input-wrapper {
position: relative; position: relative;
} }
input[type="email"], input[type="text"] { input[type="email"], input[type="text"], input[type="password"] {
background: white; background: white;
border: solid 1px $dark-blue; border: solid 1px $dark-blue;
padding: 5px; padding: 5px;
@ -181,3 +191,7 @@ $body-font: 'Spectral', serif;
} }
} }
} }
.signin .form--input-wrapper {
margin-top: 2rem;
}

36
dist/mix-manifest.json vendored

@ -1,20 +1,20 @@
{ {
"/scripts/aldine.js": "/scripts/aldine.js", "/scripts/aldine.js": "/scripts/aldine.js?id=70343c46d6d5d2b5375d",
"/scripts/call-to-action.js": "/scripts/call-to-action.js", "/scripts/call-to-action.js": "/scripts/call-to-action.js?id=33370b66c7af12320fc0",
"/scripts/catalog-admin.js": "/scripts/catalog-admin.js", "/scripts/catalog-admin.js": "/scripts/catalog-admin.js?id=e8d84fb090536b8e49e9",
"/scripts/customizer.js": "/scripts/customizer.js", "/scripts/customizer.js": "/scripts/customizer.js?id=14dca3944228dd789c27",
"/scripts/customizer-toggle.js": "/scripts/customizer-toggle.js", "/scripts/customizer-toggle.js": "/scripts/customizer-toggle.js?id=c31594589675d7c5662a",
"/scripts/page-section.js": "/scripts/page-section.js", "/scripts/page-section.js": "/scripts/page-section.js?id=19d5c30146ea1a763bcf",
"/scripts/custom-signup.js": "/scripts/custom-signup.js", "/scripts/custom-signup.js": "/scripts/custom-signup.js?id=c6931b08830a5b527b50",
"/styles/aldine.css": "/styles/aldine.css", "/styles/aldine.css": "/styles/aldine.css?id=bf68e4050eea9a8da4f5",
"/styles/editor.css": "/styles/editor.css", "/styles/editor.css": "/styles/editor.css?id=b7c2449babe566571767",
"/fonts/pressbooks-theme.woff": "/fonts/pressbooks-theme.woff", "/fonts/pressbooks-theme.woff": "/fonts/pressbooks-theme.woff?id=2a7aae81673f4707bbe7",
"/images/banner.jpg": "/images/banner.jpg", "/images/banner.jpg": "/images/banner.jpg?id=04a813e0b4f94ddfef19",
"/images/catalog-header.jpg": "/images/catalog-header.jpg", "/images/catalog-header.jpg": "/images/catalog-header.jpg?id=223b9f7a23985f2a72df",
"/images/header.jpg": "/images/header.jpg", "/images/header.jpg": "/images/header.jpg?id=c6712212b6aa749cf1cf",
"/images/left-arrow.svg": "/images/left-arrow.svg", "/images/left-arrow.svg": "/images/left-arrow.svg?id=91d479e2d001857a3ee4",
"/images/logo.svg": "/images/logo.svg", "/images/logo.svg": "/images/logo.svg?id=d71cb98d33ef823ffd27",
"/images/pb.svg": "/images/pb.svg", "/images/pb.svg": "/images/pb.svg?id=c08fb158c15a470648a7",
"/images/right-arrow.svg": "/images/right-arrow.svg", "/images/right-arrow.svg": "/images/right-arrow.svg?id=ee2d7230318ea54ae20b",
"/images/yt_icon_mono_dark.png": "/images/yt_icon_mono_dark.png" "/images/yt_icon_mono_dark.png": "/images/yt_icon_mono_dark.png?id=ee68b73409979a929440"
} }

397
dist/scripts/aldine.js vendored

File diff suppressed because one or more lines are too long

33
dist/scripts/call-to-action.js vendored

File diff suppressed because one or more lines are too long

68
dist/scripts/catalog-admin.js vendored

File diff suppressed because one or more lines are too long

110
dist/scripts/custom-signup.js vendored

File diff suppressed because one or more lines are too long

33
dist/scripts/customizer-toggle.js vendored

@ -1,32 +1 @@
/* document.addEventListener("DOMContentLoaded",(function(){var t=document.getElementById("_customize-input-pb_network_contact_form"),e=document.getElementById("customize-control-pb_network_contact_email"),s=document.getElementById("customize-control-pb_network_contact_link"),n=document.getElementById("customize-control-pb_network_contact_form_title");function c(){!1===t.checked?(e.classList.add("hidden"),e.style.cssText=null,n.classList.add("hidden"),n.style.cssText=null,s.classList.remove("hidden"),s.style.cssText="display: list-item;"):(e.classList.remove("hidden"),e.style.cssText="display: list-item;",n.classList.remove("hidden"),n.style.cssText="display: list-item;",s.classList.add("hidden"),s.style.cssText=null)}t.addEventListener("click",c),c()}));
* ATTENTION: An "eval-source-map" devtool has been used.
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ (function() { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ "./assets/scripts/customizer-toggle.js":
/*!*********************************************!*\
!*** ./assets/scripts/customizer-toggle.js ***!
\*********************************************/
/***/ (function() {
eval("document.addEventListener('DOMContentLoaded', function () {\n var checkbox = document.getElementById('_customize-input-pb_network_contact_form');\n var email = document.getElementById('customize-control-pb_network_contact_email');\n var link = document.getElementById('customize-control-pb_network_contact_link');\n var title = document.getElementById('customize-control-pb_network_contact_form_title');\n checkbox.addEventListener('click', toggleReadOnly);\n /**\n *\n */\n\n function toggleReadOnly() {\n if (checkbox.checked === false) {\n email.classList.add('hidden');\n email.style.cssText = null;\n title.classList.add('hidden');\n title.style.cssText = null;\n link.classList.remove('hidden');\n link.style.cssText = 'display: list-item;';\n } else {\n email.classList.remove('hidden');\n email.style.cssText = 'display: list-item;';\n title.classList.remove('hidden');\n title.style.cssText = 'display: list-item;';\n link.classList.add('hidden');\n link.style.cssText = null;\n }\n }\n\n toggleReadOnly();\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9AcHJlc3Nib29rcy9wcmVzc2Jvb2tzLWFsZGluZS8uL2Fzc2V0cy9zY3JpcHRzL2N1c3RvbWl6ZXItdG9nZ2xlLmpzP2U0Y2IiXSwibmFtZXMiOlsiZG9jdW1lbnQiLCJhZGRFdmVudExpc3RlbmVyIiwiY2hlY2tib3giLCJnZXRFbGVtZW50QnlJZCIsImVtYWlsIiwibGluayIsInRpdGxlIiwidG9nZ2xlUmVhZE9ubHkiLCJjaGVja2VkIiwiY2xhc3NMaXN0IiwiYWRkIiwic3R5bGUiLCJjc3NUZXh0IiwicmVtb3ZlIl0sIm1hcHBpbmdzIjoiQUFBQUEsUUFBUSxDQUFDQyxnQkFBVCxDQUEyQixrQkFBM0IsRUFBK0MsWUFBWTtBQUMxRCxNQUFJQyxRQUFRLEdBQUdGLFFBQVEsQ0FBQ0csY0FBVCxDQUF5QiwwQ0FBekIsQ0FBZjtBQUNBLE1BQUlDLEtBQUssR0FBR0osUUFBUSxDQUFDRyxjQUFULENBQXlCLDRDQUF6QixDQUFaO0FBQ0EsTUFBSUUsSUFBSSxHQUFHTCxRQUFRLENBQUNHLGNBQVQsQ0FBeUIsMkNBQXpCLENBQVg7QUFDQSxNQUFJRyxLQUFLLEdBQUdOLFFBQVEsQ0FBQ0csY0FBVCxDQUF5QixpREFBekIsQ0FBWjtBQUVBRCxFQUFBQSxRQUFRLENBQUNELGdCQUFULENBQTJCLE9BQTNCLEVBQW9DTSxjQUFwQztBQUVBO0FBQ0Q7QUFDQTs7QUFDQyxXQUFTQSxjQUFULEdBQTBCO0FBQ3pCLFFBQUtMLFFBQVEsQ0FBQ00sT0FBVCxLQUFxQixLQUExQixFQUFrQztBQUNqQ0osTUFBQUEsS0FBSyxDQUFDSyxTQUFOLENBQWdCQyxHQUFoQixDQUFxQixRQUFyQjtBQUNBTixNQUFBQSxLQUFLLENBQUNPLEtBQU4sQ0FBWUMsT0FBWixHQUFzQixJQUF0QjtBQUVBTixNQUFBQSxLQUFLLENBQUNHLFNBQU4sQ0FBZ0JDLEdBQWhCLENBQXFCLFFBQXJCO0FBQ0FKLE1BQUFBLEtBQUssQ0FBQ0ssS0FBTixDQUFZQyxPQUFaLEdBQXNCLElBQXRCO0FBRUFQLE1BQUFBLElBQUksQ0FBQ0ksU0FBTCxDQUFlSSxNQUFmLENBQXVCLFFBQXZCO0FBQ0FSLE1BQUFBLElBQUksQ0FBQ00sS0FBTCxDQUFXQyxPQUFYLEdBQXFCLHFCQUFyQjtBQUNBLEtBVEQsTUFTTztBQUNOUixNQUFBQSxLQUFLLENBQUNLLFNBQU4sQ0FBZ0JJLE1BQWhCLENBQXdCLFFBQXhCO0FBQ0FULE1BQUFBLEtBQUssQ0FBQ08sS0FBTixDQUFZQyxPQUFaLEdBQXNCLHFCQUF0QjtBQUVBTixNQUFBQSxLQUFLLENBQUNHLFNBQU4sQ0FBZ0JJLE1BQWhCLENBQXdCLFFBQXhCO0FBQ0FQLE1BQUFBLEtBQUssQ0FBQ0ssS0FBTixDQUFZQyxPQUFaLEdBQXNCLHFCQUF0QjtBQUVBUCxNQUFBQSxJQUFJLENBQUNJLFNBQUwsQ0FBZUMsR0FBZixDQUFvQixRQUFwQjtBQUNBTCxNQUFBQSxJQUFJLENBQUNNLEtBQUwsQ0FBV0MsT0FBWCxHQUFxQixJQUFyQjtBQUNBO0FBQ0Q7O0FBRURMLEVBQUFBLGNBQWM7QUFFZCxDQW5DRCIsInNvdXJjZXNDb250ZW50IjpbImRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoICdET01Db250ZW50TG9hZGVkJywgZnVuY3Rpb24gKCkge1xuXHRsZXQgY2hlY2tib3ggPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCggJ19jdXN0b21pemUtaW5wdXQtcGJfbmV0d29ya19jb250YWN0X2Zvcm0nICk7XG5cdGxldCBlbWFpbCA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCAnY3VzdG9taXplLWNvbnRyb2wtcGJfbmV0d29ya19jb250YWN0X2VtYWlsJyApO1xuXHRsZXQgbGluayA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCAnY3VzdG9taXplLWNvbnRyb2wtcGJfbmV0d29ya19jb250YWN0X2xpbmsnICk7XG5cdGxldCB0aXRsZSA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCAnY3VzdG9taXplLWNvbnRyb2wtcGJfbmV0d29ya19jb250YWN0X2Zvcm1fdGl0bGUnICk7XG5cblx0Y2hlY2tib3guYWRkRXZlbnRMaXN0ZW5lciggJ2NsaWNrJywgdG9nZ2xlUmVhZE9ubHkgKTtcblxuXHQvKipcblx0ICpcblx0ICovXG5cdGZ1bmN0aW9uIHRvZ2dsZVJlYWRPbmx5KCkge1xuXHRcdGlmICggY2hlY2tib3guY2hlY2tlZCA9PT0gZmFsc2UgKSB7XG5cdFx0XHRlbWFpbC5jbGFzc0xpc3QuYWRkKCAnaGlkZGVuJyApO1xuXHRcdFx0ZW1haWwuc3R5bGUuY3NzVGV4dCA9IG51bGw7XG5cblx0XHRcdHRpdGxlLmNsYXNzTGlzdC5hZGQoICdoaWRkZW4nICk7XG5cdFx0XHR0aXRsZS5zdHlsZS5jc3NUZXh0ID0gbnVsbDtcblxuXHRcdFx0bGluay5jbGFzc0xpc3QucmVtb3ZlKCAnaGlkZGVuJyApO1xuXHRcdFx0bGluay5zdHlsZS5jc3NUZXh0ID0gJ2Rpc3BsYXk6IGxpc3QtaXRlbTsnO1xuXHRcdH0gZWxzZSB7XG5cdFx0XHRlbWFpbC5jbGFzc0xpc3QucmVtb3ZlKCAnaGlkZGVuJyApO1xuXHRcdFx0ZW1haWwuc3R5bGUuY3NzVGV4dCA9ICdkaXNwbGF5OiBsaXN0LWl0ZW07JztcblxuXHRcdFx0dGl0bGUuY2xhc3NMaXN0LnJlbW92ZSggJ2hpZGRlbicgKTtcblx0XHRcdHRpdGxlLnN0eWxlLmNzc1RleHQgPSAnZGlzcGxheTogbGlzdC1pdGVtOyc7XG5cblx0XHRcdGxpbmsuY2xhc3NMaXN0LmFkZCggJ2hpZGRlbicgKTtcblx0XHRcdGxpbmsuc3R5bGUuY3NzVGV4dCA9IG51bGw7XG5cdFx0fVxuXHR9XG5cblx0dG9nZ2xlUmVhZE9ubHkoKTtcblxufSApO1xuIl0sImZpbGUiOiIuL2Fzc2V0cy9zY3JpcHRzL2N1c3RvbWl6ZXItdG9nZ2xlLmpzLmpzIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./assets/scripts/customizer-toggle.js\n");
/***/ })
/******/ });
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module can't be inlined because the eval-source-map devtool is used.
/******/ var __webpack_exports__ = {};
/******/ __webpack_modules__["./assets/scripts/customizer-toggle.js"]();
/******/
/******/ })()
;

33
dist/scripts/customizer.js vendored

@ -1,32 +1 @@
/* wp.customize("blogname",(function(t){t.bind((function(t){return document.querySelector(".home .entry-title").textContent=t}))})),wp.customize("blogdescription",(function(t){t.bind((function(t){return document.querySelector(".home .entry-description").textContent=t}))}));
* ATTENTION: An "eval-source-map" devtool has been used.
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ (function() { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ "./assets/scripts/customizer.js":
/*!**************************************!*\
!*** ./assets/scripts/customizer.js ***!
\**************************************/
/***/ (function() {
eval("wp.customize('blogname', function (value) {\n value.bind(function (to) {\n return document.querySelector('.home .entry-title').textContent = to;\n });\n});\nwp.customize('blogdescription', function (value) {\n value.bind(function (to) {\n return document.querySelector('.home .entry-description').textContent = to;\n });\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9AcHJlc3Nib29rcy9wcmVzc2Jvb2tzLWFsZGluZS8uL2Fzc2V0cy9zY3JpcHRzL2N1c3RvbWl6ZXIuanM/ZWIyMCJdLCJuYW1lcyI6WyJ3cCIsImN1c3RvbWl6ZSIsInZhbHVlIiwiYmluZCIsInRvIiwiZG9jdW1lbnQiLCJxdWVyeVNlbGVjdG9yIiwidGV4dENvbnRlbnQiXSwibWFwcGluZ3MiOiJBQUFBQSxFQUFFLENBQUNDLFNBQUgsQ0FBYyxVQUFkLEVBQTBCLFVBQUFDLEtBQUssRUFBSTtBQUNsQ0EsRUFBQUEsS0FBSyxDQUFDQyxJQUFOLENBQVksVUFBQUMsRUFBRTtBQUFBLFdBQUlDLFFBQVEsQ0FBQ0MsYUFBVCxDQUF3QixvQkFBeEIsRUFBK0NDLFdBQS9DLEdBQTZESCxFQUFqRTtBQUFBLEdBQWQ7QUFDQSxDQUZEO0FBSUFKLEVBQUUsQ0FBQ0MsU0FBSCxDQUFjLGlCQUFkLEVBQWlDLFVBQUFDLEtBQUssRUFBSTtBQUN6Q0EsRUFBQUEsS0FBSyxDQUFDQyxJQUFOLENBQVksVUFBQUMsRUFBRTtBQUFBLFdBQUlDLFFBQVEsQ0FBQ0MsYUFBVCxDQUF3QiwwQkFBeEIsRUFBcURDLFdBQXJELEdBQW1FSCxFQUF2RTtBQUFBLEdBQWQ7QUFDQSxDQUZEIiwic291cmNlc0NvbnRlbnQiOlsid3AuY3VzdG9taXplKCAnYmxvZ25hbWUnLCB2YWx1ZSA9PiB7XG5cdHZhbHVlLmJpbmQoIHRvID0+IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoICcuaG9tZSAuZW50cnktdGl0bGUnICkudGV4dENvbnRlbnQgPSB0byApO1xufSApO1xuXG53cC5jdXN0b21pemUoICdibG9nZGVzY3JpcHRpb24nLCB2YWx1ZSA9PiB7XG5cdHZhbHVlLmJpbmQoIHRvID0+IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoICcuaG9tZSAuZW50cnktZGVzY3JpcHRpb24nICkudGV4dENvbnRlbnQgPSB0byApO1xufSApO1xuIl0sImZpbGUiOiIuL2Fzc2V0cy9zY3JpcHRzL2N1c3RvbWl6ZXIuanMuanMiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./assets/scripts/customizer.js\n");
/***/ })
/******/ });
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module can't be inlined because the eval-source-map devtool is used.
/******/ var __webpack_exports__ = {};
/******/ __webpack_modules__["./assets/scripts/customizer.js"]();
/******/
/******/ })()
;

33
dist/scripts/page-section.js vendored

File diff suppressed because one or more lines are too long

2928
dist/styles/aldine.css vendored

File diff suppressed because one or more lines are too long

385
dist/styles/editor.css vendored

File diff suppressed because one or more lines are too long

28
footer.php

@ -58,32 +58,32 @@ if ( $pb_network_contact_form ) {
<div class="social-media"> <div class="social-media">
<?php if ( ! empty( $network_facebook ) ) { ?> <?php if ( ! empty( $network_facebook ) ) { ?>
<?php /* translators: %s network name */ ?> <?php /* translators: %s network name */ ?>
<a class="facebook" href="<?php echo $network_facebook; ?>" title="<?php printf( __( '%s on Facebook', 'pressbooks-aldine' ), get_bloginfo( 'name', 'display' ) ); ?>"> <a class="facebook" href="<?php echo $network_facebook; ?>" title="<?php printf( esc_html__( '%s on Facebook', 'pressbooks-aldine' ), get_bloginfo( 'name', 'display' ) ); ?>">
<svg class="icon--svg"> <svg class="icon--svg">
<use href="#facebook" /> <use href="#facebook" />
</svg> </svg>
<?php /* translators: %s network name */ ?> <?php /* translators: %s network name */ ?>
<span class="screen-reader-text"><?php printf( __( '%s on Facebook', 'pressbooks-aldine' ), get_bloginfo( 'name', 'display' ) ); ?></span> <span class="screen-reader-text"><?php printf( esc_html__( '%s on Facebook', 'pressbooks-aldine' ), get_bloginfo( 'name', 'display' ) ); ?></span>
</a> </a>
<?php } ?> <?php } ?>
<?php if ( ! empty( $network_twitter ) ) { ?> <?php if ( ! empty( $network_twitter ) ) { ?>
<?php /* translators: %s network name */ ?> <?php /* translators: %s network name */ ?>
<a class="twitter" href="<?php echo $network_twitter; ?>" title="<?php printf( __( '%s on Twitter', 'pressbooks-aldine' ), get_bloginfo( 'name', 'display' ) ); ?>"> <a class="twitter" href="<?php echo $network_twitter; ?>" title="<?php printf( esc_html__( '%s on Twitter', 'pressbooks-aldine' ), get_bloginfo( 'name', 'display' ) ); ?>">
<svg class="icon--svg"> <svg class="icon--svg">
<use href="#twitter" /> <use href="#twitter" />
</svg> </svg>
<?php /* translators: %s network name */ ?> <?php /* translators: %s network name */ ?>
<span class="screen-reader-text"><?php printf( __( '%s on Twitter', 'pressbooks-aldine' ), get_bloginfo( 'name', 'display' ) ); ?></span> <span class="screen-reader-text"><?php printf( esc_html__( '%s on Twitter', 'pressbooks-aldine' ), get_bloginfo( 'name', 'display' ) ); ?></span>
</a> </a>
<?php } ?> <?php } ?>
<?php if ( ! empty( $network_instagram ) ) { ?> <?php if ( ! empty( $network_instagram ) ) { ?>
<?php /* translators: %s network name */ ?> <?php /* translators: %s network name */ ?>
<a class="instagram" href="<?php echo $network_instagram; ?>" title="<?php printf( __( '%s on Instagram', 'pressbooks-aldine' ), get_bloginfo( 'name', 'display' ) ); ?>"> <a class="instagram" href="<?php echo $network_instagram; ?>" title="<?php printf( esc_html__( '%s on Instagram', 'pressbooks-aldine' ), get_bloginfo( 'name', 'display' ) ); ?>">
<svg class="icon--svg"> <svg class="icon--svg">
<use href="#instagram" /> <use href="#instagram" />
</svg> </svg>
<?php /* translators: %s network name */ ?> <?php /* translators: %s network name */ ?>
<span class="screen-reader-text"><?php printf( __( '%s on Instagram', 'pressbooks-aldine' ), get_bloginfo( 'name', 'display' ) ); ?></span> <span class="screen-reader-text"><?php printf( esc_html__( '%s on Instagram', 'pressbooks-aldine' ), get_bloginfo( 'name', 'display' ) ); ?></span>
</a> </a>
<?php } ?> <?php } ?>
</div> </div>
@ -102,25 +102,25 @@ if ( $pb_network_contact_form ) {
</a> </a>
<div class="footer__pressbooks__links"> <div class="footer__pressbooks__links">
<?php /* translators: %s Pressbooks */ ?> <?php /* translators: %s Pressbooks */ ?>
<p class="footer__pressbooks__links__title"><a href="https://pressbooks.com"><?php printf( __( 'Powered by %s', 'pressbooks-aldine' ), '<span class="pressbooks">Pressbooks</span>' ); ?></a></p> <p class="footer__pressbooks__links__title"><a href="https://pressbooks.com"><?php printf( esc_html__( 'Powered by %s', 'pressbooks-aldine' ), '<span class="pressbooks">Pressbooks</span>' ); ?></a></p>
<ul class="footer__pressbooks__links__list"> <ul class="footer__pressbooks__links__list">
<li class="footer__pressbooks__links__list-item footer__pressbooks__links__list-item-guide-tutorials"><a href="https://pressbooks.com/support/"><?php _e( 'Guides and Tutorials', 'pressbooks-aldine' ); ?></a></li> <li class="footer__pressbooks__links__list-item footer__pressbooks__links__list-item-guide-tutorials"><a href="https://pressbooks.com/support/"><?php esc_html_e( 'Guides and Tutorials', 'pressbooks-aldine' ); ?></a></li>
<li class="footer__pressbooks__links__list-item footer__pressbooks__links__list-item-pressbooks-directory">|<a href="https://pressbooks.directory"><?php _e( 'Pressbooks Directory', 'pressbooks-aldine' ); ?></a></li> <li class="footer__pressbooks__links__list-item footer__pressbooks__links__list-item-pressbooks-directory">|<a href="https://pressbooks.directory"><?php esc_html_e( 'Pressbooks Directory', 'pressbooks-aldine' ); ?></a></li>
<?php if ( $contact_link ) : ?> <?php if ( $contact_link ) : ?>
<li class="footer__pressbooks__links__list-item footer__pressbooks__links__list-item-contact">|<a href="<?php echo $contact_link; ?>"><?php _e( 'Contact', 'pressbooks-aldine' ); ?></a></li> <li class="footer__pressbooks__links__list-item footer__pressbooks__links__list-item-contact">|<a href="<?php echo $contact_link; ?>"><?php esc_html_e( 'Contact', 'pressbooks-aldine' ); ?></a></li>
<?php endif; ?> <?php endif; ?>
</ul> </ul>
</div> </div>
<div class="footer__pressbooks__social"> <div class="footer__pressbooks__social">
<a class="facebook" href="https://www.youtube.com/user/pressbooks" title="<?php _e( 'Pressbooks on YouTube', 'pressbooks-aldine' ); ?>"> <a class="facebook" href="https://www.youtube.com/user/pressbooks" title="<?php esc_html_e( 'Pressbooks on YouTube', 'pressbooks-aldine' ); ?>">
<img class="youtube-link" src="<?php bloginfo( 'template_directory' ); ?>/assets/images/yt_icon_mono_dark.png" alt="YouTube"> <img class="youtube-link" src="<?php bloginfo( 'template_directory' ); ?>/assets/images/yt_icon_mono_dark.png" alt="YouTube">
<span class="screen-reader-text"><?php _e( 'Pressbooks on YouTube', 'pressbooks-aldine' ); ?></span> <span class="screen-reader-text"><?php esc_html_e( 'Pressbooks on YouTube', 'pressbooks-aldine' ); ?></span>
</a> </a>
<a class="twitter" href="https://twitter.com/intent/follow?screen_name=pressbooks" title="<?php _e( 'Pressbooks on Twitter', 'pressbooks-aldine' ); ?>"> <a class="twitter" href="https://twitter.com/intent/follow?screen_name=pressbooks" title="<?php esc_html_e( 'Pressbooks on Twitter', 'pressbooks-aldine' ); ?>">
<svg class="icon--svg"> <svg class="icon--svg">
<use href="#twitter" /> <use href="#twitter" />
</svg> </svg>
<span class="screen-reader-text"><?php _e( 'Pressbooks on Twitter', 'pressbooks-aldine' ); ?></span></a> <span class="screen-reader-text"><?php esc_html_e( 'Pressbooks on Twitter', 'pressbooks-aldine' ); ?></span></a>
</div> </div>
</section> </section>
</div><!-- .container --> </div><!-- .container -->

4
header.php

@ -67,7 +67,7 @@
wp_get_attachment_image_src( $custom_logo_id, 'logo' )[0], wp_get_attachment_image_src( $custom_logo_id, 'logo' )[0],
wp_get_attachment_image_srcset( $custom_logo_id, 'large' ), wp_get_attachment_image_srcset( $custom_logo_id, 'large' ),
/* translators: %s name of network */ /* translators: %s name of network */
sprintf( __( 'Logo for %s', 'pressbooks-aldine' ), get_bloginfo( 'name', 'display' ) ) sprintf( esc_html__( 'Logo for %s', 'pressbooks-aldine' ), get_bloginfo( 'name', 'display' ) )
); );
?> ?>
<?php } else { ?> <?php } else { ?>
@ -78,7 +78,7 @@
</a> </a>
</div> </div>
<div class="header__nav"> <div class="header__nav">
<a class="header__nav-icon js-header-nav-toggle" href="#navigation"><?php _e( 'Toggle Menu', 'pressbooks-aldine' ); ?><span class="header__nav-icon__icon"></span></a> <a class="header__nav-icon js-header-nav-toggle" href="#navigation"><?php esc_html_e( 'Toggle Menu', 'pressbooks-aldine' ); ?><span class="header__nav-icon__icon"></span></a>
<?php <?php
wp_nav_menu( wp_nav_menu(
[ [

32
inc/actions/namespace.php

@ -45,8 +45,8 @@ function setup() {
// This theme uses wp_nav_menu() in two locations. // This theme uses wp_nav_menu() in two locations.
register_nav_menus( register_nav_menus(
[ [
'primary-menu' => __( 'Primary Menu', 'pressbooks-aldine' ), 'primary-menu' => esc_html__( 'Primary Menu', 'pressbooks-aldine' ),
'network-footer-menu' => __( 'Footer Menu', 'pressbooks-aldine' ), 'network-footer-menu' => esc_html__( 'Footer Menu', 'pressbooks-aldine' ),
] ]
); );
@ -119,8 +119,8 @@ function widgets_init() {
]; ];
register_sidebar( register_sidebar(
[ [
'name' => __( 'Network Footer Block 1', 'pressbooks-aldine' ), 'name' => esc_html__( 'Network Footer Block 1', 'pressbooks-aldine' ),
'description' => __( 'description' => esc_html__(
'Add content for your network&rsquo;s customizeable footer here. 'Add content for your network&rsquo;s customizeable footer here.
Currently, only text and image widgets are supported. Currently, only text and image widgets are supported.
Content in this widget area will appear in the first row (on mobile) or the first column (on desktops).', Content in this widget area will appear in the first row (on mobile) or the first column (on desktops).',
@ -131,8 +131,8 @@ function widgets_init() {
); );
register_sidebar( register_sidebar(
[ [
'name' => __( 'Network Footer Block 2', 'pressbooks-aldine' ), 'name' => esc_html__( 'Network Footer Block 2', 'pressbooks-aldine' ),
'description' => __( 'description' => esc_html__(
'Add content for your network&rsquo;s customizeable footer here. 'Add content for your network&rsquo;s customizeable footer here.
Currently, only text and image widgets are supported. Currently, only text and image widgets are supported.
Content in this widget area will appear in the second row (on mobile) or the middle column (on desktop).', Content in this widget area will appear in the second row (on mobile) or the middle column (on desktop).',
@ -234,7 +234,7 @@ function hide_catalog_content_editor() {
if ( $pagename === 'Catalog' ) { if ( $pagename === 'Catalog' ) {
add_action( add_action(
'edit_form_after_title', function() { 'edit_form_after_title', function() {
printf( '<p>%s</p>', __( 'This page displays your network catalog, so there is no content to edit.', 'pressbooks-aldine' ) ); printf( '<p>%s</p>', esc_html__( 'This page displays your network catalog, so there is no content to edit.', 'pressbooks-aldine' ) );
} }
); );
remove_post_type_support( 'page', 'editor' ); remove_post_type_support( 'page', 'editor' );
@ -291,17 +291,17 @@ function tinymce_l18n() {
<script type='text/javascript'> <script type='text/javascript'>
const aldine = { const aldine = {
page_section: { page_section: {
'title': '<?php _e( 'Page Section', 'pressbooks-aldine' ); ?>', 'title': '<?php esc_html_e( 'Page Section', 'pressbooks-aldine' ); ?>',
'title_label': '<?php _e( 'Title', 'pressbooks-aldine' ); ?>', 'title_label': '<?php esc_html_e( 'Title', 'pressbooks-aldine' ); ?>',
'standard': '<?php _e( 'Standard', 'pressbooks-aldine' ); ?>', 'standard': '<?php esc_html_e( 'Standard', 'pressbooks-aldine' ); ?>',
'accent': '<?php _e( 'Accent', 'pressbooks-aldine' ); ?>', 'accent': '<?php esc_html_e( 'Accent', 'pressbooks-aldine' ); ?>',
'bordered': '<?php _e( 'Bordered', 'pressbooks-aldine' ); ?>', 'bordered': '<?php esc_html_e( 'Bordered', 'pressbooks-aldine' ); ?>',
'borderless': '<?php _e( 'Borderless', 'pressbooks-aldine' ); ?>' 'borderless': '<?php esc_html_e( 'Borderless', 'pressbooks-aldine' ); ?>'
}, },
call_to_action: { call_to_action: {
'title': '<?php _e( 'Call to Action', 'pressbooks-aldine' ); ?>', 'title': '<?php esc_html_e( 'Call to Action', 'pressbooks-aldine' ); ?>',
'text': '<?php _e( 'Text', 'pressbooks-aldine' ); ?>', 'text': '<?php esc_html_e( 'Text', 'pressbooks-aldine' ); ?>',
'link': '<?php _e( 'Link', 'pressbooks-aldine' ); ?>' 'link': '<?php esc_html_e( 'Link', 'pressbooks-aldine' ); ?>'
} }
}; };
</script> </script>

48
inc/activation/namespace.php

@ -32,7 +32,7 @@ function create_default_content() {
$default_pages = [ $default_pages = [
'about' => [ 'about' => [
'post_title' => __( 'About', 'pressbooks-aldine' ), 'post_title' => esc_html__( 'About', 'pressbooks-aldine' ),
'post_content' => apply_filters( 'post_content' => apply_filters(
'pb_root_about_page_content', 'pb_root_about_page_content',
sprintf( sprintf(
@ -42,14 +42,14 @@ function create_default_content() {
sprintf( sprintf(
/* translators: %1$s: link to Pressbooks product page; %2$2: link to Pressbooks getting started page */ /* translators: %1$s: link to Pressbooks product page; %2$2: link to Pressbooks getting started page */
__( 'Pressbooks\' %1$s are used by hundreds of educational institutions and thousands of individual authors and publishers around the world. %2$s to learn more about how you or your institution can get started with Pressbooks.', 'pressbooks' ), __( 'Pressbooks\' %1$s are used by hundreds of educational institutions and thousands of individual authors and publishers around the world. %2$s to learn more about how you or your institution can get started with Pressbooks.', 'pressbooks' ),
sprintf( '<a href="https://pressbooks.com/our-products/">%s</a>', __( 'suite of products', 'pressbooks-aldine' ) ), sprintf( '<a href="https://pressbooks.com/our-products/">%s</a>', esc_html__( 'suite of products', 'pressbooks-aldine' ) ),
sprintf( '<a href="https://pressbooks.com/get-started/">%s</a>', __( 'Contact us', 'pressbooks-aldine' ) ) sprintf( '<a href="https://pressbooks.com/get-started/">%s</a>', esc_html__( 'Contact us', 'pressbooks-aldine' ) )
) )
) )
), ),
], ],
'help' => [ 'help' => [
'post_title' => __( 'Help', 'pressbooks-aldine' ), 'post_title' => esc_html__( 'Help', 'pressbooks-aldine' ),
'post_content' => apply_filters( 'post_content' => apply_filters(
'pb_root_help_page_content', 'pb_root_help_page_content',
sprintf( sprintf(
@ -57,43 +57,43 @@ function create_default_content() {
sprintf( sprintf(
/* translators: %s: link to guide */ /* translators: %s: link to guide */
__( 'Are you looking for help on your Pressbooks project? The most comprehensive resource available is the %s, which contains everything you need to know about creating, enriching and exporting your work.', 'pressbooks-aldine' ), __( 'Are you looking for help on your Pressbooks project? The most comprehensive resource available is the %s, which contains everything you need to know about creating, enriching and exporting your work.', 'pressbooks-aldine' ),
sprintf( '<a href="https://guide.pressbooks.com/">%s</a>', __( 'Pressbooks User Guide', 'pressbooks-aldine' ) ) sprintf( '<a href="https://guide.pressbooks.com/">%s</a>', esc_html__( 'Pressbooks User Guide', 'pressbooks-aldine' ) )
), ),
sprintf( sprintf(
/* translators: %1$s: link to Pressbooks YouTube channel; %2$s: link to Fundamental of Pressbooks YouTube playlist */ /* translators: %1$s: link to Pressbooks YouTube channel; %2$s: link to Fundamental of Pressbooks YouTube playlist */
__( 'You can find short video tutorials and webinars about features and product updates on the %1$s. If you’re just getting started with Pressbooks, this %2$s will guide you.', 'pressbooks-aldine' ), __( 'You can find short video tutorials and webinars about features and product updates on the %1$s. If you’re just getting started with Pressbooks, this %2$s will guide you.', 'pressbooks-aldine' ),
sprintf( '<a href="https://www.youtube.com/c/Pressbooks">%s</a>', __( 'Pressbooks YouTube channel', 'pressbooks-aldine' ) ), sprintf( '<a href="https://www.youtube.com/c/Pressbooks">%s</a>', esc_html__( 'Pressbooks YouTube channel', 'pressbooks-aldine' ) ),
sprintf( '<a href="https://www.youtube.com/playlist?list=PLMFmJu3NJheuRt1rZwNCEElROtSjc5dJG">%s</a>', __( 'short video series', 'pressbooks-aldine' ) ) sprintf( '<a href="https://www.youtube.com/playlist?list=PLMFmJu3NJheuRt1rZwNCEElROtSjc5dJG">%s</a>', esc_html__( 'short video series', 'pressbooks-aldine' ) )
), ),
sprintf( sprintf(
/* translators: %s: link to Pressbooks webinar schedule */ /* translators: %s: link to Pressbooks webinar schedule */
__( 'If you learn best by learning by attending live training sessions, you can register for and attend one of Pressbooks\' %s.', 'pressbooks-aldine' ), __( 'If you learn best by learning by attending live training sessions, you can register for and attend one of Pressbooks\' %s.', 'pressbooks-aldine' ),
sprintf( '<a href="https://pressbooks.com/webinars/">%s</a>', __( 'monthly webinars', 'pressbooks-aldine' ) ) sprintf( '<a href="https://pressbooks.com/webinars/">%s</a>', esc_html__( 'monthly webinars', 'pressbooks-aldine' ) )
), ),
sprintf( sprintf(
/* translators: %1$s: link to Pressbooks support page; %2$s: link to Pressbooks community forum */ /* translators: %1$s: link to Pressbooks support page; %2$s: link to Pressbooks community forum */
__( 'The %1$s also contains links to other useful support resources and has answers to some commonly asked questions. Pressbooks also maintains a %2$s where you can ask and answer questions of other users.', 'pressbooks-aldine' ), __( 'The %1$s also contains links to other useful support resources and has answers to some commonly asked questions. Pressbooks also maintains a %2$s where you can ask and answer questions of other users.', 'pressbooks-aldine' ),
sprintf( '<a href="https://pressbooks.com/support/">%s</a>', __( 'Pressbooks support page', 'pressbooks-aldine' ) ), sprintf( '<a href="https://pressbooks.com/support/">%s</a>', esc_html__( 'Pressbooks support page', 'pressbooks-aldine' ) ),
sprintf( '<a href="https://pressbooks.community/">%s</a>', __( 'community forum', 'pressbooks-aldine' ) ) sprintf( '<a href="https://pressbooks.community/">%s</a>', esc_html__( 'community forum', 'pressbooks-aldine' ) )
), ),
sprintf( sprintf(
/* translators: %s: link to Pressbooks support request form */ /* translators: %s: link to Pressbooks support request form */
__( 'For additional support needs, reach out to your institution’s Pressbooks network managers. If you don’t know who your network managers are, please fill out the %s to be put in touch with them.', 'pressbooks-aldine' ), __( 'For additional support needs, reach out to your institution’s Pressbooks network managers. If you don’t know who your network managers are, please fill out the %s to be put in touch with them.', 'pressbooks-aldine' ),
sprintf( '<a href="https://pressbooks.com/pressbooksedu-support/">%s</a>', __( 'support request form', 'pressbooks-aldine' ) ) sprintf( '<a href="https://pressbooks.com/pressbooksedu-support/">%s</a>', esc_html__( 'support request form', 'pressbooks-aldine' ) )
) )
) )
), ),
], ],
'catalog' => [ 'catalog' => [
'post_title' => __( 'Catalog', 'pressbooks-aldine' ), 'post_title' => esc_html__( 'Catalog', 'pressbooks-aldine' ),
'post_content' => '', 'post_content' => '',
], ],
'home' => [ 'home' => [
'post_title' => __( 'Home', 'pressbooks-aldine' ), 'post_title' => esc_html__( 'Home', 'pressbooks-aldine' ),
'post_content' => $home_content, 'post_content' => $home_content,
], ],
'auth' => [ 'auth' => [
'post_title' => __( 'Auth', 'pressbooks-aldine' ), 'post_title' => esc_html__( 'Auth', 'pressbooks-aldine' ),
'post_content' => '', 'post_content' => '',
], ],
]; ];
@ -140,18 +140,18 @@ function create_default_content() {
* Create default primary and footer menus. * Create default primary and footer menus.
*/ */
function create_menus() { function create_menus() {
$menu_name = __( 'Primary Menu', 'pressbooks-aldine' ); $menu_name = esc_html__( 'Primary Menu', 'pressbooks-aldine' );
if ( ! wp_get_nav_menu_object( $menu_name ) ) { if ( ! wp_get_nav_menu_object( $menu_name ) ) {
$menu_id = wp_create_nav_menu( $menu_name ); $menu_id = wp_create_nav_menu( $menu_name );
$catalog = get_page_by_title( __( 'Catalog', 'pressbooks-aldine' ) ); $catalog = get_page_by_title( esc_html__( 'Catalog', 'pressbooks-aldine' ) );
if ( $catalog && defined( 'PB_PLUGIN_VERSION' ) ) { if ( $catalog && defined( 'PB_PLUGIN_VERSION' ) ) {
wp_update_nav_menu_item( wp_update_nav_menu_item(
$menu_id, $menu_id,
0, 0,
[ [
'menu-item-title' => __( 'Catalog', 'pressbooks-aldine' ), 'menu-item-title' => esc_html__( 'Catalog', 'pressbooks-aldine' ),
'menu-item-type' => 'post_type', 'menu-item-type' => 'post_type',
'menu-item-object' => 'page', 'menu-item-object' => 'page',
'menu-item-object-id' => $catalog->ID, 'menu-item-object-id' => $catalog->ID,
@ -161,18 +161,18 @@ function create_menus() {
} }
} }
$menu_name = __( 'Footer Menu', 'pressbooks-aldine' ); $menu_name = esc_html__( 'Footer Menu', 'pressbooks-aldine' );
if ( ! wp_get_nav_menu_object( $menu_name ) ) { if ( ! wp_get_nav_menu_object( $menu_name ) ) {
$menu_id = wp_create_nav_menu( $menu_name ); $menu_id = wp_create_nav_menu( $menu_name );
$about = get_page_by_title( __( 'About', 'pressbooks-aldine' ) ); $about = get_page_by_title( esc_html__( 'About', 'pressbooks-aldine' ) );
if ( $about ) { if ( $about ) {
wp_update_nav_menu_item( wp_update_nav_menu_item(
$menu_id, $menu_id,
0, 0,
[ [
'menu-item-title' => __( 'About', 'pressbooks-aldine' ), 'menu-item-title' => esc_html__( 'About', 'pressbooks-aldine' ),
'menu-item-type' => 'post_type', 'menu-item-type' => 'post_type',
'menu-item-object' => 'page', 'menu-item-object' => 'page',
'menu-item-object-id' => $about->ID, 'menu-item-object-id' => $about->ID,
@ -181,13 +181,13 @@ function create_menus() {
); );
} }
$catalog = get_page_by_title( __( 'Catalog', 'pressbooks-aldine' ) ); $catalog = get_page_by_title( esc_html__( 'Catalog', 'pressbooks-aldine' ) );
if ( $catalog && defined( 'PB_PLUGIN_VERSION' ) ) { if ( $catalog && defined( 'PB_PLUGIN_VERSION' ) ) {
wp_update_nav_menu_item( wp_update_nav_menu_item(
$menu_id, $menu_id,
0, 0,
[ [
'menu-item-title' => __( 'Catalog', 'pressbooks-aldine' ), 'menu-item-title' => esc_html__( 'Catalog', 'pressbooks-aldine' ),
'menu-item-type' => 'post_type', 'menu-item-type' => 'post_type',
'menu-item-object' => 'page', 'menu-item-object' => 'page',
'menu-item-object-id' => $catalog->ID, 'menu-item-object-id' => $catalog->ID,
@ -196,13 +196,13 @@ function create_menus() {
); );
} }
$help = get_page_by_title( __( 'Help', 'pressbooks-aldine' ) ); $help = get_page_by_title( esc_html__( 'Help', 'pressbooks-aldine' ) );
if ( $help ) { if ( $help ) {
wp_update_nav_menu_item( wp_update_nav_menu_item(
$menu_id, $menu_id,
0, 0,
[ [
'menu-item-title' => __( 'Help', 'pressbooks-aldine' ), 'menu-item-title' => esc_html__( 'Help', 'pressbooks-aldine' ),
'menu-item-type' => 'post_type', 'menu-item-type' => 'post_type',
'menu-item-object' => 'page', 'menu-item-object' => 'page',
'menu-item-object-id' => $help->ID, 'menu-item-object-id' => $help->ID,

8
inc/admin/namespace.php

@ -34,9 +34,9 @@ function admin_scripts( $hook ) {
wp_localize_script( wp_localize_script(
'pressbooks-aldine-admin', 'PB_Aldine_Admin', [ 'pressbooks-aldine-admin', 'PB_Aldine_Admin', [
'aldineAdminNonce' => wp_create_nonce( 'pressbooks-aldine-admin' ), 'aldineAdminNonce' => wp_create_nonce( 'pressbooks-aldine-admin' ),
'catalog_updated' => __( 'Catalog updated.', 'pressbooks-aldine' ), 'catalog_updated' => esc_html__( 'Catalog updated.', 'pressbooks-aldine' ),
'catalog_not_updated' => __( 'Sorry, but your catalog was not updated. Please try again.', 'pressbooks-aldine' ), 'catalog_not_updated' => esc_html__( 'Sorry, but your catalog was not updated. Please try again.', 'pressbooks-aldine' ),
'dismiss_notice' => __( 'Dismiss this notice.', 'pressbooks-aldine' ), 'dismiss_notice' => esc_html__( 'Dismiss this notice.', 'pressbooks-aldine' ),
] ]
); );
} }
@ -80,7 +80,7 @@ function update_catalog() {
* @return array * @return array
*/ */
function catalog_columns( $columns ) { function catalog_columns( $columns ) {
$columns['in_catalog'] = __( 'In Catalog', 'pressbooks-aldine' ); $columns['in_catalog'] = esc_html__( 'In Catalog', 'pressbooks-aldine' );
return $columns; return $columns;
} }

52
inc/customizer/namespace.php

@ -68,38 +68,38 @@ function customize_register( \WP_Customize_Manager $wp_customize ) {
[ [
'slug' => 'primary', 'slug' => 'primary',
'hex' => '#b01109', 'hex' => '#b01109',
'label' => __( 'Primary Color', 'pressbooks-aldine' ), 'label' => esc_html__( 'Primary Color', 'pressbooks-aldine' ),
'description' => __( 'Primary color, used for links and other primary elements.', 'pressbooks-aldine' ), 'description' => esc_html__( 'Primary color, used for links and other primary elements.', 'pressbooks-aldine' ),
], ],
[ [
'slug' => 'primary_dark', 'slug' => 'primary_dark',
'hex' => '#7f0c07', 'hex' => '#7f0c07',
'label' => __( 'Primary Color (Hover)', 'pressbooks-aldine' ), 'label' => esc_html__( 'Primary Color (Hover)', 'pressbooks-aldine' ),
'description' => __( 'Variant of the primary color, used for primary element hover states.', 'pressbooks-aldine' ), 'description' => esc_html__( 'Variant of the primary color, used for primary element hover states.', 'pressbooks-aldine' ),
], ],
[ [
'slug' => 'accent', 'slug' => 'accent',
'hex' => '#015d75', 'hex' => '#015d75',
'label' => __( 'Accent Color', 'pressbooks-aldine' ), 'label' => esc_html__( 'Accent Color', 'pressbooks-aldine' ),
'description' => __( 'Accent color, used for flourishes and secondary elements.', 'pressbooks-aldine' ), 'description' => esc_html__( 'Accent color, used for flourishes and secondary elements.', 'pressbooks-aldine' ),
], ],
[ [
'slug' => 'accent_dark', 'slug' => 'accent_dark',
'hex' => '#013542', 'hex' => '#013542',
'label' => __( 'Accent Color (Hover)', 'pressbooks-aldine' ), 'label' => esc_html__( 'Accent Color (Hover)', 'pressbooks-aldine' ),
'description' => __( 'Variant of the accent color, used for secondary element hover states.', 'pressbooks-aldine' ), 'description' => esc_html__( 'Variant of the accent color, used for secondary element hover states.', 'pressbooks-aldine' ),
], ],
[ [
'slug' => 'primary_fg', 'slug' => 'primary_fg',
'hex' => '#ffffff', 'hex' => '#ffffff',
'label' => __( 'Primary Foreground Color', 'pressbooks-aldine' ), 'label' => esc_html__( 'Primary Foreground Color', 'pressbooks-aldine' ),
'description' => __( 'Used for text on a primary background.', 'pressbooks-aldine' ), 'description' => esc_html__( 'Used for text on a primary background.', 'pressbooks-aldine' ),
], ],
[ [
'slug' => 'accent_fg', 'slug' => 'accent_fg',
'hex' => '#ffffff', 'hex' => '#ffffff',
'label' => __( 'Accent Foreground Color', 'pressbooks-aldine' ), 'label' => esc_html__( 'Accent Foreground Color', 'pressbooks-aldine' ),
'description' => __( 'Used for text on an accent color background.', 'pressbooks-aldine' ), 'description' => esc_html__( 'Used for text on an accent color background.', 'pressbooks-aldine' ),
], ],
] as $color ) { ] as $color ) {
$wp_customize->add_setting( $wp_customize->add_setting(
@ -123,7 +123,7 @@ function customize_register( \WP_Customize_Manager $wp_customize ) {
} }
$wp_customize->add_section( $wp_customize->add_section(
'pb_network_social', [ 'pb_network_social', [
'title' => __( 'Social Media', 'pressbooks-aldine' ), 'title' => esc_html__( 'Social Media', 'pressbooks-aldine' ),
'priority' => 30, 'priority' => 30,
] ]
); );
@ -135,7 +135,7 @@ function customize_register( \WP_Customize_Manager $wp_customize ) {
); );
$wp_customize->add_control( $wp_customize->add_control(
'pb_network_facebook', [ 'pb_network_facebook', [
'label' => __( 'Facebook', 'pressbooks-aldine' ), 'label' => esc_html__( 'Facebook', 'pressbooks-aldine' ),
'section' => 'pb_network_social', 'section' => 'pb_network_social',
'settings' => 'pb_network_facebook', 'settings' => 'pb_network_facebook',
] ]
@ -148,7 +148,7 @@ function customize_register( \WP_Customize_Manager $wp_customize ) {
); );
$wp_customize->add_control( $wp_customize->add_control(
'pb_network_twitter', [ 'pb_network_twitter', [
'label' => __( 'Twitter', 'pressbooks-aldine' ), 'label' => esc_html__( 'Twitter', 'pressbooks-aldine' ),
'section' => 'pb_network_social', 'section' => 'pb_network_social',
'settings' => 'pb_network_twitter', 'settings' => 'pb_network_twitter',
] ]
@ -161,7 +161,7 @@ function customize_register( \WP_Customize_Manager $wp_customize ) {
); );
$wp_customize->add_control( $wp_customize->add_control(
'pb_network_instagram', [ 'pb_network_instagram', [
'label' => __( 'Instagram', 'pressbooks-aldine' ), 'label' => esc_html__( 'Instagram', 'pressbooks-aldine' ),
'section' => 'pb_network_social', 'section' => 'pb_network_social',
'settings' => 'pb_network_instagram', 'settings' => 'pb_network_instagram',
] ]
@ -170,7 +170,7 @@ function customize_register( \WP_Customize_Manager $wp_customize ) {
if ( defined( 'PB_PLUGIN_VERSION' ) ) { if ( defined( 'PB_PLUGIN_VERSION' ) ) {
$wp_customize->add_section( $wp_customize->add_section(
'pb_front_page_catalog', [ 'pb_front_page_catalog', [
'title' => __( 'Front Page Catalog', 'pressbooks-aldine' ), 'title' => esc_html__( 'Front Page Catalog', 'pressbooks-aldine' ),
'priority' => 25, 'priority' => 25,
] ]
); );
@ -181,7 +181,7 @@ function customize_register( \WP_Customize_Manager $wp_customize ) {
); );
$wp_customize->add_control( $wp_customize->add_control(
'pb_front_page_catalog', [ 'pb_front_page_catalog', [
'label' => __( 'Show Front Page Catalog', 'pressbooks-aldine' ), 'label' => esc_html__( 'Show Front Page Catalog', 'pressbooks-aldine' ),
'section' => 'pb_front_page_catalog', 'section' => 'pb_front_page_catalog',
'settings' => 'pb_front_page_catalog', 'settings' => 'pb_front_page_catalog',
'type' => 'checkbox', 'type' => 'checkbox',
@ -191,12 +191,12 @@ function customize_register( \WP_Customize_Manager $wp_customize ) {
'pb_front_page_catalog_title', [ 'pb_front_page_catalog_title', [
'type' => 'option', 'type' => 'option',
'sanitize_callback' => 'sanitize_text_field', 'sanitize_callback' => 'sanitize_text_field',
'default' => __( 'Our Latest Titles', 'pressbooks-aldine' ), 'default' => esc_html__( 'Our Latest Titles', 'pressbooks-aldine' ),
] ]
); );
$wp_customize->add_control( $wp_customize->add_control(
'pb_front_page_catalog_title', [ 'pb_front_page_catalog_title', [
'label' => __( 'Front Page Catalog Title', 'pressbooks-aldine' ), 'label' => esc_html__( 'Front Page Catalog Title', 'pressbooks-aldine' ),
'section' => 'pb_front_page_catalog', 'section' => 'pb_front_page_catalog',
'settings' => 'pb_front_page_catalog_title', 'settings' => 'pb_front_page_catalog_title',
] ]
@ -205,7 +205,7 @@ function customize_register( \WP_Customize_Manager $wp_customize ) {
$wp_customize->add_section( $wp_customize->add_section(
'pb_network_contact_form', [ 'pb_network_contact_form', [
'title' => __( 'Contact Form', 'pressbooks-aldine' ), 'title' => esc_html__( 'Contact Form', 'pressbooks-aldine' ),
'priority' => 25, 'priority' => 25,
] ]
); );
@ -216,7 +216,7 @@ function customize_register( \WP_Customize_Manager $wp_customize ) {
); );
$wp_customize->add_control( $wp_customize->add_control(
'pb_network_contact_form', [ 'pb_network_contact_form', [
'label' => __( 'Show Contact Form', 'pressbooks-aldine' ), 'label' => esc_html__( 'Show Contact Form', 'pressbooks-aldine' ),
'section' => 'pb_network_contact_form', 'section' => 'pb_network_contact_form',
'settings' => 'pb_network_contact_form', 'settings' => 'pb_network_contact_form',
'type' => 'checkbox', 'type' => 'checkbox',
@ -226,12 +226,12 @@ function customize_register( \WP_Customize_Manager $wp_customize ) {
'pb_network_contact_form_title', [ 'pb_network_contact_form_title', [
'type' => 'option', 'type' => 'option',
'sanitize_callback' => 'sanitize_text_field', 'sanitize_callback' => 'sanitize_text_field',
'default' => __( 'Contact Us', 'pressbooks-aldine' ), 'default' => esc_html__( 'Contact Us', 'pressbooks-aldine' ),
] ]
); );
$wp_customize->add_control( $wp_customize->add_control(
'pb_network_contact_form_title', [ 'pb_network_contact_form_title', [
'label' => __( 'Contact Form Title', 'pressbooks-aldine' ), 'label' => esc_html__( 'Contact Form Title', 'pressbooks-aldine' ),
'section' => 'pb_network_contact_form', 'section' => 'pb_network_contact_form',
'settings' => 'pb_network_contact_form_title', 'settings' => 'pb_network_contact_form_title',
] ]
@ -245,7 +245,7 @@ function customize_register( \WP_Customize_Manager $wp_customize ) {
); );
$wp_customize->add_control( $wp_customize->add_control(
'pb_network_contact_email', [ 'pb_network_contact_email', [
'label' => __( 'Contact Email', 'pressbooks-aldine' ), 'label' => esc_html__( 'Contact Email', 'pressbooks-aldine' ),
'section' => 'pb_network_contact_form', 'section' => 'pb_network_contact_form',
'settings' => 'pb_network_contact_email', 'settings' => 'pb_network_contact_email',
] ]
@ -257,7 +257,7 @@ function customize_register( \WP_Customize_Manager $wp_customize ) {
); );
$wp_customize->add_control( $wp_customize->add_control(
'pb_network_contact_link', [ 'pb_network_contact_link', [
'label' => __( 'Contact Link', 'pressbooks-aldine' ), 'label' => esc_html__( 'Contact Link', 'pressbooks-aldine' ),
'section' => 'pb_network_contact_form', 'section' => 'pb_network_contact_form',
'settings' => 'pb_network_contact_link', 'settings' => 'pb_network_contact_link',
] ]

2
inc/filters/namespace.php

@ -60,7 +60,7 @@ function register_query_vars( $vars ) {
* @return string * @return string
*/ */
function excerpt_more() { function excerpt_more() {
return ' &hellip; <a href="' . get_permalink() . '">' . __( 'Continued', 'pressbooks-aldine' ) . '</a>'; return ' &hellip; <a href="' . get_permalink() . '">' . esc_html__( 'Continued', 'pressbooks-aldine' ) . '</a>';
} }
/** /**

16
inc/helpers/namespace.php

@ -357,30 +357,30 @@ function handle_contact_form_submission() {
'message' => esc_textarea( $message ), 'message' => esc_textarea( $message ),
]; ];
if ( empty( $name ) ) { if ( empty( $name ) ) {
$output['message'] = __( 'Name is required.', 'pressbooks-aldine' ); $output['message'] = esc_html__( 'Name is required.', 'pressbooks-aldine' );
$output['status'] = 'error'; $output['status'] = 'error';
$output['field'] = 'visitor_name'; $output['field'] = 'visitor_name';
} elseif ( empty( $email ) ) { } elseif ( empty( $email ) ) {
$output['message'] = __( 'Email is required.', 'pressbooks-aldine' ); $output['message'] = esc_html__( 'Email is required.', 'pressbooks-aldine' );
$output['status'] = 'error'; $output['status'] = 'error';
$output['field'] = 'visitor_email'; $output['field'] = 'visitor_email';
} elseif ( ! filter_var( $email, FILTER_VALIDATE_EMAIL ) ) { } elseif ( ! filter_var( $email, FILTER_VALIDATE_EMAIL ) ) {
$output['message'] = __( 'Email is invalid.', 'pressbooks-aldine' ); $output['message'] = esc_html__( 'Email is invalid.', 'pressbooks-aldine' );
$output['status'] = 'error'; $output['status'] = 'error';
$output['field'] = 'visitor_email'; $output['field'] = 'visitor_email';
} elseif ( empty( $institution ) ) { } elseif ( empty( $institution ) ) {
$output['message'] = __( 'Institution is required.', 'pressbooks-aldine' ); $output['message'] = esc_html__( 'Institution is required.', 'pressbooks-aldine' );
$output['status'] = 'error'; $output['status'] = 'error';
$output['field'] = 'visitor_institution'; $output['field'] = 'visitor_institution';
} elseif ( empty( $message ) ) { } elseif ( empty( $message ) ) {
$output['message'] = __( 'Message is required.', 'pressbooks-aldine' ); $output['message'] = esc_html__( 'Message is required.', 'pressbooks-aldine' );
$output['status'] = 'error'; $output['status'] = 'error';
$output['field'] = 'message'; $output['field'] = 'message';
} else { } else {
$sent = wp_mail( $sent = wp_mail(
$contact_email, $contact_email,
/* translators: %s name of contact for submitter */ /* translators: %s name of contact for submitter */
sprintf( __( 'Contact Form Submission from %s', 'pressbooks-aldine' ), $name ), sprintf( esc_html__( 'Contact Form Submission from %s', 'pressbooks-aldine' ), $name ),
sprintf( sprintf(
"From: %1\$s <%2\$s>\nInstitution: %3\$s\n\n%4\$s", "From: %1\$s <%2\$s>\nInstitution: %3\$s\n\n%4\$s",
stripslashes( $name ), stripslashes( $name ),
@ -391,10 +391,10 @@ function handle_contact_form_submission() {
"From: ${email}\r\nReply-To: ${email}\r\n" "From: ${email}\r\nReply-To: ${email}\r\n"
); );
if ( $sent ) { if ( $sent ) {
$output['message'] = __( 'Your message was sent!', 'pressbooks-aldine' ); $output['message'] = esc_html__( 'Your message was sent!', 'pressbooks-aldine' );
$output['status'] = 'success'; $output['status'] = 'success';
} else { } else {
$output['message'] = __( 'Your message could not be sent.', 'pressbooks-aldine' ); $output['message'] = esc_html__( 'Your message could not be sent.', 'pressbooks-aldine' );
$output['status'] = 'error'; $output['status'] = 'error';
} }
} }

62
page-auth.php

@ -1,6 +1,6 @@
<?php <?php
/** /**
* The template for displaying a custom signup page * The template for displaying custom signup/signin pages
* *
* Template Name: Auth * Template Name: Auth
* *
@ -20,23 +20,23 @@ wp_enqueue_script( 'custom-signup', $assets->getPath( 'scripts/custom-signup.js'
$action = $_GET['action'] ?? 'signup'; $action = $_GET['action'] ?? 'signup';
if ( $action === 'signup' ) { if ( $action === 'signup' ) {
$main_title = __( 'Create a new account', 'pressbooks-aldine' ); $main_title = esc_html__( 'Create a new account', 'pressbooks-aldine' );
$title = __( 'Sign up with your email and a password', 'pressbooks-aldine' ); $title = esc_html__( 'Sign up with your email and a password', 'pressbooks-aldine' );
$url = home_url() . '/auth/?action=signup'; $url = home_url() . '/auth/?action=signup';
$button_cta = __( 'Create Your Account', 'pressbooks-aldine' ); $button_cta = esc_html__( 'Create Your Account', 'pressbooks-aldine' );
$invite_cta = __( 'Already have an account?', 'pressbooks-aldine' ); $invite_cta = esc_html__( 'Already have an account?', 'pressbooks-aldine' );
$invite_cta_link = home_url() . '/auth/?action=login'; $invite_cta_link = home_url() . '/auth/?action=signin';
$invite_cta_link_text = __( 'Log in', 'pressbooks-aldine' ); $invite_cta_link_text = esc_html__( 'Sign in', 'pressbooks-aldine' );
$sign_action = __( 'Or sign up with one of the following', 'pressbooks-aldine' ); $sign_action = esc_html__( 'Or sign up with one of the following', 'pressbooks-aldine' );
} else { } else {
$main_title = __( 'Welcome back!', 'pressbooks-aldine' ); $main_title = esc_html__( 'Welcome back!', 'pressbooks-aldine' );
$title = __( 'Log in to your existing account', 'pressbooks-aldine' ); $title = esc_html__( 'Sign in to your existing account', 'pressbooks-aldine' );
$url = home_url() . '/auth/?action=login'; $url = home_url() . '/auth/?action=signin';
$button_cta = __( 'Login', 'pressbooks-aldine' ); $button_cta = esc_html__( 'Sign in', 'pressbooks-aldine' );
$invite_cta = __( 'Don\'t have an account?', 'pressbooks-aldine' ); $invite_cta = esc_html__( 'Don\'t have an account?', 'pressbooks-aldine' );
$invite_cta_link = home_url() . '/auth/?action=signup'; $invite_cta_link = home_url() . '/auth/?action=signup';
$invite_cta_link_text = __( 'Register here', 'pressbooks-aldine' ); $invite_cta_link_text = esc_html__( 'Register here', 'pressbooks-aldine' );
$sign_action = __( 'Or sign in with one of the following', 'pressbooks-aldine' ); $sign_action = esc_html__( 'Or sign in with one of the following', 'pressbooks-aldine' );
} }
// Implement this hook to process the form. // Implement this hook to process the form.
@ -58,7 +58,7 @@ $errors = apply_filters( 'pb_custom_signup_errors', [] );
?> ?>
</head> </head>
<body class="page signup"> <body class="page <?php echo $action; ?>">
<svg style="display: none;" xmlns="http://www.w3.org/2000/svg"> <svg style="display: none;" xmlns="http://www.w3.org/2000/svg">
<defs> <defs>
<symbol id="icon-pressbooks" fill="currentColor" viewBox="0 0 45 44"> <symbol id="icon-pressbooks" fill="currentColor" viewBox="0 0 45 44">
@ -95,7 +95,7 @@ $errors = apply_filters( 'pb_custom_signup_errors', [] );
wp_get_attachment_image_src( $custom_logo_id, 'logo' )[0], wp_get_attachment_image_src( $custom_logo_id, 'logo' )[0],
wp_get_attachment_image_srcset( $custom_logo_id, 'large' ), wp_get_attachment_image_srcset( $custom_logo_id, 'large' ),
/* translators: %s name of network */ /* translators: %s name of network */
sprintf( __( 'Logo for %s', 'pressbooks-aldine' ), get_bloginfo( 'name', 'display' ) ) sprintf( esc_html__( 'Logo for %s', 'pressbooks-aldine' ), get_bloginfo( 'name', 'display' ) )
); );
?> ?>
<?php } else { ?> <?php } else { ?>
@ -116,14 +116,13 @@ $errors = apply_filters( 'pb_custom_signup_errors', [] );
<div class="form--input-wrapper"> <div class="form--input-wrapper">
<?php if ( $action === 'signup' ) : ?> <?php if ( $action === 'signup' ) : ?>
<input id="email" type="email" autocomplete="email" placeholder=" " name="user_email" required/> <input id="email" type="email" autocomplete="email" placeholder=" " name="user_email" required/>
<label for="email"><?php esc_html_e( 'Email address', 'pressbooks-aldine' ); ?></label>
<p class="form--input-description"><?php esc_html_e( 'Will be used to send your registration details', 'pressbooks-aldine' ); ?></p>
<?php else : ?> <?php else : ?>
<input id="login" type="text" placeholder=" " name="user_login" required/> <input id="login" type="text" placeholder=" " name="user_login" required/>
<label for="login"><?php esc_html_e( 'Username or email address', 'pressbooks-aldine' ); ?></label>
<?php endif; ?> <?php endif; ?>
<label for="email"><?php _e( 'Email address', 'pressbooks-aldine' ); ?></label>
</div> </div>
<?php if ( $action === 'signup' ) : ?>
<p class="form--input-description"><?php _e( 'Will be used to send your registration details', 'pressbooks-aldine' ); ?></p>
<?php endif; ?>
<?php if ( isset( $errors['user_email'] ) ) : ?> <?php if ( isset( $errors['user_email'] ) ) : ?>
<p class="form--input-description error"><?php echo wp_kses( $errors['user_email'][0], true ); ?></p> <p class="form--input-description error"><?php echo wp_kses( $errors['user_email'][0], true ); ?></p>
<?php endif; ?> <?php endif; ?>
@ -131,12 +130,21 @@ $errors = apply_filters( 'pb_custom_signup_errors', [] );
<p class="form--input-description error"><?php echo wp_kses( $errors['invalid_username'][0], true ); ?></p> <p class="form--input-description error"><?php echo wp_kses( $errors['invalid_username'][0], true ); ?></p>
<?php endif; ?> <?php endif; ?>
<div class="form--input-wrapper"> <div class="form--input-wrapper">
<input id="password" type="text" autocomplete="new-password" placeholder=" " name="user_pwd" required/>
<label for="password"><?php _e( 'Password', 'pressbooks-aldine' ); ?></label>
</div>
<?php if ( $action === 'signup' ) : ?> <?php if ( $action === 'signup' ) : ?>
<p class="form--input-description"><?php _e( 'At least 12 characters, with at least one upper case letter and one number', 'pressbooks-aldine' ); ?></p> <input id="new-pass" type="text" autocomplete="new-password" placeholder=" " name="user_pwd" required/>
<label for="new-pass"><?php esc_html_e( 'Password', 'pressbooks-aldine' ); ?></label>
<p class="form--input-description"><?php esc_html_e( 'At least 12 characters, with at least one upper case letter and one number', 'pressbooks-aldine' ); ?></p>
<?php else : ?>
<input id="password" type="password" autocomplete="password" placeholder=" " name="password" required/>
<label for="password"><?php esc_html_e( 'Password', 'pressbooks-aldine' ); ?></label>
<!-- TODO: Add 'show password button' like the one in the WP login form
<button type="button" class="button button-secondary wp-hide-pw hide-if-no-js" data-toggle="0" aria-label="Show password">
<span class="dashicons dashicons-visibility" aria-hidden="true"></span>
</button>
-->
<p class="form--input-description"><a href="<?php echo wp_lostpassword_url(); ?>"><?php esc_html_e( 'Lost your password?', 'pressbooks-aldine' ); ?></a></p>
<?php endif; ?> <?php endif; ?>
</div>
<?php if ( isset( $errors['password_validation_error'] ) ) : ?> <?php if ( isset( $errors['password_validation_error'] ) ) : ?>
<p class="form--input-description error"><?php echo wp_kses( $errors['password_validation_error'][0], true ); ?></p> <p class="form--input-description error"><?php echo wp_kses( $errors['password_validation_error'][0], true ); ?></p>
<?php endif; ?> <?php endif; ?>
@ -146,9 +154,7 @@ $errors = apply_filters( 'pb_custom_signup_errors', [] );
<?php do_action( 'pb_custom_signup_extra_fields' ); ?> <?php do_action( 'pb_custom_signup_extra_fields' ); ?>
<button type="submit"><?php echo esc_html( $button_cta ); ?></button> <button type="submit"><?php echo esc_html( $button_cta ); ?></button>
<?php if ( $action === 'signup' ) : ?> <?php if ( $action === 'signup' ) : ?>
<p class="form--input-description"><?php _e( 'By signing up for Pressbooks. you agree to our privacy policy and terms of service.', 'pressbooks-aldine' ); ?></p> <p class="form--input-description"><?php esc_html_e( 'By signing up for Pressbooks. you agree to our privacy policy and terms of service.', 'pressbooks-aldine' ); ?></p>
<?php else : ?>
<p class="form--input-description"><a href="<?php echo wp_lostpassword_url(); ?>"><?php _e( 'Lost your password?', 'pressbooks-aldine' ); ?></a></p>
<?php endif; ?> <?php endif; ?>
<?php wp_nonce_field( 'pb_nonce_signup', 'pb_nonce_signup' ); ?> <?php wp_nonce_field( 'pb_nonce_signup', 'pb_nonce_signup' ); ?>
</form> </form>

4
page-catalog.php

@ -57,10 +57,10 @@ else :
<main id="main" class="site-main"> <main id="main" class="site-main">
<article class="page"> <article class="page">
<header class="entry-header"> <header class="entry-header">
<h1 class="entry-title"><?php _e( 'No Books Found', 'pressbooks-aldine' ); ?></h1> <h1 class="entry-title"><?php esc_html_e( 'No Books Found', 'pressbooks-aldine' ); ?></h1>
</header> </header>
<div class="entry-content" style="text-align:center;"> <div class="entry-content" style="text-align:center;">
<p><?php _e( 'No books have been added to the catalog yet.', 'pressbooks-aldine' ); ?></p> <p><?php esc_html_e( 'No books have been added to the catalog yet.', 'pressbooks-aldine' ); ?></p>
</div> </div>
</article> </article>
</main> </main>

4
partials/book.php

@ -36,7 +36,7 @@ if ( $date ) {
/* /*
<?php if (isset( $book['metadata']['author'] ) ) { ?> <?php if (isset( $book['metadata']['author'] ) ) { ?>
<p class="book__author"> <p class="book__author">
<?php _e( 'By', 'pressbooks-aldine' ); ?> <?php foreach ( $book['metadata']['author'] as $author ) { <?php esc_html_e( 'By', 'pressbooks-aldine' ); ?> <?php foreach ( $book['metadata']['author'] as $author ) {
echo $author['name']; echo $author['name'];
} ?> } ?>
</p> </p>
@ -54,6 +54,6 @@ if ( $date ) {
</p> </p>
<?php endif; ?> <?php endif; ?>
<p class="book__read-more"> <p class="book__read-more">
<a href="<?php echo $book['link']; ?>"><?php _e( 'About this book', 'pressbooks-aldine' ); ?> <svg aria-hidden="true"><use xlink:href="#arrow-right" /></svg></a> <a href="<?php echo $book['link']; ?>"><?php esc_html_e( 'About this book', 'pressbooks-aldine' ); ?> <svg aria-hidden="true"><use xlink:href="#arrow-right" /></svg></a>
</p> </p>
</li> </li>

14
partials/contact-form.php

@ -10,7 +10,7 @@
<?php <?php
$pb_network_contact_form_title = get_option( 'pb_network_contact_form_title' ); $pb_network_contact_form_title = get_option( 'pb_network_contact_form_title' );
$contact_form_title = ( ! empty( $pb_network_contact_form_title ) ) ? $pb_network_contact_form_title : __( 'Contact Us', 'pressbooks-aldine' ); $contact_form_title = ( ! empty( $pb_network_contact_form_title ) ) ? $pb_network_contact_form_title : esc_html__( 'Contact Us', 'pressbooks-aldine' );
$contact_form_response = \Aldine\Helpers\handle_contact_form_submission(); $contact_form_response = \Aldine\Helpers\handle_contact_form_submission();
$honeypot = 'firstname' . wp_rand(); $honeypot = 'firstname' . wp_rand();
@ -27,7 +27,7 @@ $honeypot = 'firstname' . wp_rand();
<p class="form__row" style="display:none;"> <p class="form__row" style="display:none;">
<input type="text" name="<?php echo $honeypot; ?>" id="<?php echo $honeypot; ?>"/> <input type="text" name="<?php echo $honeypot; ?>" id="<?php echo $honeypot; ?>"/>
<label for="<?php echo $honeypot; ?>"> <label for="<?php echo $honeypot; ?>">
<?php _e( 'Keep this field blank (required)', 'pressbooks-aldine' ); ?> <?php esc_html_e( 'Keep this field blank (required)', 'pressbooks-aldine' ); ?>
</label> </label>
</p> </p>
<p class="form__row"> <p class="form__row">
@ -43,7 +43,7 @@ $honeypot = 'firstname' . wp_rand();
?> ?>
" required> " required>
<label for="contact-name"> <label for="contact-name">
<?php _e( 'Your name (required)', 'pressbooks-aldine' ); ?> <?php esc_html_e( 'Your name (required)', 'pressbooks-aldine' ); ?>
</label> </label>
</p> </p>
<p class="form__row"> <p class="form__row">
@ -59,7 +59,7 @@ $honeypot = 'firstname' . wp_rand();
?> ?>
" required> " required>
<label for="contact-email"> <label for="contact-email">
<?php _e( 'Your email address (required)', 'pressbooks-aldine' ); ?> <?php esc_html_e( 'Your email address (required)', 'pressbooks-aldine' ); ?>
</label> </label>
</p> </p>
<p class="form__row"> <p class="form__row">
@ -75,7 +75,7 @@ $honeypot = 'firstname' . wp_rand();
?> ?>
" required> " required>
<label for="contact-institution"> <label for="contact-institution">
<?php _e( 'Your institution (required)', 'pressbooks-aldine' ); ?> <?php esc_html_e( 'Your institution (required)', 'pressbooks-aldine' ); ?>
</label> </label>
</p> </p>
<p class="form__row"> <p class="form__row">
@ -91,10 +91,10 @@ $honeypot = 'firstname' . wp_rand();
?> ?>
</textarea> </textarea>
<label for="contact-message"> <label for="contact-message">
<?php _e( 'Your message (required)', 'pressbooks-aldine' ); ?> <?php esc_html_e( 'Your message (required)', 'pressbooks-aldine' ); ?>
</label> </label>
</p> </p>
<p class="form__row"> <p class="form__row">
<input class="button button--small button--outline" type="submit" value="<?php _e( 'Send', 'pressbooks-aldine' ); ?>" /></p> <input class="button button--small button--outline" type="submit" value="<?php esc_html_e( 'Send', 'pressbooks-aldine' ); ?>" /></p>
</form> </form>
</aside> </aside>

6
partials/content-front-page.php

@ -16,7 +16,7 @@ use function Aldine\Helpers\has_sections;
$front_page_catalog = get_option( 'pb_front_page_catalog' ); $front_page_catalog = get_option( 'pb_front_page_catalog' );
$pb_front_page_catalog_title = get_option( 'pb_front_page_catalog_title' ); $pb_front_page_catalog_title = get_option( 'pb_front_page_catalog_title' );
$latest_books_title = ( ! empty( $pb_front_page_catalog_title ) ) ? $pb_front_page_catalog_title : __( 'Our Latest Titles', 'pressbooks-aldine' ); $latest_books_title = ( ! empty( $pb_front_page_catalog_title ) ) ? $pb_front_page_catalog_title : esc_html__( 'Our Latest Titles', 'pressbooks-aldine' );
if ( get_option( 'pb_front_page_catalog' ) ) { if ( get_option( 'pb_front_page_catalog' ) ) {
$page = ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1; $page = ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1;
$catalog_data = get_catalog_data( $page, 3, 'latest' ); $catalog_data = get_catalog_data( $page, 3, 'latest' );
@ -55,7 +55,7 @@ if ( get_option( 'pb_front_page_catalog' ) ) {
<?php if ( get_option( 'pb_front_page_catalog' ) && ! empty( $catalog_data['books'] ) ) : ?> <?php if ( get_option( 'pb_front_page_catalog' ) && ! empty( $catalog_data['books'] ) ) : ?>
<div id="latest-books" class="latest-books"> <div id="latest-books" class="latest-books">
<h2 id="latest-books-title"><?php echo $latest_books_title; ?></h2> <h2 id="latest-books-title"><?php echo $latest_books_title; ?></h2>
<div class="slider" role="region" aria-labelledby="latest-books-title" data-total-pages="<?php echo $catalog_data['pages']; ?>" <div class="slider" role="region" aria-labelledby="latest-books-title" data-total-pages="<?php echo $catalog_data['pages']; ?>"
<?php <?php
if ( $next_page <= $catalog_data['pages'] ) : if ( $next_page <= $catalog_data['pages'] ) :
?> ?>
@ -73,7 +73,7 @@ if ( get_option( 'pb_front_page_catalog' ) ) {
?> ?>
</div> </div>
<p class="catalog-link"> <p class="catalog-link">
<a class="call-to-action" href="<?php echo network_home_url( '/catalog/' ); ?>"><?php _e( 'View Complete Catalog', 'pressbooks-aldine' ); ?></a> <a class="call-to-action" href="<?php echo network_home_url( '/catalog/' ); ?>"><?php esc_html_e( 'View Complete Catalog', 'pressbooks-aldine' ); ?></a>
</p> </p>
</div> </div>
<?php endif; ?> <?php endif; ?>

28
partials/content-page-catalog.php

@ -14,9 +14,9 @@
<form role="form" class="filter-sort" method="get"> <form role="form" class="filter-sort" method="get">
<input type="hidden" name="paged" value="<?php echo $current_page; ?>" /> <input type="hidden" name="paged" value="<?php echo $current_page; ?>" />
<fieldset class="subject-filters"> <fieldset class="subject-filters">
<h2><?php _e( 'Filter by Subject', 'pressbooks-aldine' ); ?></h2> <h2><?php esc_html_e( 'Filter by Subject', 'pressbooks-aldine' ); ?></h2>
<input type="radio" name="subject" id="all-subjects" value="" <?php checked( $subject, '' ); ?>> <input type="radio" name="subject" id="all-subjects" value="" <?php checked( $subject, '' ); ?>>
<label for="all-subjects"><?php _e( 'All Subjects', 'pressbooks-aldine' ); ?> <svg class="checked"><use xlink:href="#checkmark" /></svg></label> <label for="all-subjects"><?php esc_html_e( 'All Subjects', 'pressbooks-aldine' ); ?> <svg class="checked"><use xlink:href="#checkmark" /></svg></label>
<div class="subject-groups"> <div class="subject-groups">
<?php <?php
foreach ( $subjects as $key => $val ) : foreach ( $subjects as $key => $val ) :
@ -36,9 +36,9 @@
</div> </div>
</fieldset> </fieldset>
<fieldset class="institution-filters"> <fieldset class="institution-filters">
<h2><?php _e( 'Filter by Institution', 'pressbooks-aldine' ); ?></h2> <h2><?php esc_html_e( 'Filter by Institution', 'pressbooks-aldine' ); ?></h2>
<input type="radio" name="institution" id="all-institutions" value="" <?php checked( $institution, '' ); ?>> <input type="radio" name="institution" id="all-institutions" value="" <?php checked( $institution, '' ); ?>>
<label for="all-institutions"><?php _e( 'All Institutions', 'pressbooks-aldine' ); ?> <svg class="checked"><use xlink:href="#checkmark" /></svg></label> <label for="all-institutions"><?php esc_html_e( 'All Institutions', 'pressbooks-aldine' ); ?> <svg class="checked"><use xlink:href="#checkmark" /></svg></label>
<?php <?php
foreach ( $institutions as $key => $value ) : foreach ( $institutions as $key => $value ) :
if ( array_key_exists( $key, $available_institutions ) ) : if ( array_key_exists( $key, $available_institutions ) ) :
@ -51,9 +51,9 @@
?> ?>
</fieldset> </fieldset>
<fieldset class="license-filters"> <fieldset class="license-filters">
<h2><?php _e( 'Filter by License', 'pressbooks-aldine' ); ?></h2> <h2><?php esc_html_e( 'Filter by License', 'pressbooks-aldine' ); ?></h2>
<input type="radio" name="license" id="all-licenses" value="" <?php checked( $license, '' ); ?>> <input type="radio" name="license" id="all-licenses" value="" <?php checked( $license, '' ); ?>>
<label for="all-licenses"><?php _e( 'All Licenses', 'pressbooks-aldine' ); ?> <svg class="checked"><use xlink:href="#checkmark" /></svg></label> <label for="all-licenses"><?php esc_html_e( 'All Licenses', 'pressbooks-aldine' ); ?> <svg class="checked"><use xlink:href="#checkmark" /></svg></label>
<?php <?php
foreach ( $licenses as $key => $value ) : foreach ( $licenses as $key => $value ) :
if ( in_array( $key, $available_licenses, true ) ) : if ( in_array( $key, $available_licenses, true ) ) :
@ -66,12 +66,12 @@
?> ?>
</fieldset> </fieldset>
<fieldset class="sorts"> <fieldset class="sorts">
<h2><?php _e( 'Sort by', 'pressbooks-aldine' ); ?></h2> <h2><?php esc_html_e( 'Sort by', 'pressbooks-aldine' ); ?></h2>
<?php <?php
$sorts = [ $sorts = [
'title' => __( 'Title', 'pressbooks-aldine' ), 'title' => esc_html__( 'Title', 'pressbooks-aldine' ),
'subject' => __( 'Subject', 'pressbooks-aldine' ), 'subject' => esc_html__( 'Subject', 'pressbooks-aldine' ),
'latest' => __( 'Latest', 'pressbooks-aldine' ), 'latest' => esc_html__( 'Latest', 'pressbooks-aldine' ),
]; ];
foreach ( $sorts as $key => $value ) { foreach ( $sorts as $key => $value ) {
?> ?>
@ -79,8 +79,8 @@
<label for="<?php echo $key ?>"><?php echo $value; ?> <svg class="checked"><use xlink:href="#checkmark" /></svg></label> <label for="<?php echo $key ?>"><?php echo $value; ?> <svg class="checked"><use xlink:href="#checkmark" /></svg></label>
<?php } ?> <?php } ?>
</fieldset> </fieldset>
<button type="button" class="clear-filters" hidden><?php _e( 'Clear Filters', 'pressbooks-aldine' ); ?></button> <button type="button" class="clear-filters" hidden><?php esc_html_e( 'Clear Filters', 'pressbooks-aldine' ); ?></button>
<button type="submit"><?php _e( 'Submit', 'pressbooks-aldine' ); ?></button> <button type="submit"><?php esc_html_e( 'Submit', 'pressbooks-aldine' ); ?></button>
</form> </form>
<ul class="books"> <ul class="books">
<?php <?php
@ -94,7 +94,7 @@
<?php <?php
if ( $previous_page ) : if ( $previous_page ) :
?> ?>
<a class="previous" rel="previous" data-page="<?php echo $previous_page; ?>" href="<?php echo network_home_url( "/catalog/page/$previous_page/" ); ?>"><span class="screen-reader-text"><?php _e( 'Previous Page', 'pressbooks' ); ?></span> <a class="previous" rel="previous" data-page="<?php echo $previous_page; ?>" href="<?php echo network_home_url( "/catalog/page/$previous_page/" ); ?>"><span class="screen-reader-text"><?php esc_html_e( 'Previous Page', 'pressbooks' ); ?></span>
<svg aria-hidden="true"> <svg aria-hidden="true">
<use xlink:href="#arrow-left" /> <use xlink:href="#arrow-left" />
</svg></a><?php endif; ?> </svg></a><?php endif; ?>
@ -112,7 +112,7 @@
<?php <?php
if ( $next_page <= $catalog_data['pages'] ) : if ( $next_page <= $catalog_data['pages'] ) :
?> ?>
<a class="next" rel="next" data-page="<?php echo $next_page; ?>" href="<?php echo network_home_url( "/catalog/page/$next_page/" ); ?>"><span class="screen-reader-text"><?php _e( 'Next Page', 'pressbooks' ); ?></span> <a class="next" rel="next" data-page="<?php echo $next_page; ?>" href="<?php echo network_home_url( "/catalog/page/$next_page/" ); ?>"><span class="screen-reader-text"><?php esc_html_e( 'Next Page', 'pressbooks' ); ?></span>
<svg aria-hidden="true"> <svg aria-hidden="true">
<use xlink:href="#arrow-right" /> <use xlink:href="#arrow-right" />
</svg></a><?php endif; ?> </svg></a><?php endif; ?>

8
partials/paged-navigation.php

@ -9,12 +9,12 @@
?> ?>
<nav class="booknav" aria-labelledby="latest-books-title book-navigation"> <nav class="booknav" aria-labelledby="latest-books-title book-navigation">
<span class="screen-reader-text"><?php _e( 'Navigation', 'pressbooks-aldine' ); ?></span> <span class="screen-reader-text"><?php esc_html_e( 'Navigation', 'pressbooks-aldine' ); ?></span>
<nav class="booknav" aria-labelledby="catalog-books"> <nav class="booknav" aria-labelledby="catalog-books">
<span class="screen-reader-text" id="catalog-books"><?php _e( 'Book Catalog Navigation', 'pressbooks-aldine' ); ?></span> <span class="screen-reader-text" id="catalog-books"><?php esc_html_e( 'Book Catalog Navigation', 'pressbooks-aldine' ); ?></span>
<?php if ( $previous_page ) : ?> <?php if ( $previous_page ) : ?>
<a class="previous" rel="previous" data-page="<?php echo $previous_page; ?>" href="<?php echo network_home_url( "/page/$previous_page/#latest-books" ); ?>"> <a class="previous" rel="previous" data-page="<?php echo $previous_page; ?>" href="<?php echo network_home_url( "/page/$previous_page/#latest-books" ); ?>">
<span class="screen-reader-text"><?php _e( 'Previous Page', 'pressbooks' ); ?></span> <span class="screen-reader-text"><?php esc_html_e( 'Previous Page', 'pressbooks' ); ?></span>
<svg aria-hidden="true"> <svg aria-hidden="true">
<use xlink:href="#arrow-left" /> <use xlink:href="#arrow-left" />
</svg> </svg>
@ -22,7 +22,7 @@
<?php endif; ?> <?php endif; ?>
<?php if ( $next_page <= $catalog_data['pages'] ) : ?> <?php if ( $next_page <= $catalog_data['pages'] ) : ?>
<a class="next" rel="next" data-page="<?php echo $next_page; ?>" href="<?php echo network_home_url( "/page/$next_page/#latest-books" ); ?>"> <a class="next" rel="next" data-page="<?php echo $next_page; ?>" href="<?php echo network_home_url( "/page/$next_page/#latest-books" ); ?>">
<span class="screen-reader-text"><?php _e( 'Next Page', 'pressbooks' ); ?></span> <span class="screen-reader-text"><?php esc_html_e( 'Next Page', 'pressbooks' ); ?></span>
<svg aria-hidden="true"> <svg aria-hidden="true">
<use xlink:href="#arrow-right" /> <use xlink:href="#arrow-right" />
</svg> </svg>

Loading…
Cancel
Save