HEX
Server: Apache
System: Linux hvh16.mirohost.net 6.14.0-29-generic #29~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Aug 14 16:52:50 UTC 2 x86_64
User: likoholding (1037)
PHP: 7.3.33-25+0~20250707.133+debian12~1.gbp70fb14
Disabled: apache_child_terminate, dl, exec, imap_body, imap_createmailbox, imap_deletemailbox, imap_list, imap_open, imap_renamemailbox, inject_code, mb_send_mail, passthru, pcntl_alarm, pcntl_async_signals, pcntl_errno, pcntl_exec, pcntl_fork, pcntl_get_last_error, pcntl_getpriority, pcntl_setpriority, pcntl_signal, pcntl_signal_dispatch, pcntl_signal_get_handler, pcntl_sigprocmask, pcntl_sigtimedwait, pcntl_sigwaitinfo, pcntl_strerror, pcntl_wait, pcntl_waitpid, pcntl_wexitstatus, pcntl_wifcontinued, pcntl_wifexited, pcntl_wifsignaled, pcntl_wifstopped, pcntl_wstopsig, pcntl_wtermsig, popen, posix_getpwuid, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, proc_close, proc_get_status, proc_nice, proc_open, proc_terminate, set_time_limit, shell_exec, symlink, system
Upload Files
File: /var/www/likoholding/liko-holding.com.ua/wp-content/plugins/polylang-pro/modules/plugins/cpac.php
<?php

/**
 * Manages compatibility with Admin Columns
 * Version tested: 3.2.3
 *
 * @since 2.4
 */
class PLL_CPAC {

	/**
	 * Add filters
	 *
	 * @since 2.4
	 */
	public function init() {
		foreach ( PLL()->model->get_translated_post_types() as $type ) {
			if ( isset( $_REQUEST['list_screen'] ) ) {
				$filter = 'manage_' . ( 'attachment' == $type ? 'upload' : 'edit-' . $type ) . '_columns';
				add_filter( $filter, array( $this, 'remove_filter_lang' ), 90 ); // Before Polylang
			}

			$filter = 'option_cpac_options_' . ( 'attachment' == $type ? 'wp-media' : $type ) . '__default';
			add_filter( $filter, array( $this, 'filter_default_columns' ) );
		}
	}

	/**
	 * Deactivates the admin language filter on Admin Columns settings page
	 *
	 * @since 2.4
	 *
	 * @param array $columns List of table columns
	 * @return array
	 */
	public function remove_filter_lang( $columns ) {
		PLL()->filters_columns->filter_lang = '';
		return $columns;
	}

	/**
	 * Fix the Polylang columns in default columns
	 *
	 * @since 2.4
	 *
	 * @param array $columns List of table columns
	 * @return array
	 */
	public function filter_default_columns( $columns ) {
		$screen = get_current_screen();

		if ( isset( $screen->base ) ) {
			$is_post_type = 'edit' === $screen->base && has_filter( 'manage_edit-' . $screen->post_type . '_columns', array( PLL()->filters_columns, 'add_post_column' ) );
			$is_media     = 'upload' === $screen->base && has_filter( 'manage_upload_columns', array( PLL()->filters_columns, 'add_post_column' ) );

			if ( $is_post_type || $is_media ) {
				foreach ( pll_languages_list() as $lang ) {
					unset( $columns[ 'language_' . $lang ] );
				}

				$columns = PLL()->filters_columns->add_post_column( $columns );
			}
		}

		return $columns;
	}
}