This repository has been archived by the owner on May 20, 2021. It is now read-only.
/
tweaks.php
55 lines (49 loc) · 1.56 KB
/
tweaks.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/**
* Custom functions that act independently of the theme templates
*
* Eventually, some of the functionality here could be replaced by core features
*
* @package Alien Ship
* @since Alien Ship 0.1
*/
/* @since Alien Ship 0.3
* We don't need to self-close these tags in html5: <img>, <input> */
function alienship_remove_self_closing_tags($input) {
return str_replace(' />', '>', $input);
}
add_filter('get_avatar', 'alienship_remove_self_closing_tags');
add_filter('comment_id_fields', 'alienship_remove_self_closing_tags');
add_filter('post_thumbnail_html', 'alienship_remove_self_closing_tags');
/**
* Adds custom classes to the array of body classes.
*
* @since Alien Ship 0.1
*/
/* function alienship_body_classes( $classes ) {
// If this isn't a post or a page we'll add the convenient .indexed class
if ( ! is_singular() ) {
$classes[] = 'indexed';
}
// Adds a class of single-author to blogs with only 1 published author
if ( is_multi_author() ) {
$classes[] = 'group-blog';
}
return $classes;
}
add_filter( 'body_class', 'alienship_body_classes' );
*/
/**
* Filter in a link to a content ID attribute for the next/previous image links on image attachment pages
*
* @since Alien Ship 0.1
*/
/* function alienship_enhanced_image_navigation( $url, $id ) {
if ( ! is_attachment() && ! wp_attachment_is_image( $id ) )
return $url;
$image = get_post( $id );
if ( ! empty( $image->post_parent ) && $image->post_parent != $id )
$url .= '#main';
return $url;
}
add_filter( 'attachment_link', 'alienship_enhanced_image_navigation', 10, 2 ); */