_s: Adhere to updated WordPress core code formatting.
* Update PHPDoc. * Add periods to the end of comment sentences. * Limit line length to 80 chars. * Use C++-style PHP comments only for function and file documentation.
This commit is contained in:
parent
a7ce5b6f47
commit
6f63a0b39a
5 changed files with 43 additions and 43 deletions
|
@ -9,6 +9,9 @@
|
|||
|
||||
/**
|
||||
* Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link.
|
||||
*
|
||||
* @param array $args Configuration arguments.
|
||||
* @return array
|
||||
*/
|
||||
function _s_page_menu_args( $args ) {
|
||||
$args['show_home'] = true;
|
||||
|
@ -18,19 +21,22 @@ add_filter( 'wp_page_menu_args', '_s_page_menu_args' );
|
|||
|
||||
/**
|
||||
* Adds custom classes to the array of body classes.
|
||||
*
|
||||
* @param array $classes Classes for the body element.
|
||||
* @return array
|
||||
*/
|
||||
function _s_body_classes( $classes ) {
|
||||
// Adds a class of group-blog to blogs with more than 1 published author
|
||||
if ( is_multi_author() ) {
|
||||
// Adds a class of group-blog to blogs with more than 1 published author.
|
||||
if ( is_multi_author() )
|
||||
$classes[] = 'group-blog';
|
||||
}
|
||||
|
||||
return $classes;
|
||||
}
|
||||
add_filter( 'body_class', '_s_body_classes' );
|
||||
|
||||
/**
|
||||
* Filter in a link to a content ID attribute for the next/previous image links on image attachment pages
|
||||
* Filter in a link to a content ID attribute for the next/previous image links
|
||||
* on image attachment pages.
|
||||
*/
|
||||
function _s_enhanced_image_navigation( $url, $id ) {
|
||||
if ( ! is_attachment() && ! wp_attachment_is_image( $id ) )
|
||||
|
@ -46,6 +52,10 @@ add_filter( 'attachment_link', '_s_enhanced_image_navigation', 10, 2 );
|
|||
|
||||
/**
|
||||
* Filters wp_title to print a neat <title> tag based on what is being viewed.
|
||||
*
|
||||
* @param string $title Default title text for current view.
|
||||
* @param string $sep Optional separator.
|
||||
* @return string The filtered title.
|
||||
*/
|
||||
function _s_wp_title( $title, $sep ) {
|
||||
global $page, $paged;
|
||||
|
@ -67,4 +77,4 @@ function _s_wp_title( $title, $sep ) {
|
|||
|
||||
return $title;
|
||||
}
|
||||
add_filter( 'wp_title', '_s_wp_title', 10, 2 );
|
||||
add_filter( 'wp_title', '_s_wp_title', 10, 2 );
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
/**
|
||||
* Custom template tags for this theme.
|
||||
*
|
||||
* Eventually, some of the functionality here could be replaced by core features
|
||||
* Eventually, some of the functionality here could be replaced by core features.
|
||||
*
|
||||
* @package _s
|
||||
*/
|
||||
|
||||
if ( ! function_exists( '_s_content_nav' ) ) :
|
||||
/**
|
||||
* Display navigation to next/previous pages when applicable
|
||||
* Display navigation to next/previous pages when applicable.
|
||||
*/
|
||||
function _s_content_nav( $nav_id ) {
|
||||
global $wp_query, $post;
|
||||
|
@ -124,7 +124,7 @@ function _s_the_attached_image() {
|
|||
$attachment_size = apply_filters( '_s_attachment_size', array( 1200, 1200 ) );
|
||||
$next_attachment_url = wp_get_attachment_url();
|
||||
|
||||
/**
|
||||
/*
|
||||
* Grab the IDs of all the image attachments in a gallery so we can get the
|
||||
* URL of the next adjacent image in a gallery, or the first image (if
|
||||
* we're looking at the last image in a gallery), or, in a gallery of one,
|
||||
|
@ -196,32 +196,32 @@ function _s_posted_on() {
|
|||
endif;
|
||||
|
||||
/**
|
||||
* Returns true if a blog has more than 1 category
|
||||
* Returns true if a blog has more than 1 category.
|
||||
*/
|
||||
function _s_categorized_blog() {
|
||||
if ( false === ( $all_the_cool_cats = get_transient( 'all_the_cool_cats' ) ) ) {
|
||||
// Create an array of all the categories that are attached to posts
|
||||
// Create an array of all the categories that are attached to posts.
|
||||
$all_the_cool_cats = get_categories( array(
|
||||
'hide_empty' => 1,
|
||||
) );
|
||||
|
||||
// Count the number of categories that are attached to the posts
|
||||
// Count the number of categories that are attached to the posts.
|
||||
$all_the_cool_cats = count( $all_the_cool_cats );
|
||||
|
||||
set_transient( 'all_the_cool_cats', $all_the_cool_cats );
|
||||
}
|
||||
|
||||
if ( '1' != $all_the_cool_cats ) {
|
||||
// This blog has more than 1 category so _s_categorized_blog should return true
|
||||
// This blog has more than 1 category so _s_categorized_blog should return true.
|
||||
return true;
|
||||
} else {
|
||||
// This blog has only 1 category so _s_categorized_blog should return false
|
||||
// This blog has only 1 category so _s_categorized_blog should return false.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Flush out the transients used in _s_categorized_blog
|
||||
* Flush out the transients used in _s_categorized_blog.
|
||||
*/
|
||||
function _s_category_transient_flusher() {
|
||||
// Like, beat it. Dig?
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* WordPress.com-specific functions and definitions
|
||||
* WordPress.com-specific functions and definitions.
|
||||
*
|
||||
* @package _s
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue