HEX
HEX
Server: Apache
System: Linux localhost.localdomain 4.18.0-348.7.1.el8_5.x86_64 #1 SMP Wed Dec 22 13:25:12 UTC 2021 x86_64
User: www (1001)
PHP: 8.1.32
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,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_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/ahmsolaiman.com/wp-content/plugins/types/application/models/wordpress/media.php
<?php

/**
 * Class Types_Wordpress_Media
 *
 * @since 2.3
 */
class Types_Wordpress_Media implements Types_Wordpress_Media_Interface {

	/**
	 * @param string $url
	 *
	 * @return int|null
	 *
	 * @codeCoverageIgnore We test if the function exists, but nothing more as it's just an alias for a static method
	 */
	public function get_attachment_id_by_url( $url ) {
		return Toolset_Utils::get_attachment_id_by_url( $url );
	}


	/**
	 * @param int $id
	 *
	 * @return array|bool|null|WP_Post
	 */
	public function get_attachment_by_id( $id ) {
		$attachment = get_post( $id, ARRAY_A );

		if ( ! $attachment ) {
			return false;
		}

		$attachment['alt'] = get_post_meta( $attachment['ID'], '_wp_attachment_image_alt', true );

		return $attachment;
	}


	/**
	 * @param int|null $size If set it will return only the values of $size.
	 *     If $size is defined but not available, it will return false.
	 *
	 * @return false|array
	 */
	public function get_addtional_image_sizes( $size = null ) {
		global $_wp_additional_image_sizes;

		if ( $size === null ) {
			return $_wp_additional_image_sizes;
		}

		if ( isset( $_wp_additional_image_sizes[ $size ] ) ) {
			return $_wp_additional_image_sizes[ $size ];
		}

		return false;
	}
}