Making WordPress.org

Ticket #1671: 1671.3.patch

File 1671.3.patch, 1.4 KB (added by DrewAPicture, 10 years ago)
  • inc/user-content.php

     
    6262         */
    6363        public static function scripts_and_styles() {
    6464                if ( is_singular() ) {
    65                         if ( '0' != get_comments_number() || \DevHub\post_type_has_source_code() || wporg_is_handbook_post_type() ) {
     65                        $is_handbook_post_type = function_exists( 'wporg_is_handbook_post_type' ) ? wporg_is_handbook_post_type() : false;
     66
     67                        if ( '0' != get_comments_number() || \DevHub\post_type_has_source_code() || $is_handbook_post_type ) {
    6668                                wp_enqueue_script( 'wporg-developer-function-reference', get_template_directory_uri() . '/js/function-reference.js', array( 'jquery', 'syntaxhighlighter-core', 'syntaxhighlighter-brush-php' ), '20150319', true );
    6769                                wp_enqueue_style( 'syntaxhighlighter-core' );
    6870                                wp_enqueue_style( 'syntaxhighlighter-theme-default' );
  • searchform.php

     
    3434<?php } ?>
    3535
    3636        <?php
    37                 $is_handbook = wporg_is_handbook();
     37                $is_handbook = function_exists( 'wporg_is_handbook' ) ? wporg_is_handbook() : false;
    3838                $search_url  = $is_handbook ? wporg_get_current_handbook_home_url() : home_url( '/' );
    3939                $form_class  = $is_handbook ? ' searchform-handbook' : '';
    4040        ?>