PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 14.4.2
Jetpack – WP Security, Backup, Speed, & Growth v14.4.2
12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 13.9.2 14.0.1 14.1.1 14.2.2 14.3.1 14.4.2 All 500 releases
jetpack / modules / theme-tools / compat / twentysixteen.php
twentysixteen.php
60 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Jetpack Compatibility File
4 * See: https://jetpack.com/
5 *
6 * @package automattic/jetpack
7 */
8
9 /**
10 * Add Jetpack theme supports for Twenty Sixteen.
11 */
12 function twentysixteen_jetpack_setup() {
13 /**
14 * Add theme support for Responsive Videos.
15 */
16 add_theme_support( 'jetpack-responsive-videos' );
17 }
18 add_action( 'after_setup_theme', 'twentysixteen_jetpack_setup' );
19
20 /**
21 * Enqueue Jetpack compat styles for Twenty Sixteen.
22 */
23 function twentysixteen_init_jetpack() {
24 /**
25 * Add our compat CSS file for custom widget stylings and such.
26 * Set the version equal to filemtime for development builds, and the JETPACK__VERSION for production
27 * or skip it entirely for wpcom.
28 */
29 if ( ! is_admin() ) {
30 $version = false;
31 if ( method_exists( 'Jetpack', 'is_development_version' ) ) {
32 $version = Jetpack::is_development_version() ? filemtime( plugin_dir_path( __FILE__ ) . 'twentysixteen.css' ) : JETPACK__VERSION;
33 }
34 wp_enqueue_style( 'twentysixteen-jetpack', plugins_url( 'twentysixteen.css', __FILE__ ), array(), $version );
35 wp_style_add_data( 'twentysixteen-jetpack', 'rtl', 'replace' );
36 }
37 }
38 add_action( 'init', 'twentysixteen_init_jetpack' );
39
40 /**
41 * Alter gallery widget default width.
42 */
43 function twentysixteen_gallery_widget_content_width() {
44 return 390;
45 }
46 add_filter( 'gallery_widget_content_width', 'twentysixteen_gallery_widget_content_width' );
47
48 /**
49 * Remove ratings from excerpts that are used as intro on blog index, single, and archive pages.
50 */
51 function twentysixteen_remove_share() {
52 if ( is_single() || is_archive() || is_home() ) {
53 remove_filter( 'the_excerpt', 'sharing_display', 19 );
54 if ( class_exists( 'Jetpack_Likes' ) ) {
55 remove_filter( 'the_excerpt', array( Jetpack_Likes::init(), 'post_likes' ), 30 );
56 }
57 }
58 }
59 add_action( 'loop_start', 'twentysixteen_remove_share' );
60