Plugin Directory

Changeset 3419653


Ignore:
Timestamp:
12/15/2025 03:18:57 AM (3 months ago)
Author:
wcboost
Message:

Update code of version 1.2.3

Location:
wcboost-wishlist/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • wcboost-wishlist/trunk/includes/admin/settings.php

    r3370850 r3419653  
    2727
    2828        // Add settings of endpoints to the Advanced tab.
    29         add_filter( 'woocommerce_settings_pages', [ $this, 'get_endpoint_settings' ] );
     29        add_filter( 'woocommerce_get_settings_advanced', [ $this, 'get_endpoint_settings' ] );
    3030
    3131        parent::__construct();
     
    419419        ];
    420420
     421        $endpoint_settings = apply_filters( 'wcboost_wishlist_endpoint_settings', $endpoint_settings );
     422
    421423        return array_merge( $settings, $endpoint_settings );
    422424    }
  • wcboost-wishlist/trunk/includes/frontend.php

    r3370850 r3419653  
    8888        // Display buttons in the wishlist widget.
    8989        add_action( 'wcboost_wishlist_widget_buttons', [ $this, 'widget_buttons' ], 10, 2 );
     90
     91        // Change the page title and heading for the wishlist endpoints.
     92        add_filter( 'document_title_parts', [ $this, 'wishlist_endpoints_page_title' ] );
     93        add_filter( 'the_title', [ $this, 'wishlist_endpoints_page_heading' ] );
    9094    }
    9195
     
    553557        Session::instance()->maybe_set_cookies();
    554558    }
     559
     560    /**
     561     * Filter the page title for wishlist endpoints
     562     *
     563     * Changes the page title when viewing manage-wishlists or add-wishlist endpoints.
     564     * Similar to how WooCommerce handles My Account page endpoints.
     565     *
     566     * @since 1.2.3
     567     *
     568     * @param array $title_parts The document title parts.
     569     * @return array Modified title parts.
     570     */
     571    public function wishlist_endpoints_page_title( $title_parts ) {
     572        if ( ! Helper::is_wishlist() ) {
     573            return $title_parts;
     574        }
     575
     576        if ( get_query_var( 'edit-wishlist' ) ) {
     577            $title_parts['title'] = __( 'Edit Wishlist', 'wcboost-wishlist' );
     578        }
     579
     580        return $title_parts;
     581    }
     582
     583    /**
     584     * Filter the page heading for wishlist endpoints
     585     *
     586     * @since 1.2.3
     587     *
     588     * @param string $title The page title.
     589     * @return string Modified page title.
     590     */
     591    public function wishlist_endpoints_page_heading( $title ) {
     592        if ( ! in_the_loop() || ! is_main_query() || ! Helper::is_wishlist() ) {
     593            return $title;
     594        }
     595
     596        if ( get_query_var( 'edit-wishlist' ) ) {
     597            $title = esc_html__( 'Edit wishlist', 'wcboost-wishlist' );
     598        }
     599
     600        return $title;
     601    }
    555602}
  • wcboost-wishlist/trunk/includes/query.php

    r3370850 r3419653  
    250250     * Get all wishlits of current user
    251251     *
    252      * @return array
     252     * @return \WCBoost\Wishlist\Wishlist[] Array of wishlists
    253253     */
    254254    public function get_user_wishlists() {
  • wcboost-wishlist/trunk/includes/templates.php

    r3370850 r3419653  
    195195        }
    196196
    197         $args = apply_filters( 'wcboost_wishlist_button_template_args', $args, $wishlist, $product );
    198         $args['class'] = implode( ' ', (array) $args['class'] );
    199 
    200197        // Add a new key "attributes",
    201198        // but must keep orginal keys to ensure backwards compatibility.
     
    210207            $args['attributes']['data-variations'] = wp_json_encode( $args['variations_data'] );
    211208        }
     209
     210        $args = apply_filters( 'wcboost_wishlist_button_template_args', $args, $wishlist, $product );
     211        $args['class'] = implode( ' ', (array) $args['class'] );
    212212
    213213        return $args;
  • wcboost-wishlist/trunk/includes/wishlist.php

    r3370850 r3419653  
    807807     * Also set the session id for guests.
    808808     *
    809      * @return void
     809     * @return int
    810810     */
    811811    public function save() {
     
    817817            Session::set_session_id( $this->get_session_id() );
    818818        }
     819
     820        return $this->get_id();
    819821    }
    820822
     
    10481050
    10491051            if ( $merged && ! is_wp_error( $merged ) ) {
    1050                 $merged_count++;
     1052                ++$merged_count;
    10511053            }
    10521054        }
  • wcboost-wishlist/trunk/languages/wcboost-wishlist.pot

    r3370850 r3419653  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: WCBoost - Wishlist 1.2.2\n"
     5"Project-Id-Version: WCBoost - Wishlist 1.2.3\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wcboost-wishlist\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2025-10-01T05:16:50+00:00\n"
     12"POT-Creation-Date: 2025-12-15T03:03:36+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
     
    175175#: includes/customizer/customizer.php:341
    176176#: includes/form-handler.php:111
    177 #: includes/frontend.php:521
     177#: includes/frontend.php:525
    178178#: includes/helper.php:208
    179179msgid "View wishlist"
     
    386386
    387387#: includes/admin/settings.php:408
    388 #: includes/frontend.php:338
     388#: includes/frontend.php:342
     389#: includes/frontend.php:597
    389390msgid "Edit wishlist"
    390391msgstr ""
     
    646647msgstr ""
    647648
    648 #: includes/frontend.php:151
     649#: includes/frontend.php:155
    649650msgid "The wishlist link is copied to clipboard"
    650651msgstr ""
    651652
    652 #: includes/frontend.php:152
     653#: includes/frontend.php:156
    653654msgid "Close"
    654655msgstr ""
    655656
    656 #: includes/frontend.php:316
     657#: includes/frontend.php:320
    657658msgid "Share"
    658659msgstr ""
    659660
    660 #: includes/frontend.php:369
     661#: includes/frontend.php:373
    661662#: templates/wishlist/form-delete-wishlist.php:31
    662663msgid "Delete wishlist"
    663664msgstr ""
    664665
    665 #: includes/frontend.php:370
     666#: includes/frontend.php:374
    666667msgid "Delete the wishlist and all items it contains"
    667668msgstr ""
    668669
    669 #: includes/frontend.php:391
     670#: includes/frontend.php:395
    670671msgid "Delete"
     672msgstr ""
     673
     674#: includes/frontend.php:577
     675msgid "Edit Wishlist"
    671676msgstr ""
    672677
     
    822827msgstr ""
    823828
    824 #: templates/wishlist/form-edit-wishlist.php:21
    825 msgid "Edit Wishlist"
    826 msgstr ""
    827 
    828 #: templates/wishlist/form-edit-wishlist.php:30
     829#: templates/wishlist/form-edit-wishlist.php:29
    829830msgid "Wishlist name"
    830831msgstr ""
    831832
    832 #: templates/wishlist/form-edit-wishlist.php:42
     833#: templates/wishlist/form-edit-wishlist.php:41
    833834msgid "Description"
    834835msgstr ""
    835836
    836 #: templates/wishlist/form-edit-wishlist.php:57
     837#: templates/wishlist/form-edit-wishlist.php:56
    837838msgid "Privacy settings"
    838839msgstr ""
    839840
     841#: templates/wishlist/form-edit-wishlist.php:58
     842msgid "Public - Anyone can view this list. Everyone can share this list."
     843msgstr ""
     844
    840845#: templates/wishlist/form-edit-wishlist.php:59
    841 msgid "Public - Anyone can view this list. Everyone can share this list."
     846msgid "Shared - Only people with the link can view this list. Only you can share this list."
    842847msgstr ""
    843848
    844849#: templates/wishlist/form-edit-wishlist.php:60
    845 msgid "Shared - Only people with the link can view this list. Only you can share this list."
    846 msgstr ""
    847 
    848 #: templates/wishlist/form-edit-wishlist.php:61
    849850msgid "Private - Only you can view this list."
    850851msgstr ""
    851852
     853#: templates/wishlist/form-edit-wishlist.php:70
     854msgid "Save changes"
     855msgstr ""
     856
    852857#: templates/wishlist/form-edit-wishlist.php:71
    853 msgid "Save changes"
    854 msgstr ""
    855 
    856 #: templates/wishlist/form-edit-wishlist.php:72
    857858msgid "Cancel"
    858859msgstr ""
  • wcboost-wishlist/trunk/readme.txt

    r3370850 r3419653  
    22Contributors: wcboost
    33Tags: woocommerce wishlist, wishlist, products, e-commerce, woocommerce
    4 Tested up to: 6.8
    5 Stable tag: 1.2.2
     4Tested up to: 6.9
     5Stable tag: 1.2.3
    66Requires PHP: 7.0
    77Requires at least: 4.5
    88WC requires at least: 3.0.0
    9 WC tested up to: 10.2
     9WC tested up to: 10.4
    1010License: GPLv3 or later
    1111License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    9494
    9595== Changelog ==
     96
     97= 1.2.3 =
     98- Enhancement - Update Wishlist edit template to allow title customization.
     99- Tweak - WordPress 6.9 compatibility.
     100- Tweak – WooCommerce 10.4 compatibility.
     101- Dev - Add filter to modify page title and heading for wishlist endpoints.
     102- Dev - Add filter for endpoint settings.
    96103
    97104= 1.2.2 =
  • wcboost-wishlist/trunk/templates/wishlist/form-edit-wishlist.php

    r3370850 r3419653  
    77 * @author  WCBoost
    88 * @package WCBoost\Wishlist\Templates
    9  * @version 1.2.2
     9 * @version 1.2.3
    1010 */
    1111
     
    1919
    2020<form class="wcboost-wishlist-form-edit" method="post">
    21     <h3><?php esc_html_e( 'Edit Wishlist', 'wcboost-wishlist' ); ?></h3>
    2221
    2322    <?php
  • wcboost-wishlist/trunk/wcboost-wishlist.php

    r3370850 r3419653  
    55 * Plugin URI: https://wcboost.com/plugin/woocommerce-wishlist/?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash
    66 * Author: WCBoost
    7  * Version: 1.2.2
     7 * Version: 1.2.3
    88 * Author URI: https://wcboost.com/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash
    99 *
     
    1313 * Requires PHP: 7.0
    1414 * Requires at least: 4.5
    15  * Tested up to: 6.8.3
     15 * Tested up to: 6.9
    1616 * WC requires at least: 3.0.0
    17  * WC tested up to: 10.2.2
     17 * WC tested up to: 10.4
    1818 * License: GPLv3 or later
    1919 *
     
    2626
    2727if ( ! defined( 'WCBOOST_WISHLIST_VERSION' ) ) {
    28     define( 'WCBOOST_WISHLIST_VERSION', '1.2.2' );
     28    define( 'WCBOOST_WISHLIST_VERSION', '1.2.3' );
    2929}
    3030
     
    4343
    4444// Declare compatibility with WooCommerce features.
    45 add_action( 'before_woocommerce_init', function() {
     45add_action( 'before_woocommerce_init', function () {
    4646    if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
    4747        \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
     
    103103    }
    104104
    105     register_activation_hook( __FILE__,  'wcboost_wishlist_activate' );
     105    register_activation_hook( __FILE__, 'wcboost_wishlist_activate' );
    106106}
Note: See TracChangeset for help on using the changeset viewer.