Monthly Product Update 4/30/20

We will be holding our monthly “product update webinar” from 2-3pm ET this Thursday, April 30. This webinar will include a demonstration of recent improvements we’ve released and progress we’ve made on LTI 1.3 (including grade passback!). We’ll also include time for you to share news & updates about any Pressbooks-related development projects you’ve been working on. See a more detailed agenda for details, including the meeting link.

Hope to see you later this week!

New time, format, & title for monthly Open Source Calls

Hi all,

The monthly “open source calls” we previously held on the first Monday of each month are being replaced by a monthly “product update webinar.” These product update meetings will be held from 2-3pm ET on the last Thursday of each month; the first of them will be this Thursday, March 26. Meetings will be held in Zoom. A recurring event for these meetings has been published to Google Calendar.

Meetings will include a demonstration of recent improvements we’ve released and overview of projects that we’re currently working on. We’ll also leave conversation space for attendees to share news and updates about local development projects of interest, and to provide input on your Pressbooks-related product needs and desires.

The March 26 webinar will include an update on recent progress we’ve made on two long-awaited projects: 1) a searchable, filterable directory of public books across all known Pressbooks networks and 2) updates to our LTI provider plugin to make it compatible with the new 1.3 specification and add support for grade passback to the Learning Management System.

Hope to see you later this week!

No Open Source Call in December

Our monthly Open Source call would typically have taken place on today (Monday, December 2), but we’re cancelling it (we did a lot of travelling and onboarding in November and could use a brief break). We’ll post a notice about a January open source call once we’ve finalized the date and time. See you then!

Pressbooks 5.9.5 and McLuhan 2.8.12

We released a patch for Pressbooks and have deployed it to all our hosted networks. We also bumped McLuhan’s version number, but there isn’t much in there, only a change to Theme Tags.

The patch introduces two new Data Collectors. Data Collectors (two words we put together to name an idea we made up) are a way of storing additional WordPress multisite metadata, or enhancing the way it is stored. This new data is already being used by our Network Analytics premium plugin. It will, next, be used to speed up the Network API.

More Info About The New Code

Users: WordPress user data is stored in two tables. Running SQL queries to access user info is generally OK. This user class only extends the metadata. For example: Last login.

Books: Like the user class, this book class extends the metadata. More importantly, this book class copies metadata into wp_blogmeta (introduced in WordPress 5.1)

WordPress book data is stored in X tables per book. Without this class, for every book on a network we have to use the expensive switch_to_blog function, point PHP to the x tables we want, run queries, then repeat for every single book.

With the introduction of this data collector, the metadata we need can be queried more easily. Example using a pivot table (aka. cross-tabulated table:)

SELECT b.blog_id AS id,             
MAX(IF(b.meta_key='pb_word_count',CAST(b.meta_value AS UNSIGNED),null)) AS words,   
MAX(IF(b.meta_key='pb_is_public',CAST(b.meta_value AS UNSIGNED),null)) AS public
FROM wp_blogmeta b
GROUP BY id HAVING (public = 0) AND (words > 1000) LIMIT 25;


“Thank you for blessing me with a mind to rhyme and two hype feet.” -MC Hammer

Font Selector Theme Option

When users think about picking the right theme for the book they’ve written with Pressbooks, they sometimes face difficult choices. They may like the overall design and aesthetic of a given theme, but want to use a typeface that they’ve seen in a different theme, or which isn’t currently part of any of supported themes. They may also have different typeface preferences for webbooks and their ebook or PDF (print) exports.

A less enlightened developer might have just laughed out loud and said ‘Too bad! We can’t have amateurs ruining our beautiful books with their questionable typography choices, now can we?’ Luckily for me, I work with people (like Taylor McGrath) who believe that the best designers and developers listen to and respond to their users. And for some time now, Taylor and others on our support team have heard from users who’d like to have more control over typography and font choices when theming their books.

Enter what we’re calling ‘Shape Shifter’: a nerdy code name for theme options that allows book administrators to choose typefaces from a curated list of open fonts for Headers and Body text. These font selector options are designed to function separately for webbooks, PDF exports, and ebooks so that users could for example choose to use Alegreya (a serif typeface) for the body text in PDF exports and Barlow (a sans serif typeface) for the body text in the webook.

In the current sprint, we added the code to do this in Pressbooks and McLuhan. Next week, we’re rolling out the fully-baked feature for our EDU customers in a new premium theme called Malala, where we’ll test and get user feedback before deciding whether to add these theme options to other of our themes. Open source users get … this blog post!

Developers who want to take advantage of this feature need to convert their Global Typography SCSS.

Here’s how it could be done for Clarke, one of our existing open-source book themes.


@import 'font-stack-web';  
$serif-web: serif !default;  
$sans-serif-web: sans-serif !default;

$font-1: 'Times New Roman', Georgia, $serif-web;  
$font-2: Helvetica, Arial, $sans-serif-web;  
$font-3: $font-2;  


// Load dynamically generated Global Typography fonts  
@import 'font-stack-web';  
$serif-web: serif !default;  
$sans-serif-web: sans-serif !default;

// Load Shape Shifter fonts, if any.
@import 'shapeshifter-font-stack-web';  
$shapeshifter-font-1-is-serif: true !default;  
$shapeshifter-font-2-is-serif: true !default;

// Insert custom fonts for your theme into the font stacks below. Always end the  
// stack with $serif-web or $sans-serif-web, as appropriate—this allows custom  
// language support to be added dynamically.

@if variable-exists(shapeshifter-font-1) {  
 $font-1: $shapeshifter-font-1, if($shapeshifter-font-1-is-serif, $serif-web, $sans-serif-web);  
} @else {  
 $font-1: 'Times New Roman', Georgia, $serif-web;  
@if variable-exists(shapeshifter-font-2) {  
 $font-2: $shapeshifter-font-2, if($shapeshifter-font-2-is-serif, $serif-web, $sans-serif-web);  
} @else {  
 $font-2: Helvetica, Arial, $sans-serif-web;  
$font-3: $font-2;  

Make changes like the above to:

  • assets/styles/epub/_fonts.scss
  • assets/styles/epub/_fonts.scss
  • assets/styles/prince/_fonts.scss

Pay special attention to variable names (replace $sans-serif-web to $sans-serif-epub or $sans-serif-prince, for example) If you have @import statements move them from the bottom of the file into the else conditions.

To finish, add this code snippet in your theme’s functions.php file:

add_filter('pb_is_shape_shifter_compatible', '__return_true');  

Once activated, the theme should have new Theme Options for each format:

Shape Shifter Feature

90 percent of design is typography. And the other 90 percent is whitespace

Pressbooks 5.9.3

We released a patch for Pressbooks and have deployed it to all our hosted networks. Changes were done in conjuction with a new Network Options feature for EDU users:


“One of the hardest things in life to learn are which bridges to cross and which bridges to burn.” -Oprah Winfrey