Version Description
- UPDATE: WordPress 4.3 support.
- UPDATE: Rename settings option in database.
- NEW: Clean up database on uninstall.
Download this release
Release Info
Developer | sethta |
Plugin | No Page Comment |
Version | 1.1 |
Comparing to | |
See all releases |
Code changes from version 1.0.7 to 1.1
- lang/no-page-comment.pot +47 -32
- no-page-comment-settings.php +10 -4
- no-page-comment.php +64 -15
- readme.txt +13 -5
- uninstall.php +10 -0
lang/no-page-comment.pot
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
# Copyright (C)
|
2 |
# This file is distributed under the same license as the No Page Comment package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: No Page Comment 1.
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/no-page-comment\n"
|
7 |
"POT-Creation-Date: 2014-03-02 01:02:56+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
@@ -12,117 +12,132 @@ msgstr ""
|
|
12 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
|
15 |
-
#: no-page-comment-settings.php:
|
16 |
msgid "Settings Updated."
|
17 |
msgstr ""
|
18 |
|
19 |
-
#: no-page-comment-settings.php:
|
20 |
msgid "No Page Comment Settings"
|
21 |
msgstr ""
|
22 |
|
23 |
-
#: no-page-comment-settings.php:
|
24 |
msgid "Disable comments on new:"
|
25 |
msgstr ""
|
26 |
|
27 |
-
#: no-page-comment-settings.php:
|
28 |
msgid "Comments"
|
29 |
msgstr ""
|
30 |
|
31 |
-
#: no-page-comment-settings.php:
|
32 |
msgid "Trackbacks"
|
33 |
msgstr ""
|
34 |
|
35 |
-
#: no-page-comment-settings.php:
|
36 |
msgid "Update Settings"
|
37 |
msgstr ""
|
38 |
|
39 |
-
#: no-page-comment-settings.php:
|
40 |
msgid "Modify all current:"
|
41 |
msgstr ""
|
42 |
|
43 |
-
#: no-page-comment-settings.php:
|
44 |
msgid "Disable All Comments"
|
45 |
msgstr ""
|
46 |
|
47 |
-
#: no-page-comment-settings.php:
|
48 |
msgid "Enable All Comments"
|
49 |
msgstr ""
|
50 |
|
51 |
-
#: no-page-comment-settings.php:
|
52 |
msgid "Disable All Trackbacks"
|
53 |
msgstr ""
|
54 |
|
55 |
-
#: no-page-comment-settings.php:
|
56 |
msgid "Enable All Trackbacks"
|
57 |
msgstr ""
|
58 |
|
59 |
-
#: no-page-comment-settings.php:
|
60 |
msgid "Other plugins by"
|
61 |
msgstr ""
|
62 |
|
63 |
-
#: no-page-comment-settings.php:
|
64 |
msgid "Support No Page Comment:"
|
65 |
msgstr ""
|
66 |
|
67 |
-
#: no-page-comment-settings.php:
|
68 |
msgid "Donate to support the No Page Comment plugin development"
|
69 |
msgstr ""
|
70 |
|
71 |
-
#: no-page-comment-settings.php:
|
72 |
msgid "Donate"
|
73 |
msgstr ""
|
74 |
|
75 |
-
#: no-page-comment-settings.php:
|
76 |
msgid "Write a Review about No Page Comment"
|
77 |
msgstr ""
|
78 |
|
79 |
-
#: no-page-comment-settings.php:
|
80 |
msgid "Write a Review"
|
81 |
msgstr ""
|
82 |
|
83 |
-
#: no-page-comment-settings.php:
|
84 |
msgid "Fork No Page Comment on Github"
|
85 |
msgstr ""
|
86 |
|
87 |
-
#: no-page-comment-settings.php:
|
88 |
msgid "Fork No Page Comment"
|
89 |
msgstr ""
|
90 |
|
91 |
-
#: no-page-comment-settings.php:
|
92 |
msgid "Report an Issue on Github"
|
93 |
msgstr ""
|
94 |
|
95 |
-
#: no-page-comment-settings.php:
|
96 |
msgid "Report an Issue about No Page Comment"
|
97 |
msgstr ""
|
98 |
|
99 |
-
#: no-page-comment-settings.php:
|
100 |
msgid "Help Translate No Page Comment"
|
101 |
msgstr ""
|
102 |
|
103 |
-
#: no-page-comment-settings.php:
|
104 |
msgid "Offer to Translate No Page Comment"
|
105 |
msgstr ""
|
106 |
|
107 |
-
#: no-page-comment-settings.php:
|
108 |
msgid "Translation Thanks:"
|
109 |
msgstr ""
|
110 |
|
111 |
-
#: no-page-comment.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
msgid "Settings"
|
113 |
msgstr ""
|
114 |
|
115 |
-
#: no-page-comment.php:
|
116 |
msgid "Comment and trackback defaults controlled through"
|
117 |
msgstr ""
|
118 |
|
119 |
-
#. Plugin Name of the plugin/theme no-page-comment.php:
|
120 |
msgid "No Page Comment"
|
121 |
msgstr ""
|
122 |
|
123 |
#. Description of the plugin/theme
|
124 |
msgid ""
|
125 |
-
"
|
126 |
-
"and
|
127 |
-
"giving you the ability to individually set them on a page or post basis."
|
128 |
msgstr ""
|
1 |
+
# Copyright (C) 2015 No Page Comment
|
2 |
# This file is distributed under the same license as the No Page Comment package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: No Page Comment 1.1\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/no-page-comment\n"
|
7 |
"POT-Creation-Date: 2014-03-02 01:02:56+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
12 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
|
15 |
+
#: no-page-comment-settings.php:37
|
16 |
msgid "Settings Updated."
|
17 |
msgstr ""
|
18 |
|
19 |
+
#: no-page-comment-settings.php:41 no-page-comment.php:153 no-page-comment.php:163
|
20 |
msgid "No Page Comment Settings"
|
21 |
msgstr ""
|
22 |
|
23 |
+
#: no-page-comment-settings.php:50
|
24 |
msgid "Disable comments on new:"
|
25 |
msgstr ""
|
26 |
|
27 |
+
#: no-page-comment-settings.php:59
|
28 |
msgid "Comments"
|
29 |
msgstr ""
|
30 |
|
31 |
+
#: no-page-comment-settings.php:61
|
32 |
msgid "Trackbacks"
|
33 |
msgstr ""
|
34 |
|
35 |
+
#: no-page-comment-settings.php:69
|
36 |
msgid "Update Settings"
|
37 |
msgstr ""
|
38 |
|
39 |
+
#: no-page-comment-settings.php:76
|
40 |
msgid "Modify all current:"
|
41 |
msgstr ""
|
42 |
|
43 |
+
#: no-page-comment-settings.php:85
|
44 |
msgid "Disable All Comments"
|
45 |
msgstr ""
|
46 |
|
47 |
+
#: no-page-comment-settings.php:86
|
48 |
msgid "Enable All Comments"
|
49 |
msgstr ""
|
50 |
|
51 |
+
#: no-page-comment-settings.php:89
|
52 |
msgid "Disable All Trackbacks"
|
53 |
msgstr ""
|
54 |
|
55 |
+
#: no-page-comment-settings.php:90
|
56 |
msgid "Enable All Trackbacks"
|
57 |
msgstr ""
|
58 |
|
59 |
+
#: no-page-comment-settings.php:107
|
60 |
msgid "Other plugins by"
|
61 |
msgstr ""
|
62 |
|
63 |
+
#: no-page-comment-settings.php:116
|
64 |
msgid "Support No Page Comment:"
|
65 |
msgstr ""
|
66 |
|
67 |
+
#: no-page-comment-settings.php:119
|
68 |
msgid "Donate to support the No Page Comment plugin development"
|
69 |
msgstr ""
|
70 |
|
71 |
+
#: no-page-comment-settings.php:119
|
72 |
msgid "Donate"
|
73 |
msgstr ""
|
74 |
|
75 |
+
#: no-page-comment-settings.php:120
|
76 |
msgid "Write a Review about No Page Comment"
|
77 |
msgstr ""
|
78 |
|
79 |
+
#: no-page-comment-settings.php:120
|
80 |
msgid "Write a Review"
|
81 |
msgstr ""
|
82 |
|
83 |
+
#: no-page-comment-settings.php:121
|
84 |
msgid "Fork No Page Comment on Github"
|
85 |
msgstr ""
|
86 |
|
87 |
+
#: no-page-comment-settings.php:121
|
88 |
msgid "Fork No Page Comment"
|
89 |
msgstr ""
|
90 |
|
91 |
+
#: no-page-comment-settings.php:122
|
92 |
msgid "Report an Issue on Github"
|
93 |
msgstr ""
|
94 |
|
95 |
+
#: no-page-comment-settings.php:122
|
96 |
msgid "Report an Issue about No Page Comment"
|
97 |
msgstr ""
|
98 |
|
99 |
+
#: no-page-comment-settings.php:123
|
100 |
msgid "Help Translate No Page Comment"
|
101 |
msgstr ""
|
102 |
|
103 |
+
#: no-page-comment-settings.php:123
|
104 |
msgid "Offer to Translate No Page Comment"
|
105 |
msgstr ""
|
106 |
|
107 |
+
#: no-page-comment-settings.php:129
|
108 |
msgid "Translation Thanks:"
|
109 |
msgstr ""
|
110 |
|
111 |
+
#: no-page-comment-settings.php:132
|
112 |
+
msgid "Dutch and Italian:"
|
113 |
+
msgstr ""
|
114 |
+
|
115 |
+
#: no-page-comment-settings.php:133
|
116 |
+
msgid "Serbian:"
|
117 |
+
msgstr ""
|
118 |
+
|
119 |
+
#: no-page-comment-settings.php:134
|
120 |
+
msgid "Spanish:"
|
121 |
+
msgstr ""
|
122 |
+
|
123 |
+
#: no-page-comment-settings.php:135
|
124 |
+
msgid "Swedish:"
|
125 |
+
msgstr ""
|
126 |
+
|
127 |
+
#: no-page-comment.php:144
|
128 |
msgid "Settings"
|
129 |
msgstr ""
|
130 |
|
131 |
+
#: no-page-comment.php:163
|
132 |
msgid "Comment and trackback defaults controlled through"
|
133 |
msgstr ""
|
134 |
|
135 |
+
#. Plugin Name of the plugin/theme no-page-comment.php:153
|
136 |
msgid "No Page Comment"
|
137 |
msgstr ""
|
138 |
|
139 |
#. Description of the plugin/theme
|
140 |
msgid ""
|
141 |
+
"An admin interface to control the default comment and trackback settings on "
|
142 |
+
"new posts, pages and custom post types."
|
|
|
143 |
msgstr ""
|
no-page-comment-settings.php
CHANGED
@@ -1,3 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
2 |
<form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>" class="wrap npc-settings">
|
3 |
|
@@ -123,10 +129,10 @@ if ( isset($_POST['update_sta_npc_plugin_settings']) ) {
|
|
123 |
<h3 style="cursor:default;"><span><?php _e('Translation Thanks:', $this->plugin_domain ); ?></span></h3>
|
124 |
<div class="inside">
|
125 |
<ul>
|
126 |
-
<li style="padding:5px 0;"
|
127 |
-
<li style="padding:5px 0;"
|
128 |
-
<li style="padding:5px 0;"
|
129 |
-
<li style="padding:5px 0;"
|
130 |
</ul>
|
131 |
</div>
|
132 |
</div>
|
1 |
+
<?php
|
2 |
+
// Prevent direct access
|
3 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
+
exit( 'This plugin requires WordPress' );
|
5 |
+
}
|
6 |
+
?>
|
7 |
|
8 |
<form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>" class="wrap npc-settings">
|
9 |
|
129 |
<h3 style="cursor:default;"><span><?php _e('Translation Thanks:', $this->plugin_domain ); ?></span></h3>
|
130 |
<div class="inside">
|
131 |
<ul>
|
132 |
+
<li style="padding:5px 0;"><?php _e('Dutch and Italian:', $this->plugin_domain ); ?> <a href="http://www.fravaco.be/" title="Fravaco" target="_blank">Fravaco</a></li>
|
133 |
+
<li style="padding:5px 0;"><?php _e('Serbian:', $this->plugin_domain ); ?> <a href="http://firstsiteguide.com/" title="firstsiteguide.com" target="_blank">firstsiteguide.com</a></li>
|
134 |
+
<li style="padding:5px 0;"><?php _e('Spanish:', $this->plugin_domain ); ?> <a href="http://www.webhostinghub.com/" title="Maria Ramos, WebHostingHub" target="_blank">Maria Ramos, WebHostingHub</a></li>
|
135 |
+
<li style="padding:5px 0;"><?php _e('Swedish:', $this->plugin_domain ); ?> <a href="http://adevade.com/" title="Andréas Lundgren" target="_blank">Andréas Lundgren</a></li>
|
136 |
</ul>
|
137 |
</div>
|
138 |
</div>
|
no-page-comment.php
CHANGED
@@ -2,13 +2,13 @@
|
|
2 |
/*
|
3 |
Plugin Name: No Page Comment
|
4 |
Plugin URI: http://sethalling.com/plugins/no-page-comment
|
5 |
-
Description:
|
6 |
-
Version: 1.
|
7 |
Author: Seth Alling
|
8 |
Author URI: http://sethalling.com/
|
9 |
Text Domain: no-page-comment
|
10 |
|
11 |
-
Plugin: Copyright (c) 2011-
|
12 |
|
13 |
This program is free software; you can redistribute it and/or
|
14 |
modify it under the terms of the GNU General Public License
|
@@ -33,6 +33,11 @@ Text Domain: no-page-comment
|
|
33 |
Plugin developed by: http://sethalling.com |___/ `""""`
|
34 |
*/
|
35 |
|
|
|
|
|
|
|
|
|
|
|
36 |
register_activation_hook( __FILE__, 'sta_npc_activate' );
|
37 |
|
38 |
define( 'STA_NPC_WP_VERSION', version_compare( get_bloginfo( 'version' ), '3.4', '>=' ) );
|
@@ -54,10 +59,10 @@ if ( ! function_exists( 'sta_npc_load' ) ) {
|
|
54 |
function sta_npc_load() {
|
55 |
if ( ! class_exists( 'STA_NPC_Plugin' ) ) {
|
56 |
class STA_NPC_Plugin {
|
57 |
-
var $admin_options_name
|
58 |
-
$
|
59 |
-
$plugin_domain
|
60 |
-
public $plugin_name
|
61 |
public $plugin_file;
|
62 |
public $plugin_dir;
|
63 |
public $wp_posttypes = array(
|
@@ -87,6 +92,12 @@ if ( ! function_exists( 'sta_npc_load' ) ) {
|
|
87 |
// Returns an array of admin options
|
88 |
function sta_npc_get_admin_options() {
|
89 |
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
$sta_npc_admin_options = array(
|
91 |
'disable_comments_post' => '',
|
92 |
'disable_trackbacks_post' => '',
|
@@ -104,7 +115,7 @@ if ( ! function_exists( 'sta_npc_load' ) ) {
|
|
104 |
$sta_npc_admin_options['disable_trackbacks_' . $posttype->name] = 'true';
|
105 |
} // end foreach post types
|
106 |
|
107 |
-
$sta_npc_options = get_option($this->admin_options_name);
|
108 |
if ( ! empty( $sta_npc_options ) ) {
|
109 |
|
110 |
foreach ( $sta_npc_options as $key => $option )
|
@@ -166,12 +177,49 @@ if ( ! function_exists( 'sta_npc_load' ) ) {
|
|
166 |
<?php }
|
167 |
}
|
168 |
|
169 |
-
// Disable comments with hook
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
170 |
function sta_no_page_comment() {
|
171 |
global $pagenow;
|
172 |
$sta_npc_options = $this->sta_npc_get_admin_options();
|
173 |
if ( ( is_admin() ) && ( $pagenow == 'post-new.php' ) ) {
|
174 |
-
wp_enqueue_script( 'jquery' );
|
175 |
$posttype = ( isset( $_GET['post_type'] ) ) ? $_GET['post_type'] : 'post';
|
176 |
|
177 |
if ( $sta_npc_options['disable_comments_' . $posttype] == 'true' ) {
|
@@ -182,12 +230,11 @@ if ( ! function_exists( 'sta_npc_load' ) ) {
|
|
182 |
}
|
183 |
}
|
184 |
|
185 |
-
// Disable trackbacks with hook
|
186 |
function sta_no_page_trackback() {
|
187 |
global $pagenow;
|
188 |
$sta_npc_options = $this->sta_npc_get_admin_options();
|
189 |
if ( ( is_admin() ) && ( $pagenow == 'post-new.php' ) ) {
|
190 |
-
wp_enqueue_script( 'jquery' );
|
191 |
$posttype = ( isset( $_GET['post_type'] ) ) ? $_GET['post_type'] : 'post';
|
192 |
|
193 |
if ( $sta_npc_options['disable_trackbacks_' . $posttype] == 'true' ) {
|
@@ -391,11 +438,13 @@ if ( ! function_exists( 'sta_npc_load' ) ) {
|
|
391 |
add_filter( 'plugin_action_links', array( &$sta_npc_plugin, 'sta_npc_settings_link' ), 10, 2 ); // Add settings link to plugins page
|
392 |
add_filter( 'admin_head', array(&$sta_npc_plugin, 'sta_discussion_options' ) ); // Change discussion options replace defaults with link to NPC settings
|
393 |
|
394 |
-
//
|
395 |
-
if (
|
|
|
|
|
396 |
add_filter( 'pre_option_default_comment_status', array(&$sta_npc_plugin, 'sta_no_page_comment' ) ); // Comment settings
|
397 |
add_filter( 'pre_option_default_ping_status', array(&$sta_npc_plugin, 'sta_no_page_trackback' ) ); // Trackback settings
|
398 |
-
} else {
|
399 |
add_action( 'admin_head', array( &$sta_npc_plugin, 'sta_no_page_comment_jquery' ) ); // Add jquery scripts
|
400 |
}
|
401 |
|
2 |
/*
|
3 |
Plugin Name: No Page Comment
|
4 |
Plugin URI: http://sethalling.com/plugins/no-page-comment
|
5 |
+
Description: An admin interface to control the default comment and trackback settings on new posts, pages and custom post types.
|
6 |
+
Version: 1.1
|
7 |
Author: Seth Alling
|
8 |
Author URI: http://sethalling.com/
|
9 |
Text Domain: no-page-comment
|
10 |
|
11 |
+
Plugin: Copyright (c) 2011-2015 Seth Alling
|
12 |
|
13 |
This program is free software; you can redistribute it and/or
|
14 |
modify it under the terms of the GNU General Public License
|
33 |
Plugin developed by: http://sethalling.com |___/ `""""`
|
34 |
*/
|
35 |
|
36 |
+
// Prevent direct access
|
37 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
38 |
+
exit( 'This plugin requires WordPress' );
|
39 |
+
}
|
40 |
+
|
41 |
register_activation_hook( __FILE__, 'sta_npc_activate' );
|
42 |
|
43 |
define( 'STA_NPC_WP_VERSION', version_compare( get_bloginfo( 'version' ), '3.4', '>=' ) );
|
59 |
function sta_npc_load() {
|
60 |
if ( ! class_exists( 'STA_NPC_Plugin' ) ) {
|
61 |
class STA_NPC_Plugin {
|
62 |
+
var $admin_options_name = 'sta_npc_options',
|
63 |
+
$admin_options_name_old = 'sta_npc_admin_options_name',
|
64 |
+
$plugin_domain = 'no-page-comment';
|
65 |
+
public $plugin_name = 'no-page-comment';
|
66 |
public $plugin_file;
|
67 |
public $plugin_dir;
|
68 |
public $wp_posttypes = array(
|
92 |
// Returns an array of admin options
|
93 |
function sta_npc_get_admin_options() {
|
94 |
|
95 |
+
// Rename options from old options name
|
96 |
+
if ( get_option( $this->admin_options_name_old ) ) {
|
97 |
+
update_option( $this->admin_options_name, get_option( $this->admin_options_name_old ) );
|
98 |
+
delete_option( $this->admin_options_name_old );
|
99 |
+
}
|
100 |
+
|
101 |
$sta_npc_admin_options = array(
|
102 |
'disable_comments_post' => '',
|
103 |
'disable_trackbacks_post' => '',
|
115 |
$sta_npc_admin_options['disable_trackbacks_' . $posttype->name] = 'true';
|
116 |
} // end foreach post types
|
117 |
|
118 |
+
$sta_npc_options = get_option( $this->admin_options_name );
|
119 |
if ( ! empty( $sta_npc_options ) ) {
|
120 |
|
121 |
foreach ( $sta_npc_options as $key => $option )
|
177 |
<?php }
|
178 |
}
|
179 |
|
180 |
+
// Disable comments and trackbacks on at least WP version 4.3 with a hook
|
181 |
+
function wpdocs_open_comments_for_myposttype( $status, $post_type, $comment_type ) {
|
182 |
+
$sta_npc_options = $this->sta_npc_get_admin_options();
|
183 |
+
|
184 |
+
if ( $comment_type == 'comment' ) { // Check if comment or trackback
|
185 |
+
|
186 |
+
if ( isset( $sta_npc_options['disable_comments_' . $post_type] ) ) {
|
187 |
+
|
188 |
+
if ( $sta_npc_options['disable_comments_' . $post_type] == 'true' ) {
|
189 |
+
return 'closed';
|
190 |
+
} else {
|
191 |
+
return 'open';
|
192 |
+
}
|
193 |
+
|
194 |
+
} else {
|
195 |
+
return $status;
|
196 |
+
}
|
197 |
+
|
198 |
+
} elseif ( $comment_type == 'pingback' ) { // Double check if trackback
|
199 |
+
|
200 |
+
if ( isset( $sta_npc_options['disable_trackbacks_' . $post_type] ) ) {
|
201 |
+
|
202 |
+
if ( $sta_npc_options['disable_trackbacks_' . $post_type] == 'true' ) {
|
203 |
+
return 'closed';
|
204 |
+
} else {
|
205 |
+
return 'open';
|
206 |
+
}
|
207 |
+
|
208 |
+
} else {
|
209 |
+
return $status;
|
210 |
+
}
|
211 |
+
|
212 |
+
} else { // This should never happen, but just in case
|
213 |
+
return $status;
|
214 |
+
}
|
215 |
+
|
216 |
+
}
|
217 |
+
|
218 |
+
// Disable comments with hook on WP versions 3.4-4.2
|
219 |
function sta_no_page_comment() {
|
220 |
global $pagenow;
|
221 |
$sta_npc_options = $this->sta_npc_get_admin_options();
|
222 |
if ( ( is_admin() ) && ( $pagenow == 'post-new.php' ) ) {
|
|
|
223 |
$posttype = ( isset( $_GET['post_type'] ) ) ? $_GET['post_type'] : 'post';
|
224 |
|
225 |
if ( $sta_npc_options['disable_comments_' . $posttype] == 'true' ) {
|
230 |
}
|
231 |
}
|
232 |
|
233 |
+
// Disable trackbacks with hook on versions 3.4-4.2
|
234 |
function sta_no_page_trackback() {
|
235 |
global $pagenow;
|
236 |
$sta_npc_options = $this->sta_npc_get_admin_options();
|
237 |
if ( ( is_admin() ) && ( $pagenow == 'post-new.php' ) ) {
|
|
|
238 |
$posttype = ( isset( $_GET['post_type'] ) ) ? $_GET['post_type'] : 'post';
|
239 |
|
240 |
if ( $sta_npc_options['disable_trackbacks_' . $posttype] == 'true' ) {
|
438 |
add_filter( 'plugin_action_links', array( &$sta_npc_plugin, 'sta_npc_settings_link' ), 10, 2 ); // Add settings link to plugins page
|
439 |
add_filter( 'admin_head', array(&$sta_npc_plugin, 'sta_discussion_options' ) ); // Change discussion options replace defaults with link to NPC settings
|
440 |
|
441 |
+
// Run correct function depending on version
|
442 |
+
if ( function_exists( 'get_default_comment_status' ) ) {
|
443 |
+
add_filter( 'get_default_comment_status', array(&$sta_npc_plugin, 'wpdocs_open_comments_for_myposttype' ), 10, 3 ); // Comment settings
|
444 |
+
} elseif ( STA_NPC_WP_VERSION ) {
|
445 |
add_filter( 'pre_option_default_comment_status', array(&$sta_npc_plugin, 'sta_no_page_comment' ) ); // Comment settings
|
446 |
add_filter( 'pre_option_default_ping_status', array(&$sta_npc_plugin, 'sta_no_page_trackback' ) ); // Trackback settings
|
447 |
+
} else { // Use jQuery for WordPress versions earlier than 3.4
|
448 |
add_action( 'admin_head', array( &$sta_npc_plugin, 'sta_no_page_comment_jquery' ) ); // Add jquery scripts
|
449 |
}
|
450 |
|
readme.txt
CHANGED
@@ -4,16 +4,16 @@ Contributors: sethta
|
|
4 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5WWP2EDSCAJR4
|
5 |
Tags: admin, comments, custom post type, discussion, pages, posts, attachment, attachments, media, settings, tools, trackbacks
|
6 |
Requires at least: 3.1
|
7 |
-
Tested up to: 4.
|
8 |
Stable tag: trunk
|
9 |
|
10 |
-
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
-
|
15 |
|
16 |
-
|
17 |
|
18 |
Also, this plugin provides a way to quickly disable all comments or pingbacks for a specific custom post type. It directly interacts with your database to modify the status, so it is highly recommended that you backup your database first. There shouldn't be any issues using this feature, but it's always good to play it safe.
|
19 |
|
@@ -73,10 +73,15 @@ Of course, although *it is highly recommended that you backup your blog's databa
|
|
73 |
|
74 |
== Screenshots ==
|
75 |
|
76 |
-
1. The Settings page on a fresh WordPress 4.
|
77 |
|
78 |
== Changelog ==
|
79 |
|
|
|
|
|
|
|
|
|
|
|
80 |
= 1.0.7 =
|
81 |
* NEW: Add Dutch language support.
|
82 |
* NEW: Add Italian language support.
|
@@ -123,6 +128,9 @@ Of course, although *it is highly recommended that you backup your blog's databa
|
|
123 |
|
124 |
== Upgrade Notice ==
|
125 |
|
|
|
|
|
|
|
126 |
= 1.0 =
|
127 |
Improves plugin performance and adds ability to enable/disable all comments or trackbacks on attachment pages. All previous No Page Comment settings will remain intact with upgrade.
|
128 |
|
4 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5WWP2EDSCAJR4
|
5 |
Tags: admin, comments, custom post type, discussion, pages, posts, attachment, attachments, media, settings, tools, trackbacks
|
6 |
Requires at least: 3.1
|
7 |
+
Tested up to: 4.3
|
8 |
Stable tag: trunk
|
9 |
|
10 |
+
An admin interface to control the default comment and trackback settings on new posts, pages and custom post types.
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
+
Up until recently, WordPress gave two options: You could either disable comments and trackbacks by default for all pages and posts, or you could have them active by default. In WordPress version 4.3, this finally changed so comments are always disabled on new pages.
|
15 |
|
16 |
+
While the new change makes it easier for many of the sites, it make it harder for people who need to get the reverse and enable comments on all pages, or if they need to change the default for a custom post type. This plugin allows you to choose whether comments are enabled or disabled by default on all new posts, pages and custom post types, while still giving the ability to individually enable comments on posts or pages.
|
17 |
|
18 |
Also, this plugin provides a way to quickly disable all comments or pingbacks for a specific custom post type. It directly interacts with your database to modify the status, so it is highly recommended that you backup your database first. There shouldn't be any issues using this feature, but it's always good to play it safe.
|
19 |
|
73 |
|
74 |
== Screenshots ==
|
75 |
|
76 |
+
1. The Settings page on a fresh WordPress 4.3 installation
|
77 |
|
78 |
== Changelog ==
|
79 |
|
80 |
+
= 1.1 =
|
81 |
+
* UPDATE: WordPress 4.3 support.
|
82 |
+
* UPDATE: Rename settings option in database.
|
83 |
+
* NEW: Clean up database on uninstall.
|
84 |
+
|
85 |
= 1.0.7 =
|
86 |
* NEW: Add Dutch language support.
|
87 |
* NEW: Add Italian language support.
|
128 |
|
129 |
== Upgrade Notice ==
|
130 |
|
131 |
+
= 1.1 =
|
132 |
+
Supports new core default comment change in WordPress 4.3. Adds database cleanup on uninstall. All previous No Page Comment settings will remain intact with upgrade.
|
133 |
+
|
134 |
= 1.0 =
|
135 |
Improves plugin performance and adds ability to enable/disable all comments or trackbacks on attachment pages. All previous No Page Comment settings will remain intact with upgrade.
|
136 |
|
uninstall.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<?php
|
3 |
+
// If uninstall is not called from WordPress, exit
|
4 |
+
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
|
5 |
+
exit();
|
6 |
+
}
|
7 |
+
|
8 |
+
$option_name = 'sta_npc_admin_options_name';
|
9 |
+
|
10 |
+
delete_option( $option_name );
|