Changeset 2330525
- Timestamp:
- 06/25/2020 09:36:03 AM (6 years ago)
- Location:
- wpdefaultprivate
- Files:
-
- 7 added
- 5 edited
-
tags/1.2.0 (added)
-
tags/1.2.0/languages (added)
-
tags/1.2.0/languages/wpdefaultprivate-nl_NL.mo (added)
-
tags/1.2.0/languages/wpdefaultprivate-nl_NL.po (added)
-
tags/1.2.0/languages/wpdefaultprivate.pot (added)
-
tags/1.2.0/readme.txt (added)
-
tags/1.2.0/wpdefaultprivate.php (added)
-
trunk/languages/wpdefaultprivate-nl_NL.mo (modified) (previous)
-
trunk/languages/wpdefaultprivate-nl_NL.po (modified) (2 diffs)
-
trunk/languages/wpdefaultprivate.pot (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/wpdefaultprivate.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wpdefaultprivate/trunk/languages/wpdefaultprivate-nl_NL.po
r2285467 r2330525 1 1 msgid "" 2 2 msgstr "" 3 "Project-Id-Version: wpDefaultPrivate 1. 1.3\n"3 "Project-Id-Version: wpDefaultPrivate 1.2.0\n" 4 4 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wpDefaultPrivate\n" 5 "POT-Creation-Date: 20 19-04-2200:00:00+00:00\n"5 "POT-Creation-Date: 2020-06-25 00:00:00+00:00\n" 6 6 "PO-Revision-Date: \n" 7 7 "Last-Translator: \n" … … 17 17 msgstr "Privé" 18 18 19 #: wpdefaultprivate.php: 9519 #: wpdefaultprivate.php:101 20 20 msgid "You do not have sufficient permissions to access this page." 21 21 msgstr "Je hebt onvoldoende rechten voor het bekijken van deze pagina." 22 22 23 #: wpdefaultprivate.php:1 2223 #: wpdefaultprivate.php:147 24 24 msgid "Settings Saved" 25 25 msgstr "Instellingen Opgeslagen" 26 26 27 #: wpdefaultprivate.php:1 3527 #: wpdefaultprivate.php:160 28 28 msgid "wpDefaultPrivate Settings" 29 29 msgstr "wpDefaultPrivate Instellingen" 30 30 31 #: wpdefaultprivate.php:1 4131 #: wpdefaultprivate.php:166 32 32 msgid "Private Posts visible for all users" 33 33 msgstr "Privé Berichten zichtbaar voor alle gebruikers" 34 34 35 #: wpdefaultprivate.php:150 35 #: wpdefaultprivate.php:174 36 msgid "Private Pages visible for all users" 37 msgstr "Privé Pagina's zichtbaar voor alle gebruikers" 38 39 #: wpdefaultprivate.php:183 36 40 msgid "Save Changes" 37 41 msgstr "Wijzigingen Opslaan" -
wpdefaultprivate/trunk/languages/wpdefaultprivate.pot
r2285467 r2330525 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: wpDefaultPrivate 1. 1.3\n"5 "Project-Id-Version: wpDefaultPrivate 1.2.0\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wpDefaultPrivate\n" 7 "POT-Creation-Date: 2020-0 4-1700:00:00+00:00\n"7 "POT-Creation-Date: 2020-06-25 00:00:00+00:00\n" 8 8 "MIME-Version: 1.0\n" 9 9 "Content-Type: text/plain; charset=UTF-8\n" … … 17 17 msgstr "" 18 18 19 #: wpdefaultprivate.php: 9519 #: wpdefaultprivate.php:101 20 20 msgid "You do not have sufficient permissions to access this page." 21 21 msgstr "" 22 22 23 #: wpdefaultprivate.php:1 2223 #: wpdefaultprivate.php:147 24 24 msgid "Settings Saved" 25 25 msgstr "" 26 26 27 #: wpdefaultprivate.php:1 3527 #: wpdefaultprivate.php:160 28 28 msgid "wpDefaultPrivate Settings" 29 29 msgstr "" 30 30 31 #: wpdefaultprivate.php:1 4131 #: wpdefaultprivate.php:166 32 32 msgid "Private Posts visible for all users" 33 33 msgstr "" 34 34 35 #: wpdefaultprivate.php:150 35 #: wpdefaultprivate.php:174 36 msgid "Private Pages visible for all users" 37 msgstr "" 38 39 #: wpdefaultprivate.php:183 36 40 msgid "Save Changes" 37 41 msgstr "" -
wpdefaultprivate/trunk/readme.txt
r2285467 r2330525 3 3 Requires at least: 4.0 4 4 Tested up to: 5.4 5 Stable tag: 1. 1.35 Stable tag: 1.2.0 6 6 Tags: private 7 7 License: GPLv2 or later … … 17 17 When the status of a post changes to published it is instead changed to private. After the initial "publish" you can change the post-status to public if you would like some posts to be public. 18 18 19 by default private posts and pages are not visible for all users, this plugin has settings to make private pages visible for all logged-in users 20 19 21 bugs and feature-requests can go to: [GitHub](https://github.com/koter84/wpDefaultPrivate/issues) or [WordPress](https://wordpress.org/support/plugin/wpdefaultprivate) 20 22 21 23 == Changelog == 24 25 = 1.2.0 = 26 * added option to make private pages visible to all users 22 27 23 28 = 1.1.3 = -
wpdefaultprivate/trunk/wpdefaultprivate.php
r2285467 r2330525 2 2 /** 3 3 * @package wpDefaultPrivate 4 * @version 1. 1.34 * @version 1.2.0 5 5 */ 6 6 /* … … 9 9 Description: This plugin makes all posts default to private instead of public 10 10 Author: Dennis Koot 11 Version: 1. 1.311 Version: 1.2.0 12 12 Author URI: http://denniskoot.nl/ 13 13 Text Domain: wpDefaultPrivate … … 70 70 function wpdefaultprivate_install() 71 71 { 72 // set default option-values73 update_option('wpdefaultprivate_allusers', 1);74 // set capabilities to default value75 72 global $wp_roles; 73 74 // set default for posts 75 update_option('wpdefaultprivate_allusers_posts', 1); 76 76 $wp_roles->add_cap('author', 'read_private_posts'); 77 77 $wp_roles->add_cap('contributor', 'read_private_posts'); 78 78 $wp_roles->add_cap('subscriber', 'read_private_posts'); 79 80 // set default for pages 81 update_option('wpdefaultprivate_allusers_pages', 1); 82 $wp_roles->add_cap('author', 'read_private_pages'); 83 $wp_roles->add_cap('contributor', 'read_private_pages'); 84 $wp_roles->add_cap('subscriber', 'read_private_pages'); 79 85 } 80 86 … … 97 103 98 104 // See if the user has posted us some information 99 $key = 'wpdefaultprivate_allusers';100 105 $hidden_field_name = 'wpdefaultprivate_hidden'; 101 106 if( isset($_POST[ $hidden_field_name ]) && $_POST[ $hidden_field_name ] == 'Y' ) … … 103 108 global $wp_roles; 104 109 110 $key = 'wpdefaultprivate_allusers_posts'; 105 111 if(isset($_POST[$key])) 106 112 { … … 119 125 $wp_roles->remove_cap('subscriber', 'read_private_posts'); 120 126 } 127 128 $key = 'wpdefaultprivate_allusers_pages'; 129 if(isset($_POST[$key])) 130 { 131 update_option( $key, $_POST[$key] ); 132 // add capability to read private pages 133 $wp_roles->add_cap('author', 'read_private_pages'); 134 $wp_roles->add_cap('contributor', 'read_private_pages'); 135 $wp_roles->add_cap('subscriber', 'read_private_pages'); 136 } 137 else 138 { 139 update_option( $key, 0 ); 140 // remove capability to read private pages 141 $wp_roles->remove_cap('author', 'read_private_pages'); 142 $wp_roles->remove_cap('contributor', 'read_private_pages'); 143 $wp_roles->remove_cap('subscriber', 'read_private_pages'); 144 } 145 121 146 // Put an settings updated message on the screen 122 147 echo "<div class=\"updated\"><p><strong>".__('Settings Saved', 'wpdefaultprivate')."</strong></p></div>"; … … 139 164 140 165 <tr valign="top"> 141 <th scope="row"><label for="wpdefaultprivate_allusers "><?php echo __('Private Posts visible for all users', wpdefaultprivate); ?></label></th>166 <th scope="row"><label for="wpdefaultprivate_allusers_posts"><?php echo __('Private Posts visible for all users', wpdefaultprivate); ?></label></th> 142 167 <td> 143 <input type="checkbox" name="wpdefaultprivate_allusers" value="1" <?php echo $sel; ?>/> 168 <input type="checkbox" name="wpdefaultprivate_allusers_posts" value="1" <?php echo $sel; ?>/> 169 <p class="description"><?php echo __('', wpdefaultprivate); ?></p> 170 </td> 171 </tr> 172 173 <tr valign="top"> 174 <th scope="row"><label for="wpdefaultprivate_allusers_pages"><?php echo __('Private Pages visible for all users', wpdefaultprivate); ?></label></th> 175 <td> 176 <input type="checkbox" name="wpdefaultprivate_allusers_pages" value="1" <?php echo $sel; ?>/> 144 177 <p class="description"><?php echo __('', wpdefaultprivate); ?></p> 145 178 </td>
Note: See TracChangeset
for help on using the changeset viewer.