Plugin Directory

Changeset 3183922


Ignore:
Timestamp:
11/07/2024 02:39:03 PM (13 months ago)
Author:
dougwollison
Message:

Hotfix 2.10.0.1

Location:
nlingual
Files:
34 edited
37 copied

Legend:

Unmodified
Added
Removed
  • nlingual/tags/2.10.0.1/includes/abstract-nlingual-handler.php

    r3168845 r3183922  
    135135     *
    136136     * @param string $tag           The name of the filter to hook the $method to.
    137      * @param string $method        The name of the called classe's method to run when applied.
     137     * @param string $method        The name of the called class' method to run when applied.
    138138     * @param int    $priority      Optional. The priority to use for this particular callback.
    139139     * @param int    $accepted_args Optional. The number of arguments the callback accepts.
     
    175175     * @param string $tag          The name of the filter to remove from.
    176176     * @param string $method       The name of the called class' method to remove.
    177      * @param bool   $dont_disable Wether or not to skip flagging it at disabled.
     177     * @param bool   $dont_disable Whether or not to skip flagging it at disabled.
    178178     *
    179179     * @return bool|int The priority it originally had (false if wasn't added).
     
    216216     * @since 2.6.0
    217217     *
    218      * @param bool $force Wether or not to explicitly disable all hooks.
     218     * @param bool $force Whether or not to explicitly disable all hooks.
    219219     */
    220220    public static function remove_all_hooks( $disable = false ) {
     
    233233     * @param string $tag        The name of the filter to remove from.
    234234     * @param string $method     The name of the class' method to remove.
    235      * @param bool   $dont_force Wether or not to ignore a hook's disabled status.
     235     * @param bool   $dont_force Whether or not to ignore a hook's disabled status.
    236236     */
    237237    final public static function restore_hook( $tag, $method, $dont_force = false ) {
     
    255255     * @since 2.6.0
    256256     *
    257      * @param bool $force Wether or not to force-restore all hooks.
     257     * @param bool $force Whether or not to force-restore all hooks.
    258258     */
    259259    public static function restore_all_hooks( $force = false ) {
  • nlingual/tags/2.10.0.1/includes/autoloader.php

    r1896568 r3183922  
    2222 * @param string $name The symbol name of the asset being requested.
    2323 *
    24  * @return bool Wether or not the file was found and loaded.
     24 * @return bool Whether or not the file was found and loaded.
    2525 */
    2626function find( $type, $name ) {
     
    4646 * Find/load an nLingual class.
    4747 *
    48  * Will automatically initailize if it's a Functional sub-class.
     48 * Will automatically initialize if it's a Functional sub-class.
    4949 *
    5050 * @internal
  • nlingual/tags/2.10.0.1/includes/class-nlingual-backend.php

    r3168847 r3183922  
    1616 * Hooks into various backend systems to load
    1717 * custom assets, modify the interface, and
    18  * add language management to relevent screens.
     18 * add language management to relevant screens.
    1919 *
    2020 * @internal Used by the System.
     
    343343     */
    344344    private static function register_localized_locations( $type, $global ) {
    345         $list = $GLOBALS[ $global ];
     345        $list = $GLOBALS[ $global ] ?? array();
    346346
    347347        // Cache the old version of the menus for reference
     
    733733
    734734            /* translators: %1$s = The name of the language, %2$s = The title of the post, wrapped in a link */
    735             $links[] = esc_html( _fx( '%1$s: %2$s', 'language: title', 'nlingual', $other_language->system_name, $link ) );
     735            $links[] = _fx( '%1$s: %2$s', 'language: title', 'nlingual', $other_language->system_name, $link );
    736736        }
    737737        if ( $links ) {
     
    11621162            // And the post type supports translation
    11631163            && Registry::is_post_type_supported( $post->post_type )
    1164             // And the post type has syncronization rules specified
     1164            // And the post type has synchronization rules specified
    11651165            && Registry::get_post_sync_rules( $post->post_type )
    11661166            // And the post has sister translations
     
    12961296     *
    12971297     * @since 2.10.0 Add translator notes. Explicitly enqueue in header.
    1298      * @sicne 2.8.8 Add admin_post, for nl_new_translation call.
     1298     * @since 2.8.8 Add admin_post, for nl_new_translation call.
    12991299     * @since 2.6.0 Updated to use plugin version for CSS/JS files.
    13001300     * @since 2.0.0
     
    13271327
    13281328    /**
    1329      * Print relevent variables for JavaScript.
     1329     * Print relevant variables for JavaScript.
    13301330     *
    13311331     * @since 2.10.0 Use wp_json_encode().
     
    13521352
    13531353    /**
    1354      * Create a clone of the requested post in the requested lanuage.
     1354     * Create a clone of the requested post in the requested language.
    13551355     *
    13561356     * Will redirect to the edit screen for the new translation.
  • nlingual/tags/2.10.0.1/includes/class-nlingual-documenter.php

    r2449432 r3183922  
    164164     * @uses Documenter::register_help_tab() to register each screen/tab.
    165165     *
    166      * @param string $screens An array of screen=>tab IDs to register.
     166     * @param array<string,string> $screens An array of screen=>tab IDs to register.
    167167     */
    168168    public static function register_help_tabs( $screens ) {
     
    177177
    178178    /**
    179      * Load the sepecified tab's file and return it's ID/title/content.
     179     * Load the specified tab's file and return it's ID/title/content.
    180180     *
    181181     * @since 2.0.0
  • nlingual/tags/2.10.0.1/includes/class-nlingual-exception.php

    r3168845 r3183922  
    7272
    7373    /**
    74      * Ouput a string representation of the exception.
     74     * Output a string representation of the exception.
    7575     *
    7676     * @since 2.0.0
  • nlingual/tags/2.10.0.1/includes/class-nlingual-frontend.php

    r3168847 r3183922  
    6868        self::add_hook( 'wp_nav_menu_objects', 'handle_language_links', 10, 1 );
    6969
    70         // General fitlering
     70        // General filtering
    7171        self::add_hook( 'body_class', 'add_body_classes', 10, 1 );
    7272        self::add_hook( 'option_page_on_front', 'current_language_post', 10, 1 );
     
    252252     * @param string $type       The type of location.
    253253     * @param array  $locations  The list of locations to filter.
    254      * @param array  $registered The list of orignially register locations.
     254     * @param array  $registered The list of originally register locations.
    255255     *
    256256     * @return array The modified $locations with unlocalized versions updated.
     
    360360         * @since 2.9.2
    361361         *
    362          * @param bool   $localize_items Wether or not to localize menu items.
     362         * @param bool   $localize_items Whether or not to localize menu items.
    363363         * @param object $menu           The menu being considered.
    364364         * @param array  $items          The items for the menu.
     
    695695        }
    696696
    697         // Replace with new isntance of patched one
     697        // Replace with new instance of patched one
    698698        $wp_locale = new Locale();
    699699    }
  • nlingual/tags/2.10.0.1/includes/class-nlingual-installer.php

    r1896568 r3183922  
    7070     */
    7171    private static function plugin_security_check( $check_referer = null ) {
    72         // Make sure they have permisson
     72        // Make sure they have permission
    7373        if ( ! current_user_can( 'activate_plugins' ) ) {
    7474            return false;
     
    9292     * Test if the site previously used nLingual 1.
    9393     *
    94      * Tests for presense of old nLingual-options array.
    95      *
    96      * @since 2.0.0
    97      *
    98      * @return bool Wether or not we're upgrading.
     94     * Tests for presence of old nLingual-options array.
     95     *
     96     * @since 2.0.0
     97     *
     98     * @return bool Whether or not we're upgrading.
    9999     */
    100100    private static function is_upgrading() {
     
    305305     * @global \wpdb $wpdb The database abstraction class instance.
    306306     *
    307      * @return bool Wether or not an upgrade was performed.
     307     * @return bool Whether or not an upgrade was performed.
    308308     */
    309309    public static function upgrade() {
  • nlingual/tags/2.10.0.1/includes/class-nlingual-language.php

    r2375574 r3183922  
    169169     *     @option string "iso_code"    The ISO 639-1 code for the language.
    170170     *     @option string "direction"   The text direction of the language (ltr or rtl).
    171      *     @option int    "list_order"  The disired order of the language.
     171     *     @option int    "list_order"  The desired order of the language.
    172172     */
    173173    public function __construct( $values ) {
  • nlingual/tags/2.10.0.1/includes/class-nlingual-languages.php

    r3168845 r3183922  
    126126     * @since 2.0.0
    127127     *
    128      * @return bool Wether or not the position is valid.
     128     * @return bool Whether or not the position is valid.
    129129     */
    130130    public function valid() {
     
    321321     *
    322322     * @param array|Language $language The language to add.
    323      * @param bool           $sort     Wether or not to sort after adding.
     323     * @param bool           $sort     Whether or not to sort after adding.
    324324     *
    325325     * @return self.
     
    387387     *
    388388     * @since 2.9.1 Drop checking of locale/ISO for match.
    389      * @sicne 2.2.0 Changed to check all locales before checking ISO codes.
     389     * @since 2.2.0 Changed to check all locales before checking ISO codes.
    390390     * @since 2.0.0
    391391     *
  • nlingual/tags/2.10.0.1/includes/class-nlingual-liaison.php

    r3168847 r3183922  
    421421     * @param \WP_Query $query     The query being modified.
    422422     *
    423      * @return mixed The default language ot use.
     423     * @return mixed The default language to use.
    424424     */
    425425    public static function quickstart_order_manager_language( $pre_value, $query ) {
     
    601601     */
    602602    public static function indexpages_filter_pages_for_dropdown( $pages, $args ) {
    603         // Bail if pages are not supported for tranlsation
     603        // Bail if pages are not supported for translation
    604604        if ( ! Registry::is_post_type_supported( 'page' ) ) {
    605605            return $pages;
     
    680680
    681681    /**
    682      * Check if certian SEO plugins are active, setup necessary helpers.
     682     * Check if certain SEO plugins are active, setup necessary helpers.
    683683     *
    684684     * @since 2.9.1
  • nlingual/tags/2.10.0.1/includes/class-nlingual-localizer-field.php

    r2375574 r3183922  
    9494
    9595    /**
    96      * Wether or not to ignore the fallback when the localized value is empty.
     96     * Whether or not to ignore the fallback when the localized value is empty.
    9797     *
    9898     * @since 2.6.0
  • nlingual/tags/2.10.0.1/includes/class-nlingual-localizer.php

    r3168847 r3183922  
    120120
    121121    /**
    122      * Registry of objects whos localized data has been preloaded.
     122     * Registry of objects whose localized data has been preloaded.
    123123     *
    124124     * @internal
     
    153153     * @param string|array $ids The ID (or list of IDs to try) of the field to retrieve.
    154154     *
    155      * @return Localizer_Field|bool The retreived field, FALSE on failure.
     155     * @return Localizer_Field|bool The retrieved field, FALSE on failure.
    156156     */
    157157    public static function get_field( $ids ) {
     
    511511     * @param string|array $id          The ID (or possible IDs) of the field, or a key to search for.
    512512     * @param int          $language_id The language ID to match.
    513      * @param int          $object_id   The object ID if relevent (otherwise 0).
     513     * @param int          $object_id   The object ID if relevant (otherwise 0).
    514514     * @param string       $fallback    Optional. A fallback to use if the result is empty/null.
    515      * @param bool         $check_reg   Optional. Wether or not to check if the field is regsitered before fetching (default TRUE).
     515     * @param bool         $check_reg   Optional. Whether or not to check if the field is registered before fetching (default TRUE).
    516516     *
    517517     * @return field|bool The localized version, false if nothing found.
     
    565565     *
    566566     * @param string $key       The field key to search for.
    567      * @param int    $object_id Optional. The object ID if relevent (otherwise 0).
    568      * @param bool   $check_reg Optional. Wether or not to check if the field is regsitered before fetching (default TRUE).
     567     * @param int    $object_id Optional. The object ID if relevant (otherwise 0).
     568     * @param bool   $check_reg Optional. Whether or not to check if the field is registered before fetching (default TRUE).
    569569     *
    570570     * @return array The localized versions of the specified field.
     
    611611     * @param string $key         The field key to search for.
    612612     * @param int    $language_id The language ID to save for.
    613      * @param int    $object_id   The object ID if relevent (otherwise 0).
     613     * @param int    $object_id   The object ID if relevant (otherwise 0).
    614614     * @param string $value       The localized value of the field.
    615      * @param bool   $check_reg   Optional. Wether or not to check if the field is regsitered before fetching (default TRUE).
     615     * @param bool   $check_reg   Optional. Whether or not to check if the field is registered before fetching (default TRUE).
    616616     */
    617617    public static function save_field_value( $key, $language_id, $object_id, $value, $check_reg = true ) {
     
    857857            $term_object = \WP_Term::get_instance( $term_id ); // Get the raw term
    858858
    859             // If the term can be retrieved, localize the name, falling back if applicalbe
     859            // If the term can be retrieved, localize the name, falling back if applicable
    860860            if ( $term_object ) {
    861861                $term = self::get_field_value( "term.{$term_object->taxonomy}:term_name", $language->id, $term_id, $term );
     
    880880
    881881        if ( $args['fields'] == 'names' ) {
    882             // Chanage to id=>names, will convert back later
     882            // Change to id=>names, will convert back later
    883883            $args['fields'] = 'id=>name';
    884884
     
    938938     */
    939939    public static function update_unlocalized_term_fields( $term_id, $tt_id, $taxonomy ) {
    940         // Get the udpated term, since we aren't provided with the updated values
     940        // Get the updated term, since we aren't provided with the updated values
    941941        $term = get_term( $term_id, $taxonomy );
    942942
     
    980980        }
    981981
    982         // Determin object ID to use
     982        // Determine object ID to use
    983983        $object_id_keys = array(
    984984            'post.php'      => 'post_ID',
     
    10681068        }
    10691069
    1070         // Determin object ID to use
     1070        // Determine object ID to use
    10711071        $object_id_keys = array(
    10721072            'post'      => 'post',
  • nlingual/tags/2.10.0.1/includes/class-nlingual-manager.php

    r3168847 r3183922  
    11<?php
    22/**
    3  * nLingual Management Funtionality
     3 * nLingual Management Functionality
    44 *
    55 * @package nLingual
     
    8383            array( __CLASS__, 'settings_page' ), // callback
    8484            'dashicons-translation', // icon
    85             90 // Postion; after settings
     85            90 // Position; after settings
    8686        );
    8787
     
    242242            }
    243243
    244             // Default text direction to ltr if not set, rtl if not explictly ltr
     244            // Default text direction to ltr if not set, rtl if not explicitly ltr
    245245            $entry['direction'] = 'ltr';
    246246            if ( isset( $language['direction'] ) && $language['direction'] != 'ltr' ) {
  • nlingual/tags/2.10.0.1/includes/class-nlingual-registry.php

    r3168847 r3183922  
    242242     * Check if an option is supported.
    243243     *
    244      * Will also udpate the option value if it was deprecated
     244     * Will also update the option value if it was deprecated
    245245     * but has a sufficient alternative.
    246246     *
     
    250250     * @param string &$option The option name.
    251251     *
    252      * @return bool Wether or not the option is supported.
     252     * @return bool Whether or not the option is supported.
    253253     */
    254254    public static function has( &$option ) {
     
    280280        // Check if it's set, return it's value.
    281281        if ( isset( self::$options[ $option ] ) ) {
    282             // Check if it's been overriden, use that unless otherwise requested
     282            // Check if it's been overridden, use that unless otherwise requested
    283283            $has_override = isset( self::$options_override[ $option ] );
    284284            if ( $has_override && ! $true_value ) {
     
    376376     * @since 2.0.0
    377377     *
    378      * @uses Registry::get() to retrive the appropriate rules array.
     378     * @uses Registry::get() to retrieve the appropriate rules array.
    379379     *
    380380     * @param string $rule_type   The type of rules to retrieve ('sync' or 'clone').
     
    446446     *
    447447     * @param mixed $language The desired language.
    448      * @param bool  $lock     Wether or not to lock the selection.
    449      * @param bool  $override Wether or not to override the lock.
     448     * @param bool  $lock     Whether or not to lock the selection.
     449     * @param bool  $override Whether or not to override the lock.
    450450     *
    451451     * @throws Exception If the language specified does not exist.
    452452     *
    453      * @return bool Wether or not the language could be changed.
     453     * @return bool Whether or not the language could be changed.
    454454     */
    455455    public static function set_language( $language, $lock = false, $override = false ) {
     
    557557     * @param mixed $language2 The language to compare against.
    558558     *
    559      * @return bool The result of the comparision.
     559     * @return bool The result of the comparison.
    560560     */
    561561    public static function compare_languages( $language1, $language2 ) {
     
    626626     * @param string $location Optional. The ID of a specific location to check.
    627627     *
    628      * @return bool Wether or not the location is localizable.
     628     * @return bool Whether or not the location is localizable.
    629629     */
    630630    public static function is_location_supported( $type, $location = null ) {
     
    670670     *
    671671     * @param string|array $post_types  The post type(s) to check.
    672      * @param bool         $require_all Optional. Wether or not to ensure ALL are supported.
    673      *
    674      * @return bool Wether or not the post type(s) are supported.
     672     * @param bool         $require_all Optional. Whether or not to ensure ALL are supported.
     673     *
     674     * @return bool Whether or not the post type(s) are supported.
    675675     */
    676676    public static function is_post_type_supported( $post_types, $require_all = false ) {
     
    709709     * @param string|array $taxonomies The taxonomy(ies) to check.
    710710     *
    711      * @return bool Wether or not the taxonomy(ies) are supported.
     711     * @return bool Whether or not the taxonomy(ies) are supported.
    712712     */
    713713    public static function is_taxonomy_supported( $taxonomies ) {
     
    739739     * @global \WP_Rewrite $wp_rewrite The WordPress rewrite API.
    740740     *
    741      * @return bool Wether or not rewriting can be used.
     741     * @return bool Whether or not rewriting can be used.
    742742     */
    743743    public static function can_use_rewrites() {
     
    759759     * This setting applies if:
    760760     * - it's enabled
    761      * - the default langauge is requested
     761     * - the default language is requested
    762762     * - the accepted language doesn't match
    763763     *   another available language
     
    767767     * @param mixed $language The language to compare.
    768768     *
    769      * @return bool Wether or not the skip_default_l10n rule applies.
     769     * @return bool Whether or not the skip_default_l10n rule applies.
    770770     */
    771771    public static function does_skip_default_l10n_apply( $language ) {
  • nlingual/tags/2.10.0.1/includes/class-nlingual-rewriter.php

    r3168847 r3183922  
    2626
    2727    /**
    28      * Internal flag for wether or not to localize a URL.
     28     * Internal flag for whether or not to localize a URL.
    2929     *
    3030     * @internal
     
    105105     *
    106106     * @param string|array $url_data        Optional. The URL string or parsed array to process.
    107      * @param bool         $return_language Optional. Wether or not to return just the language.
     107     * @param bool         $return_language Optional. Whether or not to return just the language.
    108108     *
    109109     * @return URL The parsed and processed URL object.
     
    217217     *
    218218     * @since 2.10.0 Use wp_parse_url().
    219      * @since 2.9.1 Adjust URL building and trainling slash handling.
     219     * @since 2.9.1 Adjust URL building and trailing slash handling.
    220220     * @since 2.9.0 Use does_skip_default_l10n_apply() to handle default URL localization logic,
    221221     *              Added $force_localize to allow overriding skip_default_l10n even if it applies.
     
    232232     * @param string $url            The URL to parse.
    233233     * @param mixed  $language       Optional. The desired language to localize to.
    234      * @param bool   $force_localize Optional. Wether or not to ignore skip_default_l10n.
     234     * @param bool   $force_localize Optional. Whether or not to ignore skip_default_l10n.
    235235     *
    236236     * @throws Exception If the language requested does not exist.
     
    256256
    257257        /**
    258          * Filter wether or not to localize the URL.
     258         * Filter whether or not to localize the URL.
    259259         *
    260260         * @since 2.8.4 Dropped $relocalize param.
     
    305305
    306306            // If it's not a wordpress internal URL,
    307             // AND skip_defalt_l10n does not apply,
     307            // AND skip_default_l10n does not apply,
    308308            // Go ahead and localize the URL
    309309            if ( ! preg_match( '#^/wp-([\w-]+.php|(admin|content|includes)/)#', $the_url->path )
     
    494494                unset( $_GET['s'] );
    495495            }
    496             // Give up and just get the orginally requested URL, relocalized
     496            // Give up and just get the originally requested URL, relocalized
    497497            else {
    498498                $url = self::localize_url( NL_ORIGINAL_URL, null );
     
    612612     * @uses Rewriter::localize_here() to get each URL.
    613613     *
    614      * @param bool   $skip_current Wether or not to skip the current language.
     614     * @param bool   $skip_current Whether or not to skip the current language.
    615615     * @param string $index_by     What language property to use for the array index (typically id or slug).
    616616     *
  • nlingual/tags/2.10.0.1/includes/class-nlingual-settings.php

    r3168847 r3183922  
    108108
    109109    /**
    110      * Given an array, extract the disired value defined like so: myvar[mykey][0].
     110     * Given an array, extract the desired value defined like so: myvar[mykey][0].
    111111     *
    112112     * @since 2.0.0
     
    149149     * Retrieve the settings value.
    150150     *
    151      * Handles names like option[suboption][] appropraitely.
     151     * Handles names like option[suboption][] appropriately.
    152152     *
    153153     * @since 2.0.0
     
    191191     *     @option mixed  "data" Optional. data for the field.
    192192     *     @option string "help" Optional. Help text.
    193      * @param mixed $value Optional. A specifi value to use
     193     * @param mixed $value Optional. A specific value to use
    194194     *                     instead of dynamically retrieving it.
    195195     */
     
    229229
    230230        if ( $args['help'] ) {
    231             // Wrap $html in lable with help text if checkbox or radio
     231            // Wrap $html in label with help text if checkbox or radio
    232232            if ( $args['type'] == 'checkbox' || $args['type'] == 'radio' ) {
    233233                $html = sprintf( '<label>%s %s</label>', $html, $args['help'] );
  • nlingual/tags/2.10.0.1/includes/class-nlingual-system.php

    r3168845 r3183922  
    189189     *
    190190     * @param mixed $language           The language object, slug or id.
    191      * @param bool  $reload_textdomains Wether or not to reload text domains.
     191     * @param bool  $reload_textdomains Whether or not to reload text domains.
    192192     */
    193193    public static function switch_language( $language, $reload_textdomains = false ) {
     
    423423
    424424            /**
    425              * @todo figure out handling of switching langauge within switching blog
     425             * @todo figure out handling of switching language within switching blog
    426426             */
    427427
     
    469469     * @uses Rewriter::process_url() to parse the current page URL.
    470470     * @uses Registry::does_skip_default_l10n_apply() to see if the default language URL should be unlocalized.
    471      * @uses Registry::accepted_language() to determine a perferred language.
     471     * @uses Registry::accepted_language() to determine a preferred language.
    472472     * @uses Registry::set_language() to tentatively apply the detected language.
    473473     */
     
    667667     * Flag a post being (un)trashed.
    668668     *
    669      * This is to prevent syncronize_post() from proceeding.
     669     * This is to prevent synchronize_post() from proceeding.
    670670     *
    671671     * @since 2.6.0
     
    836836        }
    837837
    838         // If the languge was detected via URL and we're still parsing the request, force localization
     838        // If the language was detected via URL and we're still parsing the request, force localization
    839839        $force_localize = defined( 'NL_DETECTED_SOURCE' ) && NL_DETECTED_SOURCE == 'url' && ! did_action( 'parse_request' );
    840840
     
    11121112        }
    11131113
    1114         // If in the backend, or language is not required, add 0 to retreive language-less posts too
     1114        // If in the backend, or language is not required, add 0 to retrieve language-less posts too
    11151115        if ( is_backend() || ! Registry::get( 'language_is_required' ) ) {
    11161116            $value[] = '0';
     
    11981198        $requested_languages = (array) $query_vars[ $query_var ];
    11991199
    1200         // Get the available languages for valiation purposes
     1200        // Get the available languages for validation purposes
    12011201        $all_languages = Registry::languages();
    12021202
     
    12461246     * @uses Registry::get() to retrieve the show_all_languages option.
    12471247     * @uses Registry::languages() to check/get the matching language object.
    1248      * @uses Registry::current_language() as the default language to fitler by.
     1248     * @uses Registry::current_language() as the default language to filter by.
    12491249     * @uses Translator::get_post_language() to get the translation in that language.
    12501250     *
    12511251     * @param array $pages The list of pages to filter.
    1252      * @param array $args  The arugments passed to get_pages().
     1252     * @param array $args  The arguments passed to get_pages().
    12531253     *
    12541254     * @return array The filtered list of pages.
  • nlingual/tags/2.10.0.1/includes/class-nlingual-translator.php

    r3168847 r3183922  
    2424 * @method static bool|Language get_post_language( int|\WP_Post $post, bool $true_value = false ) get a post's language.
    2525 * @method static bool|Language get_term_language( int|\WP_Term $term, bool $true_value = false ) get a term's language.
    26  * @method static bool          set_post_language( int|\WP_Post $post, mixed $langauge )          set a post's language.
    27  * @method static bool          set_term_language( int|\WP_Term $term, mixed $langauge )          set a term's language.
     26 * @method static bool          set_post_language( int|\WP_Post $post, mixed $language )          set a post's language.
     27 * @method static bool          set_term_language( int|\WP_Term $term, mixed $language )          set a term's language.
    2828 * @method static bool          delete_post_language( int|\WP_Post $post )                        delete a post's language.
    2929 * @method static bool          delete_term_language( int|\WP_Term $term )                        delete a term's language.
     
    215215     * @param string $object_type The type of object.
    216216     * @param int    $object_id   The ID of the object.
    217      * @param bool   $true_value  Wether or not to bypass language_is_requried fallback.
     217     * @param bool   $true_value  Whether or not to bypass language_is_required fallback.
    218218     *
    219219     * @return bool|Language The language of the object (false if not found).
     
    451451     * any of the languages listed aren't valid.
    452452     *
    453      * @since 2.10.0 Fix doucmentation on $translations.
     453     * @since 2.10.0 Fix documentation on $translations.
    454454     * @since 2.6.0 Now flushes cache for translations as well as target object.
    455455     * @since 2.0.0
     
    468468     * @throws Exception If the language specified does not exist.
    469469     *
    470      * @param bool Wether or not the association could be done (false if aborted).
     470     * @param bool Whether or not the association could be done (false if aborted).
    471471     */
    472472    public static function set_object_translations( $object_type, $object_id, $translations ) {
     
    543543     * @throws Exception If the language specified does not exist.
    544544     *
    545      * @param bool Wether or not the association could be done.
     545     * @param bool Whether or not the association could be done.
    546546     */
    547547    public static function set_object_translation( $object_type, $object_id, $language, $target_id ) {
     
    576576     * @throws Exception If the language specified does not exist.
    577577     *
    578      * @return bool Wether or not a deletion was performed (false = nothing to delete).
     578     * @return bool Whether or not a deletion was performed (false = nothing to delete).
    579579     */
    580580    public static function delete_object_translation( $object_type, $object_id, $language ) {
  • nlingual/tags/2.10.0.1/includes/class-nlingual-url.php

    r3168847 r3183922  
    148148        // If not an array, throw an exception
    149149        elseif ( ! is_array( $url_data ) ) {
    150             throw new Exception( __CLASS__ . '::parse() expects a string or array, recieved ' . gettype( $url_data ), NL_ERR_UNSUPPORTED );
     150            throw new Exception( __CLASS__ . '::parse() expects a string or array, received ' . gettype( $url_data ), NL_ERR_UNSUPPORTED );
    151151        }
    152152
     
    239239        }
    240240
    241         // Finishe with the fragment
     241        // Finish with the fragment
    242242        if ( $this->fragment ) {
    243243            $url .= '#' . $this->fragment;
  • nlingual/tags/2.10.0.1/includes/functions-compatibility.php

    r2244029 r3183922  
    11<?php
    22/**
    3  * nLingual Compatibilty Functions
     3 * nLingual Compatibility Functions
    44 *
    55 * @package nLingual
    6  * @subpackage Backwards_Compatibilty
     6 * @subpackage Backwards_Compatibility
    77 *
    88 * @since 2.0.0
     
    200200 *
    201201 * @param string $prefix Optional. A prefix to place before the links (should end with a space).
    202  * @param string $sep    Optioanl A separator to use when putting the links together.
    203  * @param bool   $skip_current Optional. Wether or not to leave out the link for the current language.
     202 * @param string $sep    Optional A separator to use when putting the links together.
     203 * @param bool   $skip_current Optional. Whether or not to leave out the link for the current language.
    204204 */
    205205function nL_print_lang_links( $prefix = '', $sep = ' ', $skip_current = false ) {
     
    225225 * @param mixed  $language  Optional. The language to get the matching version for (defaults to current).
    226226 * @param string $separator Optional. The separator to use when splitting the text (defaults to one defined under nLingual before 2.0.0).
    227  * @param bool   $force     Optional. Wether or not to force the split to happen instead of only when outside the admin.
     227 * @param bool   $force     Optional. Whether or not to force the split to happen instead of only when outside the admin.
    228228 *
    229229 * @return string The part of the text corresponding to the language desired.
  • nlingual/tags/2.10.0.1/includes/functions-nlingual.php

    r3168845 r3183922  
    2525 * @since 2.0.0
    2626 *
    27  * @return bool Wether or not this should be considered a "backend" request.
     27 * @return bool Whether or not this should be considered a "backend" request.
    2828 */
    2929function is_backend() {
     
    4949 * @since 2.4.0
    5050 *
    51  * @return bool Wether or not we're running on 4.6 or earlier.
     51 * @return bool Whether or not we're running on 4.6 or earlier.
    5252 */
    5353function is_patch_font_stack_needed() {
     
    162162 * @since 2.8.0
    163163 *
    164  * @return bool Wether or not this plugin is active.
     164 * @return bool Whether or not this plugin is active.
    165165 */
    166166function is_nlingual_active() {
  • nlingual/tags/2.10.0.1/includes/presets-languages.php

    r1896568 r3183922  
    142142    ),
    143143    'pt' => array(
    144         'system_name' => __( 'Portugese', 'nlingual' ),
     144        'system_name' => __( 'Portuguese', 'nlingual' ),
    145145        'native_name' => 'Português',
    146146        'short_name'  => 'Pt',
  • nlingual/tags/2.10.0.1/js/admin.js

    r2681436 r3183922  
    5656    jQuery( $ => {
    5757        // =========================
    58         // ! Setings Pages
     58        // ! Settings Pages
    5959        // =========================
    6060
     
    451451            tinymce.editors.forEach( localizeEditor );
    452452
    453             // Backwards compatiblity; catch any late-registered editors
     453            // Backwards compatibility; catch any late-registered editors
    454454            tinymce.on( 'SetupEditor', e => {
    455455                // TinyMCE 4.7 changes callback arg to event CONTAINING editor
     
    501501        } );
    502502
    503         // Create a new translation for the assocaited language
     503        // Create a new translation for the associated language
    504504        $( '.nl-add-translation' ).click( function() {
    505505            var $field                  = $( this ).parents( '.nl-field' );
  • nlingual/tags/2.10.0.1/languages/nlingual.pot

    r3168845 r3183922  
    12291229
    12301230#: includes/presets-languages.php:144
    1231 msgid "Portugese"
     1231msgid "Portuguese"
    12321232msgstr ""
    12331233
  • nlingual/tags/2.10.0.1/nlingual.php

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

    r3168847 r3183922  
    55Tested up to: 6.6.2
    66Requires PHP: 7.0.0
    7 Stable tag: 2.10.0
     7Stable tag: 2.10.0.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4444- Slug: the value to use when localizing a URL for the language (typically the same as the ISO code).
    4545- Text Direction: the text direction the language should be rendered in (Left-to-right or right-to-left). Will override the one specified in the text domain files.
    46 - Active State: wether or not to allow public access to content in the language.
     46- Active State: whether or not to allow public access to content in the language.
    4747
    4848= Flexible Language Detection/Switching =
     
    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.10.0.1 =
     83Fix display of translation links in posts screen.
     84
    8285= 2.10.0 =
    8386WP 6.6 and PHP 7 compatibility and API documentation improvements. Minor type check fixes and output escaping for edge cases.
  • nlingual/trunk/includes/abstract-nlingual-handler.php

    r3168845 r3183922  
    135135     *
    136136     * @param string $tag           The name of the filter to hook the $method to.
    137      * @param string $method        The name of the called classe's method to run when applied.
     137     * @param string $method        The name of the called class' method to run when applied.
    138138     * @param int    $priority      Optional. The priority to use for this particular callback.
    139139     * @param int    $accepted_args Optional. The number of arguments the callback accepts.
     
    175175     * @param string $tag          The name of the filter to remove from.
    176176     * @param string $method       The name of the called class' method to remove.
    177      * @param bool   $dont_disable Wether or not to skip flagging it at disabled.
     177     * @param bool   $dont_disable Whether or not to skip flagging it at disabled.
    178178     *
    179179     * @return bool|int The priority it originally had (false if wasn't added).
     
    216216     * @since 2.6.0
    217217     *
    218      * @param bool $force Wether or not to explicitly disable all hooks.
     218     * @param bool $force Whether or not to explicitly disable all hooks.
    219219     */
    220220    public static function remove_all_hooks( $disable = false ) {
     
    233233     * @param string $tag        The name of the filter to remove from.
    234234     * @param string $method     The name of the class' method to remove.
    235      * @param bool   $dont_force Wether or not to ignore a hook's disabled status.
     235     * @param bool   $dont_force Whether or not to ignore a hook's disabled status.
    236236     */
    237237    final public static function restore_hook( $tag, $method, $dont_force = false ) {
     
    255255     * @since 2.6.0
    256256     *
    257      * @param bool $force Wether or not to force-restore all hooks.
     257     * @param bool $force Whether or not to force-restore all hooks.
    258258     */
    259259    public static function restore_all_hooks( $force = false ) {
  • nlingual/trunk/includes/autoloader.php

    r1896568 r3183922  
    2222 * @param string $name The symbol name of the asset being requested.
    2323 *
    24  * @return bool Wether or not the file was found and loaded.
     24 * @return bool Whether or not the file was found and loaded.
    2525 */
    2626function find( $type, $name ) {
     
    4646 * Find/load an nLingual class.
    4747 *
    48  * Will automatically initailize if it's a Functional sub-class.
     48 * Will automatically initialize if it's a Functional sub-class.
    4949 *
    5050 * @internal
  • nlingual/trunk/includes/class-nlingual-backend.php

    r3168847 r3183922  
    1616 * Hooks into various backend systems to load
    1717 * custom assets, modify the interface, and
    18  * add language management to relevent screens.
     18 * add language management to relevant screens.
    1919 *
    2020 * @internal Used by the System.
     
    343343     */
    344344    private static function register_localized_locations( $type, $global ) {
    345         $list = $GLOBALS[ $global ];
     345        $list = $GLOBALS[ $global ] ?? array();
    346346
    347347        // Cache the old version of the menus for reference
     
    733733
    734734            /* translators: %1$s = The name of the language, %2$s = The title of the post, wrapped in a link */
    735             $links[] = esc_html( _fx( '%1$s: %2$s', 'language: title', 'nlingual', $other_language->system_name, $link ) );
     735            $links[] = _fx( '%1$s: %2$s', 'language: title', 'nlingual', $other_language->system_name, $link );
    736736        }
    737737        if ( $links ) {
     
    11621162            // And the post type supports translation
    11631163            && Registry::is_post_type_supported( $post->post_type )
    1164             // And the post type has syncronization rules specified
     1164            // And the post type has synchronization rules specified
    11651165            && Registry::get_post_sync_rules( $post->post_type )
    11661166            // And the post has sister translations
     
    12961296     *
    12971297     * @since 2.10.0 Add translator notes. Explicitly enqueue in header.
    1298      * @sicne 2.8.8 Add admin_post, for nl_new_translation call.
     1298     * @since 2.8.8 Add admin_post, for nl_new_translation call.
    12991299     * @since 2.6.0 Updated to use plugin version for CSS/JS files.
    13001300     * @since 2.0.0
     
    13271327
    13281328    /**
    1329      * Print relevent variables for JavaScript.
     1329     * Print relevant variables for JavaScript.
    13301330     *
    13311331     * @since 2.10.0 Use wp_json_encode().
     
    13521352
    13531353    /**
    1354      * Create a clone of the requested post in the requested lanuage.
     1354     * Create a clone of the requested post in the requested language.
    13551355     *
    13561356     * Will redirect to the edit screen for the new translation.
  • nlingual/trunk/includes/class-nlingual-documenter.php

    r2449432 r3183922  
    164164     * @uses Documenter::register_help_tab() to register each screen/tab.
    165165     *
    166      * @param string $screens An array of screen=>tab IDs to register.
     166     * @param array<string,string> $screens An array of screen=>tab IDs to register.
    167167     */
    168168    public static function register_help_tabs( $screens ) {
     
    177177
    178178    /**
    179      * Load the sepecified tab's file and return it's ID/title/content.
     179     * Load the specified tab's file and return it's ID/title/content.
    180180     *
    181181     * @since 2.0.0
  • nlingual/trunk/includes/class-nlingual-exception.php

    r3168845 r3183922  
    7272
    7373    /**
    74      * Ouput a string representation of the exception.
     74     * Output a string representation of the exception.
    7575     *
    7676     * @since 2.0.0
  • nlingual/trunk/includes/class-nlingual-frontend.php

    r3168847 r3183922  
    6868        self::add_hook( 'wp_nav_menu_objects', 'handle_language_links', 10, 1 );
    6969
    70         // General fitlering
     70        // General filtering
    7171        self::add_hook( 'body_class', 'add_body_classes', 10, 1 );
    7272        self::add_hook( 'option_page_on_front', 'current_language_post', 10, 1 );
     
    252252     * @param string $type       The type of location.
    253253     * @param array  $locations  The list of locations to filter.
    254      * @param array  $registered The list of orignially register locations.
     254     * @param array  $registered The list of originally register locations.
    255255     *
    256256     * @return array The modified $locations with unlocalized versions updated.
     
    360360         * @since 2.9.2
    361361         *
    362          * @param bool   $localize_items Wether or not to localize menu items.
     362         * @param bool   $localize_items Whether or not to localize menu items.
    363363         * @param object $menu           The menu being considered.
    364364         * @param array  $items          The items for the menu.
     
    695695        }
    696696
    697         // Replace with new isntance of patched one
     697        // Replace with new instance of patched one
    698698        $wp_locale = new Locale();
    699699    }
  • nlingual/trunk/includes/class-nlingual-installer.php

    r1896568 r3183922  
    7070     */
    7171    private static function plugin_security_check( $check_referer = null ) {
    72         // Make sure they have permisson
     72        // Make sure they have permission
    7373        if ( ! current_user_can( 'activate_plugins' ) ) {
    7474            return false;
     
    9292     * Test if the site previously used nLingual 1.
    9393     *
    94      * Tests for presense of old nLingual-options array.
    95      *
    96      * @since 2.0.0
    97      *
    98      * @return bool Wether or not we're upgrading.
     94     * Tests for presence of old nLingual-options array.
     95     *
     96     * @since 2.0.0
     97     *
     98     * @return bool Whether or not we're upgrading.
    9999     */
    100100    private static function is_upgrading() {
     
    305305     * @global \wpdb $wpdb The database abstraction class instance.
    306306     *
    307      * @return bool Wether or not an upgrade was performed.
     307     * @return bool Whether or not an upgrade was performed.
    308308     */
    309309    public static function upgrade() {
  • nlingual/trunk/includes/class-nlingual-language.php

    r2375574 r3183922  
    169169     *     @option string "iso_code"    The ISO 639-1 code for the language.
    170170     *     @option string "direction"   The text direction of the language (ltr or rtl).
    171      *     @option int    "list_order"  The disired order of the language.
     171     *     @option int    "list_order"  The desired order of the language.
    172172     */
    173173    public function __construct( $values ) {
  • nlingual/trunk/includes/class-nlingual-languages.php

    r3168845 r3183922  
    126126     * @since 2.0.0
    127127     *
    128      * @return bool Wether or not the position is valid.
     128     * @return bool Whether or not the position is valid.
    129129     */
    130130    public function valid() {
     
    321321     *
    322322     * @param array|Language $language The language to add.
    323      * @param bool           $sort     Wether or not to sort after adding.
     323     * @param bool           $sort     Whether or not to sort after adding.
    324324     *
    325325     * @return self.
     
    387387     *
    388388     * @since 2.9.1 Drop checking of locale/ISO for match.
    389      * @sicne 2.2.0 Changed to check all locales before checking ISO codes.
     389     * @since 2.2.0 Changed to check all locales before checking ISO codes.
    390390     * @since 2.0.0
    391391     *
  • nlingual/trunk/includes/class-nlingual-liaison.php

    r3168847 r3183922  
    421421     * @param \WP_Query $query     The query being modified.
    422422     *
    423      * @return mixed The default language ot use.
     423     * @return mixed The default language to use.
    424424     */
    425425    public static function quickstart_order_manager_language( $pre_value, $query ) {
     
    601601     */
    602602    public static function indexpages_filter_pages_for_dropdown( $pages, $args ) {
    603         // Bail if pages are not supported for tranlsation
     603        // Bail if pages are not supported for translation
    604604        if ( ! Registry::is_post_type_supported( 'page' ) ) {
    605605            return $pages;
     
    680680
    681681    /**
    682      * Check if certian SEO plugins are active, setup necessary helpers.
     682     * Check if certain SEO plugins are active, setup necessary helpers.
    683683     *
    684684     * @since 2.9.1
  • nlingual/trunk/includes/class-nlingual-localizer-field.php

    r2375574 r3183922  
    9494
    9595    /**
    96      * Wether or not to ignore the fallback when the localized value is empty.
     96     * Whether or not to ignore the fallback when the localized value is empty.
    9797     *
    9898     * @since 2.6.0
  • nlingual/trunk/includes/class-nlingual-localizer.php

    r3168847 r3183922  
    120120
    121121    /**
    122      * Registry of objects whos localized data has been preloaded.
     122     * Registry of objects whose localized data has been preloaded.
    123123     *
    124124     * @internal
     
    153153     * @param string|array $ids The ID (or list of IDs to try) of the field to retrieve.
    154154     *
    155      * @return Localizer_Field|bool The retreived field, FALSE on failure.
     155     * @return Localizer_Field|bool The retrieved field, FALSE on failure.
    156156     */
    157157    public static function get_field( $ids ) {
     
    511511     * @param string|array $id          The ID (or possible IDs) of the field, or a key to search for.
    512512     * @param int          $language_id The language ID to match.
    513      * @param int          $object_id   The object ID if relevent (otherwise 0).
     513     * @param int          $object_id   The object ID if relevant (otherwise 0).
    514514     * @param string       $fallback    Optional. A fallback to use if the result is empty/null.
    515      * @param bool         $check_reg   Optional. Wether or not to check if the field is regsitered before fetching (default TRUE).
     515     * @param bool         $check_reg   Optional. Whether or not to check if the field is registered before fetching (default TRUE).
    516516     *
    517517     * @return field|bool The localized version, false if nothing found.
     
    565565     *
    566566     * @param string $key       The field key to search for.
    567      * @param int    $object_id Optional. The object ID if relevent (otherwise 0).
    568      * @param bool   $check_reg Optional. Wether or not to check if the field is regsitered before fetching (default TRUE).
     567     * @param int    $object_id Optional. The object ID if relevant (otherwise 0).
     568     * @param bool   $check_reg Optional. Whether or not to check if the field is registered before fetching (default TRUE).
    569569     *
    570570     * @return array The localized versions of the specified field.
     
    611611     * @param string $key         The field key to search for.
    612612     * @param int    $language_id The language ID to save for.
    613      * @param int    $object_id   The object ID if relevent (otherwise 0).
     613     * @param int    $object_id   The object ID if relevant (otherwise 0).
    614614     * @param string $value       The localized value of the field.
    615      * @param bool   $check_reg   Optional. Wether or not to check if the field is regsitered before fetching (default TRUE).
     615     * @param bool   $check_reg   Optional. Whether or not to check if the field is registered before fetching (default TRUE).
    616616     */
    617617    public static function save_field_value( $key, $language_id, $object_id, $value, $check_reg = true ) {
     
    857857            $term_object = \WP_Term::get_instance( $term_id ); // Get the raw term
    858858
    859             // If the term can be retrieved, localize the name, falling back if applicalbe
     859            // If the term can be retrieved, localize the name, falling back if applicable
    860860            if ( $term_object ) {
    861861                $term = self::get_field_value( "term.{$term_object->taxonomy}:term_name", $language->id, $term_id, $term );
     
    880880
    881881        if ( $args['fields'] == 'names' ) {
    882             // Chanage to id=>names, will convert back later
     882            // Change to id=>names, will convert back later
    883883            $args['fields'] = 'id=>name';
    884884
     
    938938     */
    939939    public static function update_unlocalized_term_fields( $term_id, $tt_id, $taxonomy ) {
    940         // Get the udpated term, since we aren't provided with the updated values
     940        // Get the updated term, since we aren't provided with the updated values
    941941        $term = get_term( $term_id, $taxonomy );
    942942
     
    980980        }
    981981
    982         // Determin object ID to use
     982        // Determine object ID to use
    983983        $object_id_keys = array(
    984984            'post.php'      => 'post_ID',
     
    10681068        }
    10691069
    1070         // Determin object ID to use
     1070        // Determine object ID to use
    10711071        $object_id_keys = array(
    10721072            'post'      => 'post',
  • nlingual/trunk/includes/class-nlingual-manager.php

    r3168847 r3183922  
    11<?php
    22/**
    3  * nLingual Management Funtionality
     3 * nLingual Management Functionality
    44 *
    55 * @package nLingual
     
    8383            array( __CLASS__, 'settings_page' ), // callback
    8484            'dashicons-translation', // icon
    85             90 // Postion; after settings
     85            90 // Position; after settings
    8686        );
    8787
     
    242242            }
    243243
    244             // Default text direction to ltr if not set, rtl if not explictly ltr
     244            // Default text direction to ltr if not set, rtl if not explicitly ltr
    245245            $entry['direction'] = 'ltr';
    246246            if ( isset( $language['direction'] ) && $language['direction'] != 'ltr' ) {
  • nlingual/trunk/includes/class-nlingual-registry.php

    r3168847 r3183922  
    242242     * Check if an option is supported.
    243243     *
    244      * Will also udpate the option value if it was deprecated
     244     * Will also update the option value if it was deprecated
    245245     * but has a sufficient alternative.
    246246     *
     
    250250     * @param string &$option The option name.
    251251     *
    252      * @return bool Wether or not the option is supported.
     252     * @return bool Whether or not the option is supported.
    253253     */
    254254    public static function has( &$option ) {
     
    280280        // Check if it's set, return it's value.
    281281        if ( isset( self::$options[ $option ] ) ) {
    282             // Check if it's been overriden, use that unless otherwise requested
     282            // Check if it's been overridden, use that unless otherwise requested
    283283            $has_override = isset( self::$options_override[ $option ] );
    284284            if ( $has_override && ! $true_value ) {
     
    376376     * @since 2.0.0
    377377     *
    378      * @uses Registry::get() to retrive the appropriate rules array.
     378     * @uses Registry::get() to retrieve the appropriate rules array.
    379379     *
    380380     * @param string $rule_type   The type of rules to retrieve ('sync' or 'clone').
     
    446446     *
    447447     * @param mixed $language The desired language.
    448      * @param bool  $lock     Wether or not to lock the selection.
    449      * @param bool  $override Wether or not to override the lock.
     448     * @param bool  $lock     Whether or not to lock the selection.
     449     * @param bool  $override Whether or not to override the lock.
    450450     *
    451451     * @throws Exception If the language specified does not exist.
    452452     *
    453      * @return bool Wether or not the language could be changed.
     453     * @return bool Whether or not the language could be changed.
    454454     */
    455455    public static function set_language( $language, $lock = false, $override = false ) {
     
    557557     * @param mixed $language2 The language to compare against.
    558558     *
    559      * @return bool The result of the comparision.
     559     * @return bool The result of the comparison.
    560560     */
    561561    public static function compare_languages( $language1, $language2 ) {
     
    626626     * @param string $location Optional. The ID of a specific location to check.
    627627     *
    628      * @return bool Wether or not the location is localizable.
     628     * @return bool Whether or not the location is localizable.
    629629     */
    630630    public static function is_location_supported( $type, $location = null ) {
     
    670670     *
    671671     * @param string|array $post_types  The post type(s) to check.
    672      * @param bool         $require_all Optional. Wether or not to ensure ALL are supported.
    673      *
    674      * @return bool Wether or not the post type(s) are supported.
     672     * @param bool         $require_all Optional. Whether or not to ensure ALL are supported.
     673     *
     674     * @return bool Whether or not the post type(s) are supported.
    675675     */
    676676    public static function is_post_type_supported( $post_types, $require_all = false ) {
     
    709709     * @param string|array $taxonomies The taxonomy(ies) to check.
    710710     *
    711      * @return bool Wether or not the taxonomy(ies) are supported.
     711     * @return bool Whether or not the taxonomy(ies) are supported.
    712712     */
    713713    public static function is_taxonomy_supported( $taxonomies ) {
     
    739739     * @global \WP_Rewrite $wp_rewrite The WordPress rewrite API.
    740740     *
    741      * @return bool Wether or not rewriting can be used.
     741     * @return bool Whether or not rewriting can be used.
    742742     */
    743743    public static function can_use_rewrites() {
     
    759759     * This setting applies if:
    760760     * - it's enabled
    761      * - the default langauge is requested
     761     * - the default language is requested
    762762     * - the accepted language doesn't match
    763763     *   another available language
     
    767767     * @param mixed $language The language to compare.
    768768     *
    769      * @return bool Wether or not the skip_default_l10n rule applies.
     769     * @return bool Whether or not the skip_default_l10n rule applies.
    770770     */
    771771    public static function does_skip_default_l10n_apply( $language ) {
  • nlingual/trunk/includes/class-nlingual-rewriter.php

    r3168847 r3183922  
    2626
    2727    /**
    28      * Internal flag for wether or not to localize a URL.
     28     * Internal flag for whether or not to localize a URL.
    2929     *
    3030     * @internal
     
    105105     *
    106106     * @param string|array $url_data        Optional. The URL string or parsed array to process.
    107      * @param bool         $return_language Optional. Wether or not to return just the language.
     107     * @param bool         $return_language Optional. Whether or not to return just the language.
    108108     *
    109109     * @return URL The parsed and processed URL object.
     
    217217     *
    218218     * @since 2.10.0 Use wp_parse_url().
    219      * @since 2.9.1 Adjust URL building and trainling slash handling.
     219     * @since 2.9.1 Adjust URL building and trailing slash handling.
    220220     * @since 2.9.0 Use does_skip_default_l10n_apply() to handle default URL localization logic,
    221221     *              Added $force_localize to allow overriding skip_default_l10n even if it applies.
     
    232232     * @param string $url            The URL to parse.
    233233     * @param mixed  $language       Optional. The desired language to localize to.
    234      * @param bool   $force_localize Optional. Wether or not to ignore skip_default_l10n.
     234     * @param bool   $force_localize Optional. Whether or not to ignore skip_default_l10n.
    235235     *
    236236     * @throws Exception If the language requested does not exist.
     
    256256
    257257        /**
    258          * Filter wether or not to localize the URL.
     258         * Filter whether or not to localize the URL.
    259259         *
    260260         * @since 2.8.4 Dropped $relocalize param.
     
    305305
    306306            // If it's not a wordpress internal URL,
    307             // AND skip_defalt_l10n does not apply,
     307            // AND skip_default_l10n does not apply,
    308308            // Go ahead and localize the URL
    309309            if ( ! preg_match( '#^/wp-([\w-]+.php|(admin|content|includes)/)#', $the_url->path )
     
    494494                unset( $_GET['s'] );
    495495            }
    496             // Give up and just get the orginally requested URL, relocalized
     496            // Give up and just get the originally requested URL, relocalized
    497497            else {
    498498                $url = self::localize_url( NL_ORIGINAL_URL, null );
     
    612612     * @uses Rewriter::localize_here() to get each URL.
    613613     *
    614      * @param bool   $skip_current Wether or not to skip the current language.
     614     * @param bool   $skip_current Whether or not to skip the current language.
    615615     * @param string $index_by     What language property to use for the array index (typically id or slug).
    616616     *
  • nlingual/trunk/includes/class-nlingual-settings.php

    r3168847 r3183922  
    108108
    109109    /**
    110      * Given an array, extract the disired value defined like so: myvar[mykey][0].
     110     * Given an array, extract the desired value defined like so: myvar[mykey][0].
    111111     *
    112112     * @since 2.0.0
     
    149149     * Retrieve the settings value.
    150150     *
    151      * Handles names like option[suboption][] appropraitely.
     151     * Handles names like option[suboption][] appropriately.
    152152     *
    153153     * @since 2.0.0
     
    191191     *     @option mixed  "data" Optional. data for the field.
    192192     *     @option string "help" Optional. Help text.
    193      * @param mixed $value Optional. A specifi value to use
     193     * @param mixed $value Optional. A specific value to use
    194194     *                     instead of dynamically retrieving it.
    195195     */
     
    229229
    230230        if ( $args['help'] ) {
    231             // Wrap $html in lable with help text if checkbox or radio
     231            // Wrap $html in label with help text if checkbox or radio
    232232            if ( $args['type'] == 'checkbox' || $args['type'] == 'radio' ) {
    233233                $html = sprintf( '<label>%s %s</label>', $html, $args['help'] );
  • nlingual/trunk/includes/class-nlingual-system.php

    r3168845 r3183922  
    189189     *
    190190     * @param mixed $language           The language object, slug or id.
    191      * @param bool  $reload_textdomains Wether or not to reload text domains.
     191     * @param bool  $reload_textdomains Whether or not to reload text domains.
    192192     */
    193193    public static function switch_language( $language, $reload_textdomains = false ) {
     
    423423
    424424            /**
    425              * @todo figure out handling of switching langauge within switching blog
     425             * @todo figure out handling of switching language within switching blog
    426426             */
    427427
     
    469469     * @uses Rewriter::process_url() to parse the current page URL.
    470470     * @uses Registry::does_skip_default_l10n_apply() to see if the default language URL should be unlocalized.
    471      * @uses Registry::accepted_language() to determine a perferred language.
     471     * @uses Registry::accepted_language() to determine a preferred language.
    472472     * @uses Registry::set_language() to tentatively apply the detected language.
    473473     */
     
    667667     * Flag a post being (un)trashed.
    668668     *
    669      * This is to prevent syncronize_post() from proceeding.
     669     * This is to prevent synchronize_post() from proceeding.
    670670     *
    671671     * @since 2.6.0
     
    836836        }
    837837
    838         // If the languge was detected via URL and we're still parsing the request, force localization
     838        // If the language was detected via URL and we're still parsing the request, force localization
    839839        $force_localize = defined( 'NL_DETECTED_SOURCE' ) && NL_DETECTED_SOURCE == 'url' && ! did_action( 'parse_request' );
    840840
     
    11121112        }
    11131113
    1114         // If in the backend, or language is not required, add 0 to retreive language-less posts too
     1114        // If in the backend, or language is not required, add 0 to retrieve language-less posts too
    11151115        if ( is_backend() || ! Registry::get( 'language_is_required' ) ) {
    11161116            $value[] = '0';
     
    11981198        $requested_languages = (array) $query_vars[ $query_var ];
    11991199
    1200         // Get the available languages for valiation purposes
     1200        // Get the available languages for validation purposes
    12011201        $all_languages = Registry::languages();
    12021202
     
    12461246     * @uses Registry::get() to retrieve the show_all_languages option.
    12471247     * @uses Registry::languages() to check/get the matching language object.
    1248      * @uses Registry::current_language() as the default language to fitler by.
     1248     * @uses Registry::current_language() as the default language to filter by.
    12491249     * @uses Translator::get_post_language() to get the translation in that language.
    12501250     *
    12511251     * @param array $pages The list of pages to filter.
    1252      * @param array $args  The arugments passed to get_pages().
     1252     * @param array $args  The arguments passed to get_pages().
    12531253     *
    12541254     * @return array The filtered list of pages.
  • nlingual/trunk/includes/class-nlingual-translator.php

    r3168847 r3183922  
    2424 * @method static bool|Language get_post_language( int|\WP_Post $post, bool $true_value = false ) get a post's language.
    2525 * @method static bool|Language get_term_language( int|\WP_Term $term, bool $true_value = false ) get a term's language.
    26  * @method static bool          set_post_language( int|\WP_Post $post, mixed $langauge )          set a post's language.
    27  * @method static bool          set_term_language( int|\WP_Term $term, mixed $langauge )          set a term's language.
     26 * @method static bool          set_post_language( int|\WP_Post $post, mixed $language )          set a post's language.
     27 * @method static bool          set_term_language( int|\WP_Term $term, mixed $language )          set a term's language.
    2828 * @method static bool          delete_post_language( int|\WP_Post $post )                        delete a post's language.
    2929 * @method static bool          delete_term_language( int|\WP_Term $term )                        delete a term's language.
     
    215215     * @param string $object_type The type of object.
    216216     * @param int    $object_id   The ID of the object.
    217      * @param bool   $true_value  Wether or not to bypass language_is_requried fallback.
     217     * @param bool   $true_value  Whether or not to bypass language_is_required fallback.
    218218     *
    219219     * @return bool|Language The language of the object (false if not found).
     
    451451     * any of the languages listed aren't valid.
    452452     *
    453      * @since 2.10.0 Fix doucmentation on $translations.
     453     * @since 2.10.0 Fix documentation on $translations.
    454454     * @since 2.6.0 Now flushes cache for translations as well as target object.
    455455     * @since 2.0.0
     
    468468     * @throws Exception If the language specified does not exist.
    469469     *
    470      * @param bool Wether or not the association could be done (false if aborted).
     470     * @param bool Whether or not the association could be done (false if aborted).
    471471     */
    472472    public static function set_object_translations( $object_type, $object_id, $translations ) {
     
    543543     * @throws Exception If the language specified does not exist.
    544544     *
    545      * @param bool Wether or not the association could be done.
     545     * @param bool Whether or not the association could be done.
    546546     */
    547547    public static function set_object_translation( $object_type, $object_id, $language, $target_id ) {
     
    576576     * @throws Exception If the language specified does not exist.
    577577     *
    578      * @return bool Wether or not a deletion was performed (false = nothing to delete).
     578     * @return bool Whether or not a deletion was performed (false = nothing to delete).
    579579     */
    580580    public static function delete_object_translation( $object_type, $object_id, $language ) {
  • nlingual/trunk/includes/class-nlingual-url.php

    r3168847 r3183922  
    148148        // If not an array, throw an exception
    149149        elseif ( ! is_array( $url_data ) ) {
    150             throw new Exception( __CLASS__ . '::parse() expects a string or array, recieved ' . gettype( $url_data ), NL_ERR_UNSUPPORTED );
     150            throw new Exception( __CLASS__ . '::parse() expects a string or array, received ' . gettype( $url_data ), NL_ERR_UNSUPPORTED );
    151151        }
    152152
     
    239239        }
    240240
    241         // Finishe with the fragment
     241        // Finish with the fragment
    242242        if ( $this->fragment ) {
    243243            $url .= '#' . $this->fragment;
  • nlingual/trunk/includes/functions-compatibility.php

    r2244029 r3183922  
    11<?php
    22/**
    3  * nLingual Compatibilty Functions
     3 * nLingual Compatibility Functions
    44 *
    55 * @package nLingual
    6  * @subpackage Backwards_Compatibilty
     6 * @subpackage Backwards_Compatibility
    77 *
    88 * @since 2.0.0
     
    200200 *
    201201 * @param string $prefix Optional. A prefix to place before the links (should end with a space).
    202  * @param string $sep    Optioanl A separator to use when putting the links together.
    203  * @param bool   $skip_current Optional. Wether or not to leave out the link for the current language.
     202 * @param string $sep    Optional A separator to use when putting the links together.
     203 * @param bool   $skip_current Optional. Whether or not to leave out the link for the current language.
    204204 */
    205205function nL_print_lang_links( $prefix = '', $sep = ' ', $skip_current = false ) {
     
    225225 * @param mixed  $language  Optional. The language to get the matching version for (defaults to current).
    226226 * @param string $separator Optional. The separator to use when splitting the text (defaults to one defined under nLingual before 2.0.0).
    227  * @param bool   $force     Optional. Wether or not to force the split to happen instead of only when outside the admin.
     227 * @param bool   $force     Optional. Whether or not to force the split to happen instead of only when outside the admin.
    228228 *
    229229 * @return string The part of the text corresponding to the language desired.
  • nlingual/trunk/includes/functions-nlingual.php

    r3168845 r3183922  
    2525 * @since 2.0.0
    2626 *
    27  * @return bool Wether or not this should be considered a "backend" request.
     27 * @return bool Whether or not this should be considered a "backend" request.
    2828 */
    2929function is_backend() {
     
    4949 * @since 2.4.0
    5050 *
    51  * @return bool Wether or not we're running on 4.6 or earlier.
     51 * @return bool Whether or not we're running on 4.6 or earlier.
    5252 */
    5353function is_patch_font_stack_needed() {
     
    162162 * @since 2.8.0
    163163 *
    164  * @return bool Wether or not this plugin is active.
     164 * @return bool Whether or not this plugin is active.
    165165 */
    166166function is_nlingual_active() {
  • nlingual/trunk/includes/presets-languages.php

    r1896568 r3183922  
    142142    ),
    143143    'pt' => array(
    144         'system_name' => __( 'Portugese', 'nlingual' ),
     144        'system_name' => __( 'Portuguese', 'nlingual' ),
    145145        'native_name' => 'Português',
    146146        'short_name'  => 'Pt',
  • nlingual/trunk/js/admin.js

    r2681436 r3183922  
    5656    jQuery( $ => {
    5757        // =========================
    58         // ! Setings Pages
     58        // ! Settings Pages
    5959        // =========================
    6060
     
    451451            tinymce.editors.forEach( localizeEditor );
    452452
    453             // Backwards compatiblity; catch any late-registered editors
     453            // Backwards compatibility; catch any late-registered editors
    454454            tinymce.on( 'SetupEditor', e => {
    455455                // TinyMCE 4.7 changes callback arg to event CONTAINING editor
     
    501501        } );
    502502
    503         // Create a new translation for the assocaited language
     503        // Create a new translation for the associated language
    504504        $( '.nl-add-translation' ).click( function() {
    505505            var $field                  = $( this ).parents( '.nl-field' );
  • nlingual/trunk/languages/nlingual.pot

    r3168845 r3183922  
    12291229
    12301230#: includes/presets-languages.php:144
    1231 msgid "Portugese"
     1231msgid "Portuguese"
    12321232msgstr ""
    12331233
  • nlingual/trunk/nlingual.php

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

    r3168847 r3183922  
    55Tested up to: 6.6.2
    66Requires PHP: 7.0.0
    7 Stable tag: 2.10.0
     7Stable tag: 2.10.0.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4444- Slug: the value to use when localizing a URL for the language (typically the same as the ISO code).
    4545- Text Direction: the text direction the language should be rendered in (Left-to-right or right-to-left). Will override the one specified in the text domain files.
    46 - Active State: wether or not to allow public access to content in the language.
     46- Active State: whether or not to allow public access to content in the language.
    4747
    4848= Flexible Language Detection/Switching =
     
    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.10.0.1 =
     83Fix display of translation links in posts screen.
     84
    8285= 2.10.0 =
    8386WP 6.6 and PHP 7 compatibility and API documentation improvements. Minor type check fixes and output escaping for edge cases.
Note: See TracChangeset for help on using the changeset viewer.