Plugin Directory

Changeset 2330525


Ignore:
Timestamp:
06/25/2020 09:36:03 AM (6 years ago)
Author:
koter84
Message:

auto-commit [] stable: 1.1.3 -> 1.2.0

Location:
wpdefaultprivate
Files:
7 added
5 edited

Legend:

Unmodified
Added
Removed
  • wpdefaultprivate/trunk/languages/wpdefaultprivate-nl_NL.po

    r2285467 r2330525  
    11msgid ""
    22msgstr ""
    3 "Project-Id-Version: wpDefaultPrivate 1.1.3\n"
     3"Project-Id-Version: wpDefaultPrivate 1.2.0\n"
    44"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wpDefaultPrivate\n"
    5 "POT-Creation-Date: 2019-04-22 00:00:00+00:00\n"
     5"POT-Creation-Date: 2020-06-25 00:00:00+00:00\n"
    66"PO-Revision-Date: \n"
    77"Last-Translator: \n"
     
    1717msgstr "Privé"
    1818
    19 #: wpdefaultprivate.php:95
     19#: wpdefaultprivate.php:101
    2020msgid "You do not have sufficient permissions to access this page."
    2121msgstr "Je hebt onvoldoende rechten voor het bekijken van deze pagina."
    2222
    23 #: wpdefaultprivate.php:122
     23#: wpdefaultprivate.php:147
    2424msgid "Settings Saved"
    2525msgstr "Instellingen Opgeslagen"
    2626
    27 #: wpdefaultprivate.php:135
     27#: wpdefaultprivate.php:160
    2828msgid "wpDefaultPrivate Settings"
    2929msgstr "wpDefaultPrivate Instellingen"
    3030
    31 #: wpdefaultprivate.php:141
     31#: wpdefaultprivate.php:166
    3232msgid "Private Posts visible for all users"
    3333msgstr "Privé Berichten zichtbaar voor alle gebruikers"
    3434
    35 #: wpdefaultprivate.php:150
     35#: wpdefaultprivate.php:174
     36msgid "Private Pages visible for all users"
     37msgstr "Privé Pagina's zichtbaar voor alle gebruikers"
     38
     39#: wpdefaultprivate.php:183
    3640msgid "Save Changes"
    3741msgstr "Wijzigingen Opslaan"
  • wpdefaultprivate/trunk/languages/wpdefaultprivate.pot

    r2285467 r2330525  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: wpDefaultPrivate 1.1.3\n"
     5"Project-Id-Version: wpDefaultPrivate 1.2.0\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wpDefaultPrivate\n"
    7 "POT-Creation-Date: 2020-04-17 00:00:00+00:00\n"
     7"POT-Creation-Date: 2020-06-25 00:00:00+00:00\n"
    88"MIME-Version: 1.0\n"
    99"Content-Type: text/plain; charset=UTF-8\n"
     
    1717msgstr ""
    1818
    19 #: wpdefaultprivate.php:95
     19#: wpdefaultprivate.php:101
    2020msgid "You do not have sufficient permissions to access this page."
    2121msgstr ""
    2222
    23 #: wpdefaultprivate.php:122
     23#: wpdefaultprivate.php:147
    2424msgid "Settings Saved"
    2525msgstr ""
    2626
    27 #: wpdefaultprivate.php:135
     27#: wpdefaultprivate.php:160
    2828msgid "wpDefaultPrivate Settings"
    2929msgstr ""
    3030
    31 #: wpdefaultprivate.php:141
     31#: wpdefaultprivate.php:166
    3232msgid "Private Posts visible for all users"
    3333msgstr ""
    3434
    35 #: wpdefaultprivate.php:150
     35#: wpdefaultprivate.php:174
     36msgid "Private Pages visible for all users"
     37msgstr ""
     38
     39#: wpdefaultprivate.php:183
    3640msgid "Save Changes"
    3741msgstr ""
  • wpdefaultprivate/trunk/readme.txt

    r2285467 r2330525  
    33Requires at least: 4.0
    44Tested up to: 5.4
    5 Stable tag: 1.1.3
     5Stable tag: 1.2.0
    66Tags: private
    77License: GPLv2 or later
     
    1717When 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.
    1818
     19by 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
    1921bugs and feature-requests can go to: [GitHub](https://github.com/koter84/wpDefaultPrivate/issues) or [WordPress](https://wordpress.org/support/plugin/wpdefaultprivate)
    2022
    2123== Changelog ==
     24
     25= 1.2.0 =
     26* added option to make private pages visible to all users
    2227
    2328= 1.1.3 =
  • wpdefaultprivate/trunk/wpdefaultprivate.php

    r2285467 r2330525  
    22/**
    33 * @package wpDefaultPrivate
    4  * @version 1.1.3
     4 * @version 1.2.0
    55 */
    66/*
     
    99Description: This plugin makes all posts default to private instead of public
    1010Author: Dennis Koot
    11 Version: 1.1.3
     11Version: 1.2.0
    1212Author URI: http://denniskoot.nl/
    1313Text Domain: wpDefaultPrivate
     
    7070function wpdefaultprivate_install()
    7171{
    72     // set default option-values
    73     update_option('wpdefaultprivate_allusers', 1);
    74     // set capabilities to default value
    7572    global $wp_roles;
     73
     74    // set default for posts
     75    update_option('wpdefaultprivate_allusers_posts', 1);
    7676    $wp_roles->add_cap('author', 'read_private_posts');
    7777    $wp_roles->add_cap('contributor', 'read_private_posts');
    7878    $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');
    7985}
    8086
     
    97103
    98104    // See if the user has posted us some information
    99     $key = 'wpdefaultprivate_allusers';
    100105    $hidden_field_name = 'wpdefaultprivate_hidden';
    101106    if( isset($_POST[ $hidden_field_name ]) && $_POST[ $hidden_field_name ] == 'Y' )
     
    103108        global $wp_roles;
    104109
     110        $key = 'wpdefaultprivate_allusers_posts';
    105111        if(isset($_POST[$key]))
    106112        {
     
    119125            $wp_roles->remove_cap('subscriber', 'read_private_posts');
    120126        }
     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
    121146        // Put an settings updated message on the screen
    122147        echo "<div class=\"updated\"><p><strong>".__('Settings Saved', 'wpdefaultprivate')."</strong></p></div>";
     
    139164
    140165        <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>
    142167            <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; ?>/>
    144177                <p class="description"><?php echo __('', wpdefaultprivate); ?></p>
    145178            </td>
Note: See TracChangeset for help on using the changeset viewer.