-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
42 lines (39 loc) · 1.03 KB
/
index.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
<?php
/**
* Plugin Name: Jetpack Carousel Enhancements
* Description: Hides the comment form and moves the close icon to the top-right part of the screen inside the Jetpack Carousel screen.
* Version: 0.1.0
* Author: Dmitry Mayorov
* Author URI: https://dmtrmrv.com
*
* @package Jetpack Carousel Enhancements
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
/**
* Removes comment form from all attachment pages.
*
* @param bool $open Whether the current post is open for comments.
* @param int|WP_Post $post_id The post ID or WP_Post object.
*/
function jce_remove_attachment_comments( $open, $post_id ) {
$post = get_post( $post_id );
if ( 'attachment' == $post->post_type ) {
return false;
}
return $open;
}
add_filter( 'comments_open', 'jce_remove_attachment_comments', 10 , 2 );
/**
* Add enhancement styles.
*/
function jce_styles() {
wp_enqueue_style(
'jce_style',
plugin_dir_url( __FILE__ ) . '/style.css',
array()
);
}
add_action( 'wp_enqueue_scripts', 'jce_styles' );