Plugin Directory

Changeset 681209


Ignore:
Timestamp:
03/13/2013 01:32:21 PM (13 years ago)
Author:
InoPlugs
Message:

Fixed some php warnings. Fixed capabilities warning.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-backgrounds-lite/trunk/inoplugs_background_plugin.php

    r659146 r681209  
    181181
    182182                // verify nonce
    183                 if (!wp_verify_nonce($_POST['ino_meta_box_nonce'], basename(__FILE__))) {
     183                if (isset($_POST['ino_meta_box_nonce']) && !wp_verify_nonce($_POST['ino_meta_box_nonce'], basename(__FILE__))) {
    184184                    return $post_id;
    185185                }
     
    191191
    192192                // check permissions
    193                 if ('page' == $_POST['post_type']) {
     193                if (isset($_POST['post_type']) && 'page' == $_POST['post_type']) {
    194194                    if (!current_user_can('edit_page', $post_id)) {
    195195                        return $post_id;
     
    201201                foreach ($ino_meta_box[0]['fields'] as $field) {
    202202                    $old = get_post_meta($post_id, $field['id'], true);
    203                     $new = $_POST[$field['id']];
     203                    if(isset($_POST[$field['id']])){
     204                        $new = $_POST[$field['id']];
     205                    }else{
     206                        $new = '';
     207                    }
    204208
    205209                    if ($new && $new != $old) {
     
    231235
    232236    function inowpblite_addAdminPage() {
    233         add_options_page(__('WP-Backgrounds Lite',INO_WPBLITE_TEXTDOMAIN), 'WP-Backgrounds Lite', 8, 'WP-Backgrounds', 'inowpblite_adminmenu');
     237        add_options_page(__('WP-Backgrounds Lite',INO_WPBLITE_TEXTDOMAIN), 'WP-Backgrounds Lite', 'manage_options', 'WP-Backgrounds', 'inowpblite_adminmenu');
    234238    }
    235239
Note: See TracChangeset for help on using the changeset viewer.