Plugin Directory

Changeset 1179709


Ignore:
Timestamp:
06/12/2015 03:31:39 PM (11 years ago)
Author:
modeewine
Message:

New version (1.1)

  • Fixed bug when removing the plugin from the admin panel.
  • Improved code.
Location:
polylang-theme-strings/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • polylang-theme-strings/trunk/mw-polylang-theme-strings.php

    r1169899 r1179709  
    1515    class MW_Polylang_Theme_Strings
    1616    {
    17         private $prefix = 'mw_polylang_strings_';
    18         private $pll_f = 'pll_register_string';
     17        static $prefix = 'mw_polylang_strings_';
     18        static $pll_f = 'pll_register_string';
    1919        private $paths;
    2020        private $db;
     
    3838        public function Uninstall()
    3939        {
    40             $this->db->query("DELETE FROM `{$this->db->prefix}options` WHERE `option_name` LIKE '{$this->prefix}%'");
     40            global $wpdb;
     41
     42            $wpdb->query("DELETE FROM `" . $wpdb->prefix . "options` WHERE `option_name` LIKE '" . self::$prefix . "%'");
    4143        }
    4244
     
    8587            (
    8688                is_admin() &&
    87                 function_exists($this->pll_f) &&
    88                 $_REQUEST['page'] == 'mlang' &&
    89                 $_REQUEST['tab'] == 'strings'
     89                function_exists(self::$pll_f) &&
     90                (isset($_REQUEST['page']) && $_REQUEST['page'] == 'mlang') &&
     91                (isset($_REQUEST['tab']) && $_REQUEST['tab'] == 'strings')
    9092            )
    9193            {
     
    112114                }
    113115
    114                 update_option($this->prefix . $this->Path_Get('theme_dir_name') . '_data', $data);
     116                update_option(self::$prefix . $this->Path_Get('theme_dir_name') . '_data', $data);
    115117            }
    116118        }
     
    118120        public function PLL_Strings_Init()
    119121        {
    120             if (function_exists($this->pll_f))
     122            if (function_exists(self::$pll_f))
    121123            {
    122                 $data = get_option($this->prefix . $this->Path_Get('theme_dir_name') . '_data');
     124                $data = get_option(self::$prefix . $this->Path_Get('theme_dir_name') . '_data');
    123125
    124126                if (is_array($data) && count($data))
  • polylang-theme-strings/trunk/readme.txt

    r1170843 r1179709  
    55Requires at least: 3.8
    66Tested up to: 4.2
    7 Stable tag: 1.0
     7Stable tag: 1.1
    88License: GPLv2
    99
     
    4747== Changelog ==
    4848
     49= 1.1 (2015-06-12) =
     50
     51* Fixed bug when removing the plugin from the admin panel.
     52* Improved code.
     53
    4954= 1.0 (2015-05-29) =
    5055
Note: See TracChangeset for help on using the changeset viewer.