??????????????
??????????????
??????????????
??????????????
Warning : Undefined variable $auth in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
Warning : Trying to access array offset on value of type null in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
??????????????
??????????????
??????????????
??????????????
File Manager
✏️ Edit File: /home/mklsvubc/pgtankstorage.sg/wp-content/plugins/polylang/src/settings/settings-licenses.php
⬅ Kembali
<?php
/**
* @package Polylang
*/
/**
* Settings class for licenses
*
* @since 1.9
*/
class PLL_Settings_Licenses extends PLL_Settings_Module {
/**
* Stores the display order priority.
*
* @var int
*/
public $priority = 100;
/**
* Stores an array of objects allowing to manage a license.
*
* @var PLL_License[]
*/
protected $items;
/**
* Constructor
*
* @since 1.9
*
* @param PLL_Settings $polylang polylang object
*/
public function __construct( &$polylang ) {
parent::__construct(
$polylang,
array(
'module' => 'licenses',
'title' => __( 'License keys', 'polylang' ),
'description' => __( 'Manage licenses for Polylang Pro and add-ons.', 'polylang' ),
)
);
$this->buttons['cancel'] = sprintf( '<button type="button" class="button button-secondary cancel">%s</button>', __( 'Close', 'polylang' ) );
$this->items = apply_filters( 'pll_settings_licenses', array() );
add_action( 'wp_ajax_pll_deactivate_license', array( $this, 'deactivate_license' ) );
}
/**
* Tells if the module is active
*
* @since 1.9
*
* @return bool
*/
public function is_active() {
return ! empty( $this->items );
}
/**
* Displays the settings form
*
* @since 1.9
*/
protected function form() {
if ( ! empty( $this->items ) ) { ?>
<table id="pll-licenses-table" class="form-table pll-table-top">
<?php
foreach ( $this->items as $item ) {
echo $this->get_row( $item ); // phpcs:ignore WordPress.Security.EscapeOutput
}
?>
</table>
<?php
}
}
/**
* Get the html for a row (one per license key) for display.
*
* @since 1.9
*
* @param PLL_License $item Object allowing to manage a license.
* @return string
*/
protected function get_row( $item ) {
return $item->get_form_field();
}
/**
* Ajax method to save the license keys and activate the licenses at the same time
* Overrides parent's method
*
* @since 1.9
*/
public function save_options() {
check_ajax_referer( 'pll_options', '_pll_nonce' );
if ( ! current_user_can( 'manage_options' ) ) {
wp_die( -1 );
}
if ( isset( $_POST['module'] ) && $this->module === $_POST['module'] && ! empty( $_POST['licenses'] ) ) {
$x = new WP_Ajax_Response();
foreach ( $this->items as $item ) {
if ( ! empty( $_POST['licenses'][ $item->id ] ) ) {
$updated_item = $item->activate_license( sanitize_key( $_POST['licenses'][ $item->id ] ) );
$x->Add( array( 'what' => 'license-update', 'data' => $item->id, 'supplemental' => array( 'html' => $this->get_row( $updated_item ) ) ) );
}
}
// Updated message
pll_add_notice( new WP_Error( 'settings_updated', __( 'Settings saved.', 'polylang' ), 'success' ) );
ob_start();
settings_errors( 'polylang' );
$x->Add( array( 'what' => 'success', 'data' => ob_get_clean() ) );
$x->send();
}
}
/**
* Ajax method to deactivate a license
*
* @since 1.9
*
* @return void
*/
public function deactivate_license() {
check_ajax_referer( 'pll_options', '_pll_nonce' );
if ( ! current_user_can( 'manage_options' ) ) {
wp_die( -1 );
}
if ( ! isset( $_POST['id'] ) ) {
wp_die( 0 );
}
$id = substr( sanitize_text_field( wp_unslash( $_POST['id'] ) ), 11 );
wp_send_json(
array(
'id' => $id,
'html' => $this->get_row( $this->items[ $id ]->deactivate_license() ),
)
);
}
}
Nama
Tipe
Ukuran
Diubah
Aksi
🐘 flags.php
php
12 KB
2026-06-17 21:10
🐘 languages.php
php
32.2 KB
2026-06-17 21:10
🐘 settings-browser.php
php
3 KB
2026-06-17 21:10
🐘 settings-cpt.php
php
5.1 KB
2026-06-17 21:10
🐘 settings-licenses.php
php
3.3 KB
2026-06-17 21:10
🐘 settings-media.php
php
854 B
2026-06-17 21:10
🐘 settings-module.php
php
8.8 KB
2026-06-17 21:10
🐘 settings-url.php
php
8.1 KB
2026-06-17 21:10
🐘 settings.php
php
11.7 KB
2026-06-17 21:10
🐘 table-languages.php
php
8 KB
2026-06-17 21:10
🐘 table-settings.php
php
5 KB
2026-06-17 21:10
🐘 table-string.php
php
14 KB
2026-06-17 21:10
🐘 view-about.php
php
848 B
2026-06-17 21:10
🐘 view-languages.php
php
894 B
2026-06-17 21:10
🐘 view-tab-lang.php
php
6.3 KB
2026-06-17 21:10
🐘 view-tab-settings.php
php
387 B
2026-06-17 21:10
🐘 view-tab-strings.php
php
1.2 KB
2026-06-17 21:10