Plugin Directory

Changeset 1731851


Ignore:
Timestamp:
09/18/2017 07:14:09 PM (9 years ago)
Author:
travislopes
Message:

Share Drafts Publicly (1.1.5)

  • Added security enhancements.
Location:
share-drafts-publicly
Files:
7 added
2 edited

Legend:

Unmodified
Added
Removed
  • share-drafts-publicly/trunk/readme.txt

    r1726463 r1731851  
    2626
    2727== Changelog ==
     28= v1.1.5 =
     29* Added security enhancements.
    2830= v1.1.4 =
    2931* Added security enhancements.
  • share-drafts-publicly/trunk/share-drafts-publicly.php

    r1726463 r1731851  
    33Plugin Name: Share Drafts Publicy
    44Description: Provide a secret link to non-logged in users to view post drafts.
    5 Version: 1.1.4
     5Version: 1.1.5
    66Author: Travis Lopes
    77Author URI: http://travislop.es
     
    352352    public function make_draft_private( $post_id = 0 ) {
    353353
     354        // If user does not have capability to edit posts, return.
     355        if ( ! current_user_can( 'edit_post', $post_id ) ) {
     356            return false;
     357        }
     358
    354359        // Delete post meta.
    355360        return delete_post_meta( $post_id, '_draft_secret_key' );
     
    371376    public function make_draft_public( $post_id = 0 ) {
    372377
     378        // If user does not have capability to edit posts, return.
     379        if ( ! current_user_can( 'edit_post', $post_id ) ) {
     380            return false;
     381        }
     382
    373383        // Generate secret key.
    374384        $secret_key = wp_generate_password( 6, false, false );
Note: See TracChangeset for help on using the changeset viewer.