⚡ NEW: Changeset/ - Collection

Changeset 2941315


Ignore:
Timestamp:
07/21/2023 02:29:55 PM (2 years ago)
Author:
dougwollison
Message:

Version 2.9.3, pulled from GitHub

Location:
nlingual
Files:
6 edited
17 copied

Legend:

Unmodified
Added
Removed
  • nlingual/tags/2.9.3/includes/class-nlingual-backend.php

    r2681436 r2941315  
    13381338     * Will redirect to the edit screen for the new translation.
    13391339     *
     1340     * @since 2.9.3 Fix permission check.
    13401341     * @since 2.9.2 Add permissions check, redirected-by for wp_redirect().
    13411342     * @since 2.6.0
     
    13611362        // Check permissions, must be able to create posts
    13621363        $post_type_obj = get_post_type_object( $post->post_type );
    1363         if ( current_user_can( $post_type_obj->create_posts ) ) {
     1364        if ( ! current_user_can( $post_type_obj->cap->create_posts ) ) {
    13641365            wp_die( __( 'You are now allowed to create a translation for this post.', 'nlingual' ) );
    13651366        }
  • nlingual/tags/2.9.3/includes/class-nlingual-rewriter.php

    r2681436 r2941315  
    452452            elseif ( ( is_tax() || is_tag() || is_category() )
    453453            && count( $wp_query->tax_query->queries ) == 1
    454             && count( $wp_query->tax_query->queries[0]['terms'] ) == 1 ) {
     454            && count( $wp_query->tax_query->queries[0]['terms'] ) == 1
     455            && is_a( get_queried_object(), 'WP_Term' )
     456            && term_exists( get_queried_object()->term_id, get_queried_object()->taxonomy ) ) {
    455457                $url = get_term_link( get_queried_object() );
    456458            }
     
    548550
    549551        // Get the translation counterpart
    550         $translation_id = self::get_post_translation( $post_id, $language );
     552        $translation_id = Translator::get_post_translation( $post_id, $language );
    551553
    552554        // Return the translations permalink
  • nlingual/tags/2.9.3/includes/class-nlingual-translator.php

    r1963115 r2941315  
    172172            $group = array();
    173173            foreach ( $result as $row ) {
    174                 $group['language_by_object'][ $row['object_id'] ] = $row['language_id'];
    175                 $group['object_by_language'][ $row['language_id'] ] = $row['object_id'];
     174                $group['language_by_object'][ $row['object_id'] ] = intval( $row['language_id'] );
     175                $group['object_by_language'][ $row['language_id'] ] = intval( $row['object_id'] );
    176176
    177177                // Cache the group ID for each object
  • nlingual/tags/2.9.3/nlingual.php

    r2681436 r2941315  
    44Plugin URI: https://github.com/dougwollison/nlingual
    55Description: Easy to manage Multilingual system, with theme development utilities and post data synchronization.
    6 Version: 2.9.2
     6Version: 2.9.3
    77Author: Doug Wollison
    88Author URI: https://dougw.me
     
    5151 * @var string
    5252 */
    53 define( 'NL_PLUGIN_VERSION', '2.9.2' );
     53define( 'NL_PLUGIN_VERSION', '2.9.3' );
    5454
    5555/**
  • nlingual/tags/2.9.3/readme.txt

    r2681436 r2941315  
    33Tags: multilingual, language, bilingual, translation
    44Requires at least: 4.9
    5 Tested up to: 5.9.0
     5Tested up to: 6.2.2
    66Requires PHP: 5.6.20
    7 Stable tag: 2.9.2
     7Stable tag: 2.9.3
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8080**Details on each release can be found [on the GitHub releases page](https://github.com/dougwollison/nlingual/releases) for this project.**
    8181
     82= 2.9.3 =
     83Permission fixes, type checks, bug fixes.
     84
    8285= 2.9.2 =
    8386Quality of life improvements, Localizer/Synchronizer/Rewriter fixes, opt-out for accepted language.
  • nlingual/trunk/includes/class-nlingual-backend.php

    r2681436 r2941315  
    13381338     * Will redirect to the edit screen for the new translation.
    13391339     *
     1340     * @since 2.9.3 Fix permission check.
    13401341     * @since 2.9.2 Add permissions check, redirected-by for wp_redirect().
    13411342     * @since 2.6.0
     
    13611362        // Check permissions, must be able to create posts
    13621363        $post_type_obj = get_post_type_object( $post->post_type );
    1363         if ( current_user_can( $post_type_obj->create_posts ) ) {
     1364        if ( ! current_user_can( $post_type_obj->cap->create_posts ) ) {
    13641365            wp_die( __( 'You are now allowed to create a translation for this post.', 'nlingual' ) );
    13651366        }
  • nlingual/trunk/includes/class-nlingual-rewriter.php

    r2681436 r2941315  
    452452            elseif ( ( is_tax() || is_tag() || is_category() )
    453453            && count( $wp_query->tax_query->queries ) == 1
    454             && count( $wp_query->tax_query->queries[0]['terms'] ) == 1 ) {
     454            && count( $wp_query->tax_query->queries[0]['terms'] ) == 1
     455            && is_a( get_queried_object(), 'WP_Term' )
     456            && term_exists( get_queried_object()->term_id, get_queried_object()->taxonomy ) ) {
    455457                $url = get_term_link( get_queried_object() );
    456458            }
     
    548550
    549551        // Get the translation counterpart
    550         $translation_id = self::get_post_translation( $post_id, $language );
     552        $translation_id = Translator::get_post_translation( $post_id, $language );
    551553
    552554        // Return the translations permalink
  • nlingual/trunk/includes/class-nlingual-translator.php

    r1963115 r2941315  
    172172            $group = array();
    173173            foreach ( $result as $row ) {
    174                 $group['language_by_object'][ $row['object_id'] ] = $row['language_id'];
    175                 $group['object_by_language'][ $row['language_id'] ] = $row['object_id'];
     174                $group['language_by_object'][ $row['object_id'] ] = intval( $row['language_id'] );
     175                $group['object_by_language'][ $row['language_id'] ] = intval( $row['object_id'] );
    176176
    177177                // Cache the group ID for each object
  • nlingual/trunk/nlingual.php

    r2681436 r2941315  
    44Plugin URI: https://github.com/dougwollison/nlingual
    55Description: Easy to manage Multilingual system, with theme development utilities and post data synchronization.
    6 Version: 2.9.2
     6Version: 2.9.3
    77Author: Doug Wollison
    88Author URI: https://dougw.me
     
    5151 * @var string
    5252 */
    53 define( 'NL_PLUGIN_VERSION', '2.9.2' );
     53define( 'NL_PLUGIN_VERSION', '2.9.3' );
    5454
    5555/**
  • nlingual/trunk/readme.txt

    r2681436 r2941315  
    33Tags: multilingual, language, bilingual, translation
    44Requires at least: 4.9
    5 Tested up to: 5.9.0
     5Tested up to: 6.2.2
    66Requires PHP: 5.6.20
    7 Stable tag: 2.9.2
     7Stable tag: 2.9.3
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8080**Details on each release can be found [on the GitHub releases page](https://github.com/dougwollison/nlingual/releases) for this project.**
    8181
     82= 2.9.3 =
     83Permission fixes, type checks, bug fixes.
     84
    8285= 2.9.2 =
    8386Quality of life improvements, Localizer/Synchronizer/Rewriter fixes, opt-out for accepted language.
Note: See TracChangeset for help on using the changeset viewer.