| Server IP : 27.254.66.5 / Your IP : 216.73.217.39 Web Server : Apache/2 System : Linux cs82.hostneverdie.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64 User : technic2 ( 1951) PHP Version : 7.4.30 Disable Function : apache_child_terminate, apache_setenv, define_syslog_variables, escapeshellarg, escapeshellcmd,exec, fp, fput, highlight_file, ini_alter, ini_restore, inject_code, passthru,phpAds_remoteInfo, phpAds_XmlRpc,phpAds_xmlrpcDecode, phpAds_xmlrpcEncode, popen, posix_getpwuid, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid,posix_setuid, posix_setuid, posix_uname,proc_open,proc_close, proc_get_status, proc_nice, proc_terminate, shell_exec, syslog, system, xmlrpc_entity_decode, show_source,sleep,pcntl_exec,virtual,suexec,dbmopen,dl,symlink,disk_free_space,diskfreespace,leak MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/technic2/public_html/old-website/wp-content/plugins/polylang/modules/sync/ |
Upload File : |
<?php
/**
* Settings class for synchronization settings management
*
* @since 1.8
*/
class PLL_Settings_Sync extends PLL_Settings_Module {
/**
* Constructor
*
* @since 1.8
*
* @param object $polylang polylang object
*/
public function __construct( &$polylang ) {
parent::__construct( $polylang, array(
'module' => 'sync',
'title' => __( 'Synchronization', 'polylang' ),
'description' => __( 'The synchronization options allow to maintain exact same values (or translations in the case of taxonomies and page parent) of meta content between the translations of a post or page.', 'polylang' ),
) );
}
/**
* Deactivates the module
*
* @since 1.8
*/
public function deactivate() {
$this->options['sync'] = array();
update_option( 'polylang', $this->options );
}
/**
* Displays the settings form
*
* @since 1.8
*/
protected function form() {
?>
<ul class="pll-inline-block-list">
<?php
foreach ( self::list_metas_to_sync() as $key => $str ) {
printf(
'<li><label><input name="sync[%s]" type="checkbox" value="1" %s /> %s</label></li>',
esc_attr( $key ),
in_array( $key, $this->options['sync'] ) ? 'checked="checked"' : '',
esc_html( $str )
);
}
?>
</ul>
<?php
}
/**
* Sanitizes the settings before saving
*
* @since 1.8
*
* @param array $options
*/
protected function update( $options ) {
$newoptions['sync'] = empty( $options['sync'] ) ? array() : array_keys( $options['sync'], 1 );
return $newoptions; // take care to return only validated options
}
/**
* Get the row actions
*
* @since 1.8
*
* @return array
*/
protected function get_actions() {
return empty( $this->options['sync'] ) ? array( 'configure' ) : array( 'configure', 'deactivate' );
}
/**
* List the post metas to synchronize
*
* @since 1.0
*
* @return array
*/
static public function list_metas_to_sync() {
return array(
'taxonomies' => __( 'Taxonomies', 'polylang' ),
'post_meta' => __( 'Custom fields', 'polylang' ),
'comment_status' => __( 'Comment status', 'polylang' ),
'ping_status' => __( 'Ping status', 'polylang' ),
'sticky_posts' => __( 'Sticky posts', 'polylang' ),
'post_date' => __( 'Published date', 'polylang' ),
'post_format' => __( 'Post format', 'polylang' ),
'post_parent' => __( 'Page parent', 'polylang' ),
'_wp_page_template' => __( 'Page template', 'polylang' ),
'menu_order' => __( 'Page order', 'polylang' ),
'_thumbnail_id' => __( 'Featured image', 'polylang' ),
);
}
}