Plugin Directory

Changeset 3478131


Ignore:
Timestamp:
03/09/2026 12:56:02 PM (3 weeks ago)
Author:
lwsdevelopers
Message:

Feature - WooCommerce — My Account pages supports Elementor edition again. Feature - Extends points display options

Location:
woorewards/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • woorewards/trunk/assets/lws-adminpanel/include/pages/endpoint.php

    r3463447 r3478131  
    349349        $postId = \get_option($this->options['prefix'] . '_page');
    350350        if ($postId) {
    351             $content = \get_the_content(null, false, $postId);
    352             $this->muteElementor();
    353             $content = \apply_filters('the_content', $content);
    354             $this->restoreElementor();
    355             $content = \str_replace(']]>', ']]>', $content);
     351            $content = $this->getElementorContent($postId);
     352            if (!$content) {
     353                $content = $this->getWordPressContent($postId);
     354            }
    356355            echo $content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    357356        }
     357    }
     358
     359    private function getElementorContent($postId)
     360    {
     361        if ( !(did_action('elementor/loaded') && \class_exists('\Elementor\Plugin'))) {
     362            return false;
     363        }
     364        $elementor = \Elementor\Plugin::instance();
     365        // disable edition for frontend
     366        $elementor->editor->set_edit_mode(false);
     367        return $elementor->frontend->get_builder_content_for_display($postId, true);
     368    }
     369
     370    private function getWordPressContent($postId)
     371    {
     372        $content = \get_the_content(null, false, $postId);
     373        $this->muteElementor();
     374        $content = \apply_filters('the_content', $content);
     375        $this->restoreElementor();
     376        return \str_replace(']]>', ']]>', $content);
    358377    }
    359378
  • woorewards/trunk/assets/lws-adminpanel/lws-adminpanel.php

    r3469270 r3478131  
    66 * Author: Long Watch Studio
    77 * Author URI: https://longwatchstudio.com
    8  * Version: 5.7.2
     8 * Version: 5.7.3
    99 * Text Domain: lws-adminpanel
    1010 *
     
    5656
    5757add_filter('lws_adminpanel_versions', function($versions){
    58     $versions['5.7.2'] = __FILE__;
     58    $versions['5.7.3'] = __FILE__;
    5959    return $versions;
    6060});
  • woorewards/trunk/include/ui/woocommerce/pointsoncart.php

    r3463447 r3478131  
    818818        $details = array();
    819819
    820         if (\trim($poolInfo['direct_reward_point_rate']) != '') {
    821             $details['rate'] = sprintf(
    822                 "<div class='lwss_selectable wr-rateinfo' data-type='Point Rate'>%s</div>",
    823                 sprintf(
     820        $ratio_rate = \trim($poolInfo['direct_reward_point_rate']);
     821        if ($ratio_rate != '') {
     822            $pts_rate = (float)$info['pool']->formatPointsNumber(1, true);
     823            if ($pts_rate !== (float)$ratio_rate) {
     824                $details['rate'] = sprintf(
     825                    "<div class='lwss_selectable wr-rateinfo' data-type='Point Rate'>%s</div>",
     826                    sprintf(
    824827                    /* translators: %1$s: points amount, %2$s: currency price */
    825                     __('Every %1$s you use is worth %2$s', 'woorewards-lite'),
    826                     $info['pool']->formatPoints(1, true),
    827                     \LWS\Adminpanel\Tools\Conveniences::getCurrencyPrice($poolInfo['direct_reward_point_rate'], \apply_filters('lws_woorewards_point_rate_displays_real_decimals', false), true)
    828                 )
    829             );
     828                        __( 'Every %1$s you use is worth %2$s', 'woorewards-lite' ),
     829                        $info['pool']->formatPoints( 1, true ),
     830                        \LWS\Adminpanel\Tools\Conveniences::getCurrencyPrice( $ratio_rate, \apply_filters( 'lws_woorewards_point_rate_displays_real_decimals', false ), true )
     831                    )
     832                );
     833            }
    830834        }
    831835
  • woorewards/trunk/readme.txt

    r3469270 r3478131  
    55Tested up to: 6.9
    66Requires PHP: 7.3.0
    7 Stable tag: 5.7.2
     7Stable tag: 5.7.3
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    110110== Changelog ==
    111111
     112= 5.7.3 =
     113* MyRewards Pro :
     114    * Feature - WooCommerce — My Account pages supports Elementor edition again
     115    * Feature - Extends points display options
     116
    112117= 5.7.2 =
    113118* Feature - Reward description accept html
  • woorewards/trunk/woorewards.php

    r3469270 r3478131  
    77 * Author: Long Watch Studio
    88 * Author URI: https://longwatchstudio.com
    9  * Version: 5.7.2
     9 * Version: 5.7.3
    1010 * License: GPLv2 or later
    1111 * Text Domain: woorewards-lite
     
    110110    private function defineConstants()
    111111    {
    112         define('LWS_WOOREWARDS_VERSION', '5.7.2');
     112        define('LWS_WOOREWARDS_VERSION', '5.7.3');
    113113        define('LWS_WOOREWARDS_FILE', __FILE__);
    114114        define('LWS_WOOREWARDS_DOMAIN', 'woorewards-lite');
     
    148148    public function addPluginVersion($url)
    149149    {
    150         return '5.7.2';
     150        return '5.7.3';
    151151    }
    152152
Note: See TracChangeset for help on using the changeset viewer.