Plugin Directory

Changeset 2431935


Ignore:
Timestamp:
12/05/2020 12:24:32 AM (5 years ago)
Author:
remixdvoice
Message:

fixed plugin activation PHP notices

Location:
remixd-voice
Files:
101 added
3 edited

Legend:

Unmodified
Added
Removed
  • remixd-voice/trunk/README.txt

    r2431207 r2431935  
    66Tested up to: 5.6
    77Requires PHP: 5.6
    8 Stable tag: 1.0.3
     8Stable tag: 1.0.4
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    5656== Changelog ==
    5757
     58= 1.0.4 =
     59* Fixed plugin activation PHP notices
     60
    5861= 1.0.3 =
    5962* Fixed PHP Notices
  • remixd-voice/trunk/lib/remixd-player.php

    r2431207 r2431935  
    8888    public function add_remixd_meta_box()
    8989    {
    90         if ($this->options['display'] == 2) {
    91             add_meta_box(
    92                 'remixd_meta_box',
    93                 'Remixd Voice',
    94                 array($this, 'show_remixd_fields_meta_box'),
    95                 'post',
    96                 'side',
    97                 'high'
    98             );
     90        if(!empty($this->options)) {
     91            if ($this->options['display'] == 2) {
     92                add_meta_box(
     93                    'remixd_meta_box',
     94                    'Remixd Voice',
     95                    array($this, 'show_remixd_fields_meta_box'),
     96                    'post',
     97                    'side',
     98                    'high'
     99                );
     100            }
    99101        }
    100102    }
     
    127129    {
    128130        // verify nonce
    129         if (!wp_verify_nonce($_POST['remixd_meta_box_nonce'], basename(__FILE__))) {
    130             return $post_id;
    131         }
    132         // check autosave
    133         if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
    134             return $post_id;
    135         }
    136         // check permissions
    137         if ('page' === $_POST['post_type']) {
    138             if (!current_user_can('edit_page', $post_id)) {
    139                 return $post_id;
    140             } elseif (!current_user_can('edit_post', $post_id)) {
     131        if(isset($_POST['remixd_meta_box_nonce'])) {
     132            if (!wp_verify_nonce($_POST['remixd_meta_box_nonce'], basename(__FILE__))) {
    141133                return $post_id;
    142134            }
    143         }
    144         // handle save/update
    145        
    146         $remixd_meta_data = sanitize_text_field( $_POST['remixd_voice'] );
    147        
    148         if ( $remixd_meta_data == 'on') {
    149             update_post_meta($post_id, 'remixd_voice', $remixd_meta_data);
    150         } else {
    151             delete_post_meta($post_id, 'remixd_voice');
     135            // check autosave
     136            if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
     137                return $post_id;
     138            }
     139            // check permissions
     140            if ('page' === $_POST['post_type']) {
     141                if (!current_user_can('edit_page', $post_id)) {
     142                    return $post_id;
     143                } elseif (!current_user_can('edit_post', $post_id)) {
     144                    return $post_id;
     145                }
     146            }
     147            // handle save/update
     148           
     149            $remixd_meta_data = sanitize_text_field( $_POST['remixd_voice'] );
     150           
     151            if ( $remixd_meta_data == 'on') {
     152                update_post_meta($post_id, 'remixd_voice', $remixd_meta_data);
     153            } else {
     154                delete_post_meta($post_id, 'remixd_voice');
     155            }
    152156        }
    153157    }
  • remixd-voice/trunk/remixd.php

    r2431207 r2431935  
    44 * Plugin URI: https://www.remixd.com/
    55 * Description: Remixd’s Audicles™ utilize publisher text and converts it into playable audio for easy and convenient on page consumption.
    6  * Version: 1.0.3
     6 * Version: 1.0.4
    77 * Author: Remixd Voice
    88 **/
Note: See TracChangeset for help on using the changeset viewer.