Plugin Directory

Changeset 3439521


Ignore:
Timestamp:
01/14/2026 12:31:11 PM (2 months ago)
Author:
bestwebsoft
Message:

"V1.5.2 - * The compatibility with new WordPress version updated. "

Location:
multilanguage
Files:
350 added
3 edited

Legend:

Unmodified
Added
Removed
  • multilanguage/trunk/includes/class-mltlngg-settings.php

    r3356543 r3439521  
    103103                $this->options['translate_open_graph']     = isset( $_POST['mltlngg_translate_open_graph'] ) ? 1 : 0;
    104104                $this->options['display_alternative_link'] = isset( $_POST['mltlngg_display_alternative_link'] ) ? 1 : 0;
     105                $this->options['translate_menu']           = isset( $_POST['mltlngg_translate_menu'] ) ? 1 : 0;
    105106                $this->options['save_mode']                = isset( $_POST['mltlngg_save_mode'] ) && 'ajax' === sanitize_text_field( wp_unslash( $_POST['mltlngg_save_mode'] ) ) ? 'ajax' : 'manual';
    106107                $this->options['search']                   = isset( $_POST['mltlngg_search'] ) && in_array( sanitize_text_field( wp_unslash( $_POST['mltlngg_search'] ) ), array( 'single', 'all' ), true ) ? sanitize_text_field( wp_unslash( $_POST['mltlngg_search'] ) ) : 'single';
     
    181182                                            printf(
    182183                                                '&ensp;<code>%s</code>',
    183                                                 esc_url( preg_replace( '~(://)~', '$0<b>en.</b>', $url ) )
     184                                                preg_replace( '~(://)~', '$0<b>en.</b>', $url )
    184185                                            );
    185186                                            ?>
     
    197198                                            printf(
    198199                                                '&ensp;<code>%s</code>',
    199                                                 esc_url( preg_replace( '~(?<=[/=])(' . $mltlngg_current_language . ')(?![\w\d-])~', '<b>en</b>', mltlngg_get_lang_link( $args ) ) )
     200                                                preg_replace( '~(?<=[/=])(' . $mltlngg_current_language . ')(?![\w\d-])~', '<b>en</b>', mltlngg_get_lang_link( $args ) )
    200201                                            );
    201202                                            ?>
     
    250251                    <td>
    251252                        <input type="checkbox" name="mltlngg_display_alternative_link" value="1" <?php checked( 1, $this->options['display_alternative_link'] ); ?> /> <span class="bws_info"><?php printf( esc_html__( 'Enable to add hreflang attribute used by search engines and display the correct language or regional URL in search results. This option inserts automatically the respective link for each language within the %s section.', 'multilanguage' ), '&lt;head&gt;' ); ?></span>
     253                    </td>
     254                </tr>
     255                <tr>
     256                    <th><?php esc_html_e( 'Translate Menu', 'multilanguage' ); ?></th>
     257                    <td>
     258                        <input type="checkbox" name="mltlngg_translate_menu" value="1" <?php checked( 1, $this->options['translate_menu'] ); ?> /> <span class="bws_info"><?php printf( esc_html__( 'Enable to translation for the created menu on the page %s (only Pages, Posts, Categories, only if a translation has been made for the corresponding objects)', 'multilanguage' ), '<a href="' . esc_url( admin_url( '/nav-menus.php' ) ) . '">' . esc_html__( 'Menus' ) . '</a>' ); ?></span>
    252259                    </td>
    253260                </tr>
  • multilanguage/trunk/multilanguage.php

    r3356543 r3439521  
    77Text Domain: multilanguage
    88Domain Path: /languages
    9 Version: 1.5.1
     9Version: 1.5.2
    1010Author URI: https://bestwebsoft.com/
    1111License: GPLv3 or later
     
    358358            'google_auto_translate'    => 0,
    359359            'enabled_roles'            => $enabled_roles,
     360            'translate_menu'           => 1,
    360361        );
    361362        return $options_default;
     
    499500                    $wpdb->prefix . 'mltlngg_translate',
    500501                    array(
    501                         'post_content' => $value->post_content,
     502                        'post_content' => wp_encode_emoji( $value->post_content ),
    502503                        'post_title'   => $value->post_title,
    503504                        'post_excerpt' => $value->post_excerpt,
     
    20322033                                    array(
    20332034                                        'post_ID'      => $post_id,
    2034                                         'post_content' => sanitize_post_field( 'post_content', wp_unslash( $mltlngg_translate['content'] ), 0, 'db' ),
     2035                                        'post_content' => wp_encode_emoji( sanitize_post_field( 'post_content', wp_unslash( $mltlngg_translate['content'] ), 0, 'db' ) ),
    20352036                                        'post_title'   => sanitize_text_field( wp_unslash( $mltlngg_translate['title'] ) ),
    20362037                                        'post_excerpt' => sanitize_text_field( wp_unslash( $excerpt ) ),
     
    20662067                            $wpdb->prefix . 'mltlngg_translate',
    20672068                            array(
    2068                                 'post_content' => sanitize_post_field( 'post_content', wp_unslash( $_POST['content'] ), 0, 'db' ),
     2069                                'post_content' => wp_encode_emoji( sanitize_post_field( 'post_content', wp_unslash( $_POST['content'] ), 0, 'db' ) ),
    20692070                                'post_title'   => sanitize_text_field( wp_unslash( $_POST['post_title'] ) ),
    20702071                                'post_excerpt' => $excerpt,
     
    20832084                        array(
    20842085                            'post_ID'      => $post_id,
    2085                             'post_content' => sanitize_post_field( 'post_content', wp_unslash( $_POST['content'] ), 0, 'db' ),
     2086                            'post_content' => wp_encode_emoji( sanitize_post_field( 'post_content', wp_unslash( $_POST['content'] ), 0, 'db' ) ),
    20862087                            'post_title'   => sanitize_text_field( wp_unslash( $_POST['post_title'] ) ),
    20872088                            'post_excerpt' => wp_specialchars_decode( $excerpt, ENT_COMPAT ),
     
    20992100                        'post_title'   => wp_specialchars_decode( sanitize_text_field( wp_unslash( $_POST[ 'title_' . $mltlngg_options['default_language'] ] ), ENT_COMPAT ) ),
    21002101                        'post_excerpt' => wp_specialchars_decode( $default_excerpt, ENT_COMPAT ),
    2101                         'post_content' => wp_specialchars_decode( sanitize_post_field( 'post_content', wp_unslash( $_POST[ 'content_' . $mltlngg_options['default_language'] ] ), ENT_COMPAT ), 0, 'db' ),
     2102                        'post_content' => wp_encode_emoji( wp_specialchars_decode( sanitize_post_field( 'post_content', wp_unslash( $_POST[ 'content_' . $mltlngg_options['default_language'] ] ), ENT_COMPAT ), 0, 'db' ) ),
    21022103                    );
    21032104                } else {
     
    21062107                        'post_title'   => wp_specialchars_decode( sanitize_text_field( wp_unslash( $_POST['post_title'] ) ) ),
    21072108                        'post_excerpt' => wp_specialchars_decode( $excerpt, ENT_COMPAT ),
    2108                         'post_content' => wp_specialchars_decode( sanitize_post_field( 'post_content', wp_unslash( $_POST['content'] ), 0, 'db' ), ENT_COMPAT ),
     2109                        'post_content' => wp_encode_emoji( wp_specialchars_decode( sanitize_post_field( 'post_content', wp_unslash( $_POST['content'] ), 0, 'db' ), ENT_COMPAT ) ),
    21092110                    );
    21102111                }
     
    21472148                    $wpdb->posts,
    21482149                    array(
    2149                         'post_content' => $default_language_data->post_content,
     2150                        'post_content' => wp_encode_emoji( $default_language_data->post_content ),
    21502151                        'post_title'   => $default_language_data->post_title,
    21512152                        'post_excerpt' => $default_language_data->post_excerpt,
     
    21962197                        $wpdb->prefix . 'mltlngg_translate',
    21972198                        array(
    2198                             'post_content' => sanitize_post_field( 'post_content', wp_unslash( $_POST['mltlngg_old_content'] ), 0, 'db' ),
     2199                            'post_content' => wp_encode_emoji( sanitize_post_field( 'post_content', wp_unslash( $_POST['mltlngg_old_content'] ), 0, 'db' ) ),
    21992200                            /*'post_content' => htmlentities( wp_unslash( $_POST['mltlngg_old_content'] ) ), */
    22002201                            'post_title'   => sanitize_text_field( wp_unslash( $_POST['mltlngg_old_title'] ) ),
     
    22152216                    array(
    22162217                        'post_ID'      => $post_id,
    2217                         'post_content' => sanitize_post_field( 'post_content', wp_unslash( $_POST['mltlngg_old_content'] ), 0, 'db' ),
     2218                        'post_content' => wp_encode_emoji( sanitize_post_field( 'post_content', wp_unslash( $_POST['mltlngg_old_content'] ), 0, 'db' ) ),
    22182219                        'post_title'   => sanitize_text_field( wp_unslash( $_POST['mltlngg_old_title'] ) ),
    22192220                        'post_excerpt' => $mltlngg_old_excerpt,
     
    25642565    function mltlngg_the_title_filter( $title, $post_id = null ) {
    25652566        global $mltlngg_options, $wpdb, $mltlngg_current_language, $mltlngg_enabled_languages_locale, $mltlngg_active_language, $post;
     2567
    25662568        if ( ! empty( $post_id ) ) {
    25672569            $id = ( $post_id instanceof WP_Post ) ? $post_id->ID : $post_id;
     
    26382640        foreach ( $items as $key => $item ) {
    26392641            if ( 'taxonomy' === $item->type ) {
    2640                 $new_title = $wpdb->get_var(
    2641                     $wpdb->prepare(
    2642                         'SELECT `name`
    2643                          FROM `' . $wpdb->prefix . 'mltlngg_terms_translate`
    2644                          WHERE `term_ID` = %d AND `language` = %s
    2645                         ',
    2646                         $item->object_id,
    2647                         $mltlngg_current_language
    2648                     )
    2649                 );
    2650                 if ( isset( $new_title ) && '' !== $new_title ) { /* If translation is exist and not empty, filter menu item */
    2651                     $item->title = $new_title;
    2652                 }
    2653             } elseif ( 'post_type' === $item->type && ( 'post' === $item->object || 'page' === $item->object ) ) {
     2642                if ( 0 == $mltlngg_options['translate_menu'] ) {
     2643                    $new_title = $wpdb->get_var(
     2644                        $wpdb->prepare(
     2645                            'SELECT `name`
     2646                             FROM `' . $wpdb->prefix . 'mltlngg_terms_translate`
     2647                             WHERE `term_ID` = %d AND `language` = %s
     2648                            ',
     2649                            $item->object_id,
     2650                            $mltlngg_get_default_language
     2651                        )
     2652                    );
     2653                    if ( isset( $new_title ) && '' !== $new_title ) { /* If translation is exist and not empty, filter menu item */
     2654                        $item->title = $new_title;
     2655                    } else {
     2656                        $new_title = $wpdb->get_var(
     2657                            $wpdb->prepare(
     2658                                'SELECT `name`
     2659                                 FROM `' . $wpdb->terms . '`
     2660                                 WHERE `term_id` = %d
     2661                                ',
     2662                                $item->object_id
     2663                            )
     2664                        );
     2665                        if ( isset( $new_title ) && '' !== $new_title ) { /* If translation is exist and not empty, filter menu item */
     2666                            $item->title = $new_title;
     2667                        }
     2668                    }
     2669                } else {
     2670                    $new_title = $wpdb->get_var(
     2671                        $wpdb->prepare(
     2672                            'SELECT `name`
     2673                             FROM `' . $wpdb->prefix . 'mltlngg_terms_translate`
     2674                             WHERE `term_ID` = %d AND `language` = %s
     2675                            ',
     2676                            $item->object_id,
     2677                            $mltlngg_current_language
     2678                        )
     2679                    );
     2680                    if ( isset( $new_title ) && '' !== $new_title ) { /* If translation is exist and not empty, filter menu item */
     2681                        $item->title = $new_title;
     2682                    }
     2683                }
     2684            } elseif ( 'post_type' === $item->type && ( 'post' === $item->object || 'page' === $item->object ) && 0 != $mltlngg_options['translate_menu'] ) {
    26542685                $new_title = $wpdb->get_var(
    26552686                    $wpdb->prepare(
  • multilanguage/trunk/readme.txt

    r3356543 r3439521  
    44Tags: language switcher, wordpress translation plugin, language translator, multilanguage wordpress, translate wordpress
    55Requires at least: 6.4
    6 Tested up to: 6.8.2
    7 Stable tag: 1.5.1
     6Tested up to: 6.9
     7Stable tag: 1.5.2
    88License: GPLv3 or later
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    5151    * Translation-ready admin interface
    5252* Enable translation for any user role
     53* Translate menu
    5354
    5455> **Pro Features**
     
    296297== Changelog ==
    297298
     299= V1.5.2 - 14.01.2026 =
     300* Update : Plugin optimization compleated.
     301* Update : All functionality for WordPress 6.9 has been updated.
     302* NEW : Option not to translate the menu.
     303
    298304= V1.5.1 - 12.08.2025 =
    299305* NEW : Enable translation for any user role.
     
    550556== Upgrade Notice ==
    551557
     558= V1.5.2 =
     559* The compatibility with new WordPress version updated.
     560* New features added.
     561
    552562= V1.5.1 =
    553563* The compatibility with new WordPress version updated.
Note: See TracChangeset for help on using the changeset viewer.