HEX
Server: Apache
System: Linux s1 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: gerold (1018)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals
Upload Files
File: /home/max/virus/wpml-media-translation/classes/menus/wpml-media-screen-options-factory.php
<?php

/**
 * Class WPML_Media_Screen_Options_Factory
 */
class WPML_Media_Screen_Options_Factory implements IWPML_Backend_Action_Loader {

	/**
	 * @return IWPML_Action|WPML_Media_Screen_Options
	 */
	public function create() {

		$options = array();

		if ( $this->is_translation_dashboard() ) {

			$option_name = 'wpml_media_translation_dashboard_items_per_page';
			$options[]   = array(
				'key'  => 'per_page',
				'args' => array(
					'label'   => __( 'Number of items per page:', 'wpml-media' ),
					'default' => get_option( $option_name, 20 ),
					'option'  => $option_name,
				),
			);

		}

		if ( $options ) {
			return new WPML_Media_Screen_Options( $options );
		}

		return null;

	}

	/**
	 * @return bool
	 */
	private function is_translation_dashboard() {
		return ! isset( $_GET['sm'] ) || 'media-translation' === $_GET['sm'];
	}

}