HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux wordpress-ubuntu-s-2vcpu-4gb-fra1-01 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64
User: root (0)
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,pcntl_unshare,
Upload Files
File: /var/www/zaklada/wp-content/plugins/acfml/classes/strategy/repeater-shuffle/post.php
<?php

namespace ACFML\Repeater\Shuffle;

class Post extends Strategy {
	/**
	 * @var string
	 */
	protected $id_prefix = '';

	/**
	 * @param mixed $id
	 *
	 * @return bool
	 */
	public function isValidId( $id ) {
		return is_numeric( $id ) && $id > 0;
	}

	/**
	 * Get value object for given post ID.
	 *
	 * @param  int $id The post ID
	 *
	 * @return object|null Value object with id and type or null when element not found.
	 */
	protected function getElement( $id ) {
		if ( $this->isValidId( $id ) ) {
			return (object) [
				'id'   => $id,
				'type' => get_post_type( $id ),
			];
		}
	}

	/**
	 * @param int $id
	 *
	 * @return mixed
	 */
	public function getAllMeta( $id ) {
		return get_post_meta( $id );
	}

	/**
	 * @param int $id
	 * @param string $key
	 * @param bool $single
	 *
	 * @return mixed
	 */
	public function getOneMeta( $id, $key, $single = true ) {
		return get_post_meta( $id, $key, $single );
	}

	/**
	 * @param int $id
	 * @param string $key
	 *
	 * @return mixed|void
	 */
	public function deleteOneMeta( $id, $key ) {
		delete_post_meta( $id, $key );
	}

	/**
	 * @param int $id
	 * @param string $key
	 * @param mixed $val
	 *
	 * @return mixed|void
	 */
	public function updateOneMeta( $id, $key, $val ) {
		update_post_meta( $id, $key, $val );
	}

	/**
	 * @param $id
	 *
	 * @return mixed|void
	 */
	protected function get_element_type( $id ) {
		return apply_filters( 'wpml_element_type', get_post_type( $id ) );
	}
}