Browse Source

Misc Fixes (#91)

* Suppress "Display title and tagline" in customizer (fixes #88)
* Suppress header text colour in customizer (fixes #86)
* Migrate site logo (fixes #85)
* Change 404 message when catalog is empty (fixes #90)
pull/93/head
Dac Chartrand 7 years ago committed by Ned Zimmerman
parent
commit
7bd5c9bc67
  1. 5
      inc/activation/namespace.php
  2. 8
      inc/customizer/namespace.php
  3. 17
      page-catalog.php

5
inc/activation/namespace.php

@ -97,6 +97,11 @@ function create_default_content() {
wp_delete_post( 2, true );
wp_delete_comment( 1, true );
// Migrate site logo
if ( ! empty( $mods['custom_logo'] ) ) {
set_theme_mod( 'custom_logo', $mods['custom_logo'] );
}
// Add "pb_aldine_activated" option to enable check above
add_option( 'pb_aldine_activated', 1 );
}

8
inc/customizer/namespace.php

@ -15,6 +15,14 @@ use PressbooksMix\Assets;
* @param \WP_Customize_Manager $wp_customize Theme Customizer object.
*/
function customize_register( \WP_Customize_Manager $wp_customize ) {
// Remove unsupported WP controls, @see \WP_Customize_Manager::register_controls
$wp_customize->remove_control( 'display_header_text' );
$wp_customize->remove_control( 'header_textcolor' );
// Add Pressbooks controls
$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';

17
page-catalog.php

@ -46,6 +46,21 @@ else :
global $wp_query;
$wp_query->set_404();
status_header( 404 );
get_template_part( 404 );
get_header();
?>
<div id="primary" class="content-area">
<main id="main" class="site-main">
<article class="page">
<header class="entry-header">
<h1 class="entry-title"><?php _e( 'No Books Found', 'pressbooks' ); ?></h1>
</header>
<div class="entry-content" style="text-align:center;">
<p><?php _e( 'Your catalog is empty.', 'pressbooks' ); ?></p>
</div>
</article>
</main>
</div>
<?php
get_footer();
exit();
endif;

Loading…
Cancel
Save