WordPress.org

Plugin Directory

Changeset 1699740 for event-post


Ignore:
Timestamp:
07/20/17 15:39:06 (5 weeks ago)
Author:
bastho
Message:

Cleanup deprecated setting stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • event-post/trunk/eventpost.php

    r1698286 r1699740  
    8383 
    8484    // Admin 
    85     add_action('admin_post_EventPostSaveSettings', array(&$this, 'save_settings'));// Settings link on the Plugins list 
    8685    add_filter('plugin_action_links_event-post/eventpost.php', array( &$this, 'settings_link' ) ); 
    8786        add_filter('plugin_row_meta', array( &$this, 'row_meta' ), 1, 4); 
     
    20802079        return $plugin_meta; 
    20812080    } 
    2082     /** 
    2083      * save settings end redirect 
    2084      * @return void 
    2085      */ 
    2086     public function save_settings(){ 
    2087     if (!current_user_can('manage_options')){ 
    2088         return; 
    2089     } 
    2090     if (!wp_verify_nonce(\filter_input(INPUT_POST,'ep_nonce_settings',FILTER_SANITIZE_STRING), 'ep_nonce_settings')) { 
    2091         wp_die(__('Security error', 'event-post')); 
    2092     } 
    2093  
    2094     $valid_post = array( 
    2095         'ep_settings'=>array( 
    2096         'filter' => FILTER_SANITIZE_STRING, 
    2097         'flags'  => FILTER_REQUIRE_ARRAY 
    2098         ) 
    2099     ); 
    2100  
    2101     foreach ($this->settings as $item_name=>$item_value){ 
    2102         $valid_post['ep_settings'][$item_name] = FILTER_SANITIZE_STRING; 
    2103     } 
    2104  
    2105         $post_types=(array) $_POST['ep_settings']['posttypes']; 
    2106         $posttypes = get_post_types(); 
    2107         foreach($post_types as $posttype){ 
    2108             if(!in_array($posttype, $posttypes)){ 
    2109                 unset($post_types[$posttype]); 
    2110             } 
    2111         } 
    2112  
    2113     if (false !== $settings = \filter_input_array(INPUT_POST,$valid_post)) { 
    2114         $settings['ep_settings']['container_shema']=stripslashes($_POST['ep_settings']['container_shema']); 
    2115         $settings['ep_settings']['item_shema']=  stripslashes($_POST['ep_settings']['item_shema']); 
    2116         $settings['ep_settings']['posttypes']=  array_values($post_types); 
    2117         update_option('ep_settings', $settings['ep_settings']); 
    2118     } 
    2119     wp_redirect('options-general.php?page=event-settings&confirm=options_saved'); 
    2120     exit; 
    2121     } 
     2081 
    21222082    /** 
    21232083     * adds menu items 
     
    24632423            <?php screen_icon(); ?> 
    24642424            <h2><?php _e('Event  settings', 'event-post'); ?></h2> 
    2465             <?php settings_errors(); ?> 
    24662425            <form action="options.php" method="post"> 
    24672426            <?php settings_fields( 'eventpost-settings' ); ?> 
Note: See TracChangeset for help on using the changeset viewer.