Skip to content

Commit d900378

Browse files
committed
All: Remove remnants of "twentyeleven" theme
This theme was developed by forking the built-in "twentyeleven" theme. Not much was left of it, other than: * confusing function name prefixes * unused apply_filters() hoook. * unused utility functions. I've converted hooks to inline closures, and utility functions to the jq_ prefix and moved to the appropiate file.
1 parent 4fbdef0 commit d900378

File tree

7 files changed

+29
-75
lines changed

7 files changed

+29
-75
lines changed

themes/jquery/author.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
if ( get_the_author_meta( 'description' ) ) : ?>
3939
<div id="author-info">
4040
<div id="author-avatar">
41-
<?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyeleven_author_bio_avatar_size', 60 ) ); ?>
41+
<?php echo get_avatar( get_the_author_meta( 'user_email' ), 60 ); ?>
4242
</div>
4343
<div id="author-description">
4444
<h2><?php printf( __( 'About %s', 'twentyeleven' ), get_the_author() ); ?></h2>

themes/jquery/comments.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<?php endif; ?>
1717

1818
<ol class="commentlist">
19-
<?php wp_list_comments( array( 'callback' => 'twentyeleven_comment' ) ); ?>
19+
<?php wp_list_comments( array( 'callback' => 'jq_comment' ) ); ?>
2020
</ol>
2121

2222
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>

themes/jquery/content-single.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<header class="entry-header">
99
<?php if ( 'post' == get_post_type() ) : ?>
1010
<div class="entry-meta">
11-
<?php twentyeleven_posted_on(); ?>
11+
<?php jq_posted_on(); ?>
1212
</div><!-- .entry-meta -->
1313
<?php endif; ?>
1414
</header><!-- .entry-header -->
@@ -48,7 +48,7 @@
4848
<?php if ( get_the_author_meta( 'description' ) && is_multi_author() ) : // If a user has filled out their description and this is a multi-author blog, show a bio on their entries ?>
4949
<div id="author-info">
5050
<div id="author-avatar">
51-
<?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyeleven_author_bio_avatar_size', 68 ) ); ?>
51+
<?php echo get_avatar( get_the_author_meta( 'user_email' ), 68 ); ?>
5252
</div><!-- #author-avatar -->
5353
<div id="author-description">
5454
<h2><?php printf( esc_attr__( 'About %s', 'twentyeleven' ), get_the_author() ); ?></h2>

themes/jquery/content.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
<?php if ( 'post' == get_post_type() ) : ?>
2929
<div class="entry-meta">
30-
<?php twentyeleven_posted_on(); ?>
30+
<?php jq_posted_on(); ?>
3131
</div>
3232
<?php endif; ?>
3333
</header>

themes/jquery/functions.php

Lines changed: 22 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,16 @@
55
* For more information on hooks, actions, and filters, see https://codex.wordpress.org/Plugin_API.
66
*/
77

8-
require_once( 'functions.jquery.php' );
8+
require_once 'functions.jquery.php';
99

1010
/**
1111
* Set the content width based on the theme's design and stylesheet.
1212
*/
13-
if ( ! isset( $content_width ) )
13+
if ( !isset( $content_width ) ) {
1414
$content_width = 584;
15+
}
1516

16-
/**
17-
* Tell WordPress to run twentyeleven_setup() when the 'after_setup_theme' hook is run.
18-
*/
19-
add_action( 'after_setup_theme', 'twentyeleven_setup' );
20-
21-
if ( ! function_exists( 'twentyeleven_setup' ) ):
22-
/**
23-
* Sets up theme defaults and registers support for various WordPress features.
24-
*/
25-
function twentyeleven_setup() {
17+
add_action( 'after_setup_theme', function () {
2618
// This theme styles the visual editor with editor-style.css to match the theme style.
2719
add_editor_style();
2820

@@ -31,55 +23,38 @@ function twentyeleven_setup() {
3123

3224
// This theme uses wp_nav_menu() in one location.
3325
register_nav_menu( 'primary', __( 'Primary Menu', 'twentyeleven' ) );
34-
}
35-
endif; // twentyeleven_setup
26+
} );
3627

3728
/**
3829
* Returns a "Continue Reading" link for excerpts
3930
*/
40-
function twentyeleven_continue_reading_link() {
31+
function jq_continue_reading_link() {
4132
return ' <a href="'. esc_url( get_permalink() ) . '">' . __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) . '</a>';
4233
}
4334

4435
/**
45-
* Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and twentyeleven_continue_reading_link().
36+
* Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis
37+
* and jq_continue_reading_link().
4638
*
4739
* To override this in a child theme, remove the filter and add your own
4840
* function tied to the excerpt_more filter hook.
4941
*/
50-
function twentyeleven_auto_excerpt_more( $more ) {
51-
return ' &hellip;' . twentyeleven_continue_reading_link();
52-
}
53-
add_filter( 'excerpt_more', 'twentyeleven_auto_excerpt_more' );
54-
55-
/**
56-
* Adds a pretty "Continue Reading" link to custom post excerpts.
57-
*
58-
* To override this link in a child theme, remove the filter and add your own
59-
* function tied to the get_the_excerpt filter hook.
60-
*/
61-
function twentyeleven_custom_excerpt_more( $output ) {
62-
if ( has_excerpt() && ! is_attachment() ) {
63-
$output .= twentyeleven_continue_reading_link();
64-
}
65-
return $output;
66-
}
67-
// add_filter( 'get_the_excerpt', 'twentyeleven_custom_excerpt_more' );
42+
add_filter( 'excerpt_more', function ( $more ) {
43+
return ' &hellip;' . jq_continue_reading_link();
44+
} );
6845

6946
/**
7047
* Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link.
7148
*/
72-
function twentyeleven_page_menu_args( $args ) {
49+
add_filter( 'wp_page_menu_args', function ( $args ) {
7350
$args['show_home'] = true;
7451
return $args;
75-
}
76-
add_filter( 'wp_page_menu_args', 'twentyeleven_page_menu_args' );
52+
} );
7753

7854
/**
7955
* Register our sidebars and widgetized areas. Also register the default Epherma widget.
8056
*/
81-
function twentyeleven_widgets_init() {
82-
57+
add_action( 'widgets_init', function () {
8358
register_sidebar( array(
8459
'name' => __( 'Main Sidebar', 'twentyeleven' ),
8560
'id' => 'sidebar-1',
@@ -128,28 +103,12 @@ function twentyeleven_widgets_init() {
128103
'before_title' => '<h3 class="widget-title">',
129104
'after_title' => '</h3>',
130105
) );
131-
}
132-
add_action( 'widgets_init', 'twentyeleven_widgets_init' );
133-
134-
/**
135-
* Display navigation to next/previous pages when applicable
136-
*/
137-
function twentyeleven_content_nav( $nav_id ) {
138-
global $wp_query;
139-
140-
if ( $wp_query->max_num_pages > 1 ) : ?>
141-
<nav id="<?php echo $nav_id; ?>">
142-
<h3 class="assistive-text"><?php _e( 'Post navigation', 'twentyeleven' ); ?></h3>
143-
<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentyeleven' ) ); ?></div>
144-
<div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?></div>
145-
</nav><!-- #nav-above -->
146-
<?php endif;
147-
}
106+
} );
148107

149108
/**
150109
* Count the number of footer sidebars to enable dynamic classes for the footer
151110
*/
152-
function twentyeleven_footer_sidebar_class() {
111+
function jq_footer_sidebar_class() {
153112
$count = 0;
154113

155114
if ( is_active_sidebar( 'sidebar-3' ) )
@@ -179,16 +138,15 @@ function twentyeleven_footer_sidebar_class() {
179138
echo 'class="' . $class . '"';
180139
}
181140

182-
if ( ! function_exists( 'twentyeleven_comment' ) ) :
183141
/**
184142
* Template for comments and pingbacks.
185143
*
186144
* To override this walker in a child theme without modifying the comments template
187-
* simply create your own twentyeleven_comment(), and that function will be used instead.
145+
* simply create your own jq_comment(), and that function will be used instead.
188146
*
189147
* Used as a callback by wp_list_comments() for displaying the comments.
190148
*/
191-
function twentyeleven_comment( $comment, $args, $depth ) {
149+
function jq_comment( $comment, $args, $depth ) {
192150
$GLOBALS['comment'] = $comment;
193151
switch ( $comment->comment_type ) :
194152
case 'pingback' :
@@ -241,14 +199,12 @@ function twentyeleven_comment( $comment, $args, $depth ) {
241199
break;
242200
endswitch;
243201
}
244-
endif; // ends check for twentyeleven_comment()
245202

246-
if ( ! function_exists( 'twentyeleven_posted_on' ) ) :
247203
/**
248204
* Prints HTML with meta information for the current post-date/time and author.
249-
* Create your own twentyeleven_posted_on to override in a child theme
205+
* Create your own jq_posted_on to override in a child theme
250206
*/
251-
function twentyeleven_posted_on() {
207+
function jq_posted_on() {
252208
printf( __( '<span class="sep">Posted on </span><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s" pubdate>%4$s</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'twentyeleven' ),
253209
esc_url( get_permalink() ),
254210
esc_attr( get_the_time() ),
@@ -259,14 +215,13 @@ function twentyeleven_posted_on() {
259215
esc_html( get_the_author() )
260216
);
261217
}
262-
endif;
263218

264219
/**
265220
* Adds two classes to the array of body classes.
266221
* The first is if the site has only had one author with published posts.
267222
* The second is if a singular post being displayed
268223
*/
269-
function twentyeleven_body_classes( $classes ) {
224+
add_filter( 'body_class', function ( $classes ) {
270225

271226
if ( ! is_multi_author() ) {
272227
$classes[] = 'single-author';
@@ -276,5 +231,4 @@ function twentyeleven_body_classes( $classes ) {
276231
$classes[] = 'singular';
277232

278233
return $classes;
279-
}
280-
add_filter( 'body_class', 'twentyeleven_body_classes' );
234+
} );

themes/jquery/image.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
}
6868
?>
6969
<a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php
70-
$attachment_size = apply_filters( 'twentyeleven_attachment_size', 848 );
70+
$attachment_size = 848;
7171
echo wp_get_attachment_image( $post->ID, array( $attachment_size, 1024 ) ); // filterable image width with 1024px limit for image height.
7272
?></a>
7373

themes/jquery/sidebar-footer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
return;
1818
// If we get this far, we have widgets. Let do this.
1919
?>
20-
<div id="supplementary" <?php twentyeleven_footer_sidebar_class(); ?>>
20+
<div id="supplementary" <?php jq_footer_sidebar_class(); ?>>
2121
<?php if ( is_active_sidebar( 'sidebar-3' ) ) : ?>
2222
<div id="first" class="widget-area" role="complementary">
2323
<?php dynamic_sidebar( 'sidebar-3' ); ?>

0 commit comments

Comments
 (0)