Skip to content

Commit

Permalink
Merge pull request #10 from mariadanieldeepak/master
Browse files Browse the repository at this point in the history
Fix PHP notice in Add New post/page screen. Fix #9
  • Loading branch information
sudar committed Apr 5, 2016
2 parents 68a4d91 + 7322123 commit 84b826a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,5 @@ Fix issue in utm_medium parameter
### v3.0.4 ###
Fixed issue custom retweet text.

### v3.0.5 ###
Fixed issue #9 - PHP notice in Add New post/page screen
4 changes: 2 additions & 2 deletions easy-retweet.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,11 @@ function save_postdata( $post_id ) {
// verify this came from the our screen and with proper authorization,
// because save_post can be triggered at other times

if ( ! wp_verify_nonce( $_POST['retweet_noncename'], plugin_basename( __FILE__ ) ) ) {
if ( ! isset( $_POST['retweet_noncename'] ) || ! wp_verify_nonce( $_POST['retweet_noncename'], plugin_basename( __FILE__ ) ) ) {
return $post_id;
}

if ( 'page' == $_POST['post_type'] ) {
if ( isset( $_POST['post_type'] ) && 'page' == $_POST['post_type'] ) {
if ( ! current_user_can( 'edit_page', $post_id ) ) {
return $post_id;
}
Expand Down

0 comments on commit 84b826a

Please sign in to comment.