Changeset 767481
- Timestamp:
- 09/05/2013 05:38:12 PM (13 years ago)
- Location:
- simple-language-switcher/trunk
- Files:
-
- 3 edited
-
admin/options-page.php (modified) (4 diffs)
-
readme.txt (modified) (1 diff)
-
simple-language-switcher.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
simple-language-switcher/trunk/admin/options-page.php
r721115 r767481 5 5 die; 6 6 } 7 /* 7 8 if ( !current_user_can( 'manage_options' ) ) { 8 9 wp_die( __( 'You do not have sufficient permissions to access this page.' ) ); 9 10 } 11 */ 10 12 11 13 class SimpleLanguageSwitcher_OptionsPage { … … 22 24 23 25 function init_options() { 24 $this->write_file_langs( array() ); 25 $options = update_option( 'sls_plugin_langs', array() ); 26 27 $this->write_file_links( array() ); 28 $options = update_option( 'sls_plugin_linking', array() ); 26 $arr_langs = $this->get_array_langs(); 27 if( empty( $arr_langs ) ) { 28 $this->write_file_langs( array() ); 29 $options = update_option( 'sls_plugin_langs', array() ); 30 } 31 else { 32 $arr_langs = get_option( 'sls_plugin_langs_backup' ); 33 if( !empty( $arr_langs ) ) $this->write_file_langs( $arr_langs ); 34 } 35 36 $arr_links = $this->get_array_links(); 37 if( empty( $arr_links ) ) { 38 $this->write_file_links( array() ); 39 $options = update_option( 'sls_plugin_linking', array() ); 40 } 41 else { 42 $arr_links = get_option( 'sls_plugin_linking_backup' ); 43 if( !empty( $arr_links ) ) $this->write_file_links( $arr_links ); 44 } 29 45 30 46 $options = get_option( 'sls_plugin_options' ); … … 420 436 function write_file_langs($arr_langs) { 421 437 $this->write_file( $arr_langs, SLS_PATH . 'my-langs.php', 'write_file_langs_data' ); 438 update_option( 'sls_plugin_langs_backup', $arr_langs ); 422 439 } 423 440 … … 436 453 function write_file_links($arr_links) { 437 454 $this->write_file( $arr_links, SLS_PATH . 'links.php', 'write_file_links_data' ); 455 update_option( 'sls_plugin_linking_backup', $arr_links ); 438 456 } 439 457 -
simple-language-switcher/trunk/readme.txt
r721122 r767481 41 41 == Changelog == 42 42 43 44 = 1.1 = 45 * Bugfix 46 43 47 = 1.0 = 44 48 * init -
simple-language-switcher/trunk/simple-language-switcher.php
r721115 r767481 2 2 /* 3 3 Plugin Name: Simple Language Switcher 4 Version: 1. 04 Version: 1.1 5 5 Plugin URI: http://www.mendoweb.be/blog/wordpress-plugin-simple-language-switcher/ 6 6 Description: A simple and lightweight language switcher.
Note: See TracChangeset
for help on using the changeset viewer.