Plugin Directory

Changeset 1581815


Ignore:
Timestamp:
01/25/2017 11:11:10 AM (9 years ago)
Author:
modeewine
Message:

New version 3.3.2:

  • Added compatibility with Polylang 2.1.
Location:
polylang-theme-strings
Files:
10 added
2 edited

Legend:

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

    r1580873 r1581815  
    55    Plugin URI: http://modeewine.com/en-polylang-theme-strings
    66    Description: Automatic scanning of strings translation in the theme and registration of them in Polylang plugin. Extension for Polylang plugin.
    7     Version: 3.3.1
     7    Version: 3.3.2
    88    Author: Modeewine
    99    Author URI: http://modeewine.com
     
    1616    {
    1717        static $prefix = 'mw_polylang_strings_';
    18         static $plugin_version = '3.3.1';
     18        static $plugin_version = '3.3.2';
    1919        static $pll_f = 'pll_register_string';
    2020        private $paths;
     
    9292                if (!pll_default_language())
    9393                {
    94                     wp_redirect(admin_url('options-general.php?page=mlang'));
     94                    if (defined('POLYLANG_VERSION') && (float)POLYLANG_VERSION < 2.1)
     95                    {
     96                        wp_redirect(admin_url('options-general.php?page=mlang'));
     97                    }
     98                    else // for Polylang >= 2.1
     99                    {
     100                        wp_redirect(admin_url('admin.php?page=mlang'));
     101                    }
     102
    95103                    exit;
    96104                }
     
    118126                    {
    119127                        window.<?php echo self::$prefix; ?>admin.attr.prefix = '<?php echo self::$prefix; ?>';
    120                         window.<?php echo self::$prefix; ?>admin.attr.urls['polylang_strings'] = '<?php echo admin_url('options-general.php?page=mlang&tab=strings'); ?>';
    121                         window.<?php echo self::$prefix; ?>admin.attr.urls['polylang_strings_theme_current'] = '<?php echo admin_url('options-general.php?page=mlang&tab=strings&s&group=' . __('Theme') . ': ' . wp_get_theme()->Name . '&paged=1'); ?>';
     128
     129                        <?php
     130
     131                            if (defined('POLYLANG_VERSION') && (float)POLYLANG_VERSION < 2.1)
     132                            {
     133                                ?>
     134                                window.<?php echo self::$prefix; ?>admin.attr.urls['polylang_strings'] = '<?php echo admin_url('options-general.php?page=mlang&tab=strings'); ?>';
     135                                window.<?php echo self::$prefix; ?>admin.attr.urls['polylang_strings_theme_current'] = '<?php echo admin_url('options-general.php?page=mlang&tab=strings&s&group=' . __('Theme') . ': ' . wp_get_theme()->Name . '&paged=1'); ?>';
     136                                <?php
     137                            }
     138                            else // for Polylang >= 2.1
     139                            {
     140                                ?>
     141                                window.<?php echo self::$prefix; ?>admin.attr.urls['polylang_strings'] = '<?php echo admin_url('admin.php?page=mlang_strings'); ?>';
     142                                window.<?php echo self::$prefix; ?>admin.attr.urls['polylang_strings_theme_current'] = '<?php echo admin_url('admin.php?page=mlang_strings&s&group=' . __('Theme') . ': ' . wp_get_theme()->Name . '&paged=1'); ?>';
     143                                <?php
     144                            }
     145
     146                        ?>
    122147
    123148                        window.<?php echo self::$prefix; ?>admin.lng[10] = '<?php _e('Polylang Theme Strings'); ?>';
     
    145170                    if (typeof(window.<?php echo self::$prefix; ?>admin) == 'object')
    146171                    {
    147                         window.<?php echo self::$prefix; ?>admin.attr.urls['polylang_strings'] = '<?php echo admin_url('options-general.php?page=mlang&tab=strings'); ?>';
     172                        window.<?php echo self::$prefix; ?>admin.attr.urls['polylang_strings'] = '<?php
     173
     174                            if (defined('POLYLANG_VERSION') && (float)POLYLANG_VERSION < 2.1)
     175                            {
     176                                echo admin_url('options-general.php?page=mlang&tab=strings');
     177                            }
     178                            else // for Polylang >= 2.1
     179                            {
     180                                echo admin_url('admin.php?page=mlang_strings');
     181                            }
     182
     183                        ?>';
    148184
    149185                        window.<?php echo self::$prefix; ?>admin.lng[70] = '<?php _e('Go to polylang-strings settings page'); ?>';
     
    199235                is_admin() &&
    200236                function_exists(self::$pll_f) &&
    201                 (isset($_REQUEST['page']) && $_REQUEST['page'] == 'mlang') &&
    202                 (isset($_REQUEST['tab']) && $_REQUEST['tab'] == 'strings')
     237                isset($_REQUEST['page']) &&
     238                (
     239                    ($_REQUEST['page'] == 'mlang' && isset($_REQUEST['tab']) && $_REQUEST['tab'] == 'strings') ||
     240                    $_REQUEST['page'] == 'mlang_strings' // for Polylang >= 2.1
     241                )
    203242            )
    204243            {
  • polylang-theme-strings/trunk/readme.txt

    r1580873 r1581815  
    55Requires at least: 3.8
    66Tested up to: 4.7
    7 Stable tag: 3.3.1
     7Stable tag: 3.3.2
    88License: GPL2
    99
     
    4545
    4646== Changelog ==
     47
     48= 3.3.2 (2017-01-25) =
     49
     50* Added compatibility with Polylang 2.1 (Thanks to Mike Ambukadze for the report).
    4751
    4852= 3.3.1 (2017-01-24) =
Note: See TracChangeset for help on using the changeset viewer.