/
home
/
techb158
/
on-time-movers.com
/
wp-content
/
plugins
/
polylang
/
src
/
/home/techb158/on-time-movers.com/wp-content/plugins/polylang/src
mkdir
upload
Name
Size
Mode
Actions
admin/
-
0755
rm
Capabilities/
-
0755
rm
frontend/
-
0755
rm
install/
-
0755
rm
integrations/
-
0755
rm
Model/
-
0755
rm
modules/
-
0755
rm
Options/
-
0755
rm
settings/
-
0755
rm
api.php
22291
0644
edit
dl
rm
base.php
6259
0644
edit
dl
rm
cache.php
2454
0644
edit
dl
rm
class-polylang.php
8537
0644
edit
dl
rm
constant-functions.php
1853
0644
edit
dl
rm
cookie.php
3104
0644
edit
dl
rm
crud-posts.php
15049
0644
edit
dl
rm
crud-terms.php
8962
0644
edit
dl
rm
default-term.php
6595
0644
edit
dl
rm
filter-rest-routes.php
5100
0644
edit
dl
rm
filters-links.php
5780
0644
edit
dl
rm
filters-sanitization.php
3311
0644
edit
dl
rm
filters-widgets-options.php
2697
0644
edit
dl
rm
filters.php
13248
0644
edit
dl
rm
format-util.php
3114
0644
edit
dl
rm
functions.php
5264
0644
edit
dl
rm
language-deprecated.php
7296
0644
edit
dl
rm
language-factory.php
9630
0644
edit
dl
rm
language.php
18502
0644
edit
dl
rm
license.php
9620
0644
edit
dl
rm
links-abstract-domain.php
3240
0644
edit
dl
rm
links-default.php
3100
0644
edit
dl
rm
links-directory.php
9726
0644
edit
dl
rm
links-domain.php
2980
0644
edit
dl
rm
links-model.php
6678
0644
edit
dl
rm
links-permalinks.php
5753
0644
edit
dl
rm
links-subdomain.php
2209
0644
edit
dl
rm
links.php
1415
0644
edit
dl
rm
mo.php
3504
0644
edit
dl
rm
model.php
23508
0644
edit
dl
rm
nav-menu.php
4609
0644
edit
dl
rm
olt-manager.php
3056
0644
edit
dl
rm
query.php
7913
0644
edit
dl
rm
rest-request.php
4325
0644
edit
dl
rm
static-pages.php
6418
0644
edit
dl
rm
switcher.php
11237
0644
edit
dl
rm
term-slug.php
5012
0644
edit
dl
rm
translatable-object-with-types-interface.php
1055
0644
edit
dl
rm
translatable-object-with-types-trait.php
2005
0644
edit
dl
rm
translatable-object.php
18042
0644
edit
dl
rm
translatable-objects.php
3799
0644
edit
dl
rm
translate-option.php
13417
0644
edit
dl
rm
translated-object.php
19388
0644
edit
dl
rm
translated-post.php
17586
0644
edit
dl
rm
translated-term.php
15171
0644
edit
dl
rm
walker-dropdown.php
3857
0644
edit
dl
rm
walker-list.php
2602
0644
edit
dl
rm
walker.php
2434
0644
edit
dl
rm
widget-calendar.php
11858
0644
edit
dl
rm
widget-languages.php
5466
0644
edit
dl
rm
Edit:
/home/techb158/on-time-movers.com/wp-content/plugins/polylang/src/term-slug.php
(5012B)
<?php /** * @package Polylang */ /** * Class for handling term slugs. * * @since 3.7 */ class PLL_Term_Slug { /** * @var PLL_Model */ private $model; /** * @var string */ private $slug; /** * @var string */ private $taxonomy; /** * @var string */ private $name; /** * @var int */ private $term_id; /** * @var PLL_Language */ private $lang; /** * @var int */ private $parent; /** * Constructor. * * @since 3.7 * * @param PLL_Model $model Instance of PLL_Model. * @param string $slug The term slug. * @param string $taxonomy The term taxonomy. * @param string $name The term name. * @param int $term_id The term ID if exists, or 0 if there's no need to know that we are editing an existing term. */ public function __construct( PLL_Model $model, string $slug, string $taxonomy, string $name, int $term_id = 0 ) { $this->model = $model; $this->slug = $slug; $this->taxonomy = $taxonomy; $this->name = $name; $this->term_id = $term_id; } /** * Tells if the suffix can be added or not. * * @since 3.7 * * @return bool True if the suffix can be added, false otherwise. */ private function can_add_suffix() { /** * Filters the subsequently inserted term language. * * @since 3.3 * * @param PLL_Language|null $lang Found language object, null otherwise. * @param string $taxonomy Term taxonomy. * @param string $slug Term slug. */ $lang = apply_filters( 'pll_inserted_term_language', null, $this->taxonomy, $this->slug ); if ( ! $lang instanceof PLL_Language ) { return false; } $this->lang = $lang; $this->parent = 0; if ( is_taxonomy_hierarchical( $this->taxonomy ) ) { /** * Filters the subsequently inserted term parent. * * @since 3.3 * * @param int $parent Parent term ID, 0 if none. * @param string $taxonomy Term taxonomy. * @param string $slug Term slug. */ $this->parent = apply_filters( 'pll_inserted_term_parent', 0, $this->taxonomy, $this->slug ); $this->slug .= $this->maybe_get_parent_suffix(); } if ( ! $this->slug ) { if ( $this->model->term_exists( $this->name, $this->taxonomy, $this->parent, $this->lang ) ) { // Returns the current empty slug if the term exists with the same name and an empty slug. // Same as WP does when providing a term with a name that already exists and no slug. return false; } else { $this->slug = sanitize_title( $this->name ); } } // Check if the slug exists globally, excluding the current term if we're editing. $args = array( 'slug' => $this->slug, 'taxonomy' => $this->taxonomy, 'hide_empty' => false, 'fields' => 'ids', 'lang' => '', // Disable Polylang language filter. 'update_term_meta_cache' => false, // Don't need term meta. ); $terms = get_terms( $args ); // Return true if the slug is already used by another term (excluding the term being edited). return is_array( $terms ) && ! empty( array_diff( $terms, array( $this->term_id ) ) ); } /** * Returns the parent suffix for the slug only if parent slug is the same as the given one. * Recursively appends the parents slugs like WordPress does. * * @since 3.3 * @since 3.7 Moved from `PLL_Share_Term_Slug` to `PLL_Term_Slug`. * * @return string Parents slugs if they are the same as the child slug, empty string otherwise. */ private function maybe_get_parent_suffix() { $parent_suffix = ''; $the_parent = get_term( $this->parent, $this->taxonomy ); if ( ! $the_parent instanceof WP_Term || $the_parent->slug !== $this->slug ) { return $parent_suffix; } /** * Mostly copied from {@see wp_unique_term_slug()}. */ while ( ! empty( $the_parent ) ) { $parent_term = get_term( $the_parent, $this->taxonomy ); if ( ! $parent_term instanceof WP_Term ) { break; } $parent_suffix .= '-' . $parent_term->slug; if ( ! term_exists( $this->slug . $parent_suffix ) ) { break; } $the_parent = $parent_term->parent; } return $parent_suffix; } /** * Returns the term slug, suffixed or not. * * @since 3.7 * * @param string $separator The separator for the slug suffix. * @return string The slug with or without suffix. */ public function get_suffixed_slug( string $separator ): string { if ( ! $this->can_add_suffix() ) { return $this->slug; } $term_id = (int) $this->model->term_exists_by_slug( $this->slug, $this->lang, $this->taxonomy, $this->parent ); // If no term exists in the given language with that slug, it can be created, or if we are editing the existing term. if ( ! $term_id || $this->term_id === $term_id ) { return $this->slug . $separator . $this->lang->slug; } // Different term exists in same language: no suffix, WordPress will handle uniqueness. return $this->slug; } }
Save
cmd:
run