Current Path : /storage/v11800/affypharma/public_html/wp-includes/rest-api/endpoints/

Linux v11800 5.3.0-1023-aws #25~18.04.1-Ubuntu SMP Fri Jun 5 15:19:18 UTC 2020 aarch64

Upload File :
Current File : /storage/v11800/affypharma/public_html/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php
<?php
/**
 * REST API: WP_REST_Revisions_Controller class
 *
 * @package WordPress
 * @subpackage REST_API
 * @since 4.7.0
 */

/**
 * Core class used to access revisions via the REST API.
 *
 * @since 4.7.0
 *
 * @see WP_REST_Controller
 */
class WP_REST_Revisions_Controller extends WP_REST_Controller {

	/**
	 * Parent post type.
	 *
	 * @since 4.7.0
	 * @var string
	 */
	private $parent_post_type;

	/**
	 * Instance of a revision meta fields object.
	 *
	 * @since 6.4.0
	 * @var WP_REST_Post_Meta_Fields
	 */
	protected $meta;

	/**
	 * Parent controller.
	 *
	 * @since 4.7.0
	 * @var WP_REST_Controller
	 */
	private $parent_controller;

	/**
	 * The base of the parent controller's route.
	 *
	 * @since 4.7.0
	 * @var string
	 */
	private $parent_base;

	/**
	 * Constructor.
	 *
	 * @since 4.7.0
	 *
	 * @param string $parent_post_type Post type of the parent.
	 */
	public function __construct( $parent_post_type ) {
		$this->parent_post_type = $parent_post_type;
		$post_type_object       = get_post_type_object( $parent_post_type );
		$parent_controller      = $post_type_object->get_rest_controller();

		if ( ! $parent_controller ) {
			$parent_controller = new WP_REST_Posts_Controller( $parent_post_type );
		}

		$this->parent_controller = $parent_controller;
		$this->rest_base         = 'revisions';
		$this->parent_base       = ! empty( $post_type_object->rest_base ) ? $post_type_object->rest_base : $post_type_object->name;
		$this->namespace         = ! empty( $post_type_object->rest_namespace ) ? $post_type_object->rest_namespace : 'wp/v2';
		$this->meta              = new WP_REST_Post_Meta_Fields( $parent_post_type );
	}

	/**
	 * Registers the routes for revisions based on post types supporting revisions.
	 *
	 * @since 4.7.0
	 *
	 * @see register_rest_route()
	 */
	public function register_routes() {

		register_rest_route(
			$this->namespace,
			'/' . $this->parent_base . '/(?P<parent>[\d]+)/' . $this->rest_base,
			array(
				'args'   => array(
					'parent' => array(
						'description' => __( 'The ID for the parent of the revision.' ),
						'type'        => 'integer',
					),
				),
				array(
					'methods'             => WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_items' ),
					'permission_callback' => array( $this, 'get_items_permissions_check' ),
					'args'                => $this->get_collection_params(),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);

		register_rest_route(
			$this->namespace,
			'/' . $this->parent_base . '/(?P<parent>[\d]+)/' . $this->rest_base . '/(?P<id>[\d]+)',
			array(
				'args'   => array(
					'parent' => array(
						'description' => __( 'The ID for the parent of the revision.' ),
						'type'        => 'integer',
					),
					'id'     => array(
						'description' => __( 'Unique identifier for the revision.' ),
						'type'        => 'integer',
					),
				),
				array(
					'methods'             => WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_item' ),
					'permission_callback' => array( $this, 'get_item_permissions_check' ),
					'args'                => array(
						'context' => $this->get_context_param( array( 'default' => 'view' ) ),
					),
				),
				array(
					'methods'             => WP_REST_Server::DELETABLE,
					'callback'            => array( $this, 'delete_item' ),
					'permission_callback' => array( $this, 'delete_item_permissions_check' ),
					'args'                => array(
						'force' => array(
							'type'        => 'boolean',
							'default'     => false,
							'description' => __( 'Required to be true, as revisions do not support trashing.' ),
						),
					),
				),
				'schema' => array( $this, 'get_public_item_schema' ),
			)
		);
	}

	/**
	 * Get the parent post, if the ID is valid.
	 *
	 * @since 4.7.2
	 *
	 * @param int $parent_post_id Supplied ID.
	 * @return WP_Post|WP_Error Post object if ID is valid, WP_Error otherwise.
	 */
	protected function get_parent( $parent_post_id ) {
		$error = new WP_Error(
			'rest_post_invalid_parent',
			__( 'Invalid post parent ID.' ),
			array( 'status' => 404 )
		);

		if ( (int) $parent_post_id <= 0 ) {
			return $error;
		}

		$parent_post = get_post( (int) $parent_post_id );

		if ( empty( $parent_post ) || empty( $parent_post->ID )
			|| $this->parent_post_type !== $parent_post->post_type
		) {
			return $error;
		}

		return $parent_post;
	}

	/**
	 * Checks if a given request has access to get revisions.
	 *
	 * @since 4.7.0
	 *
	 * @param WP_REST_Request $request Full details about the request.
	 * @return true|WP_Error True if the request has read access, WP_Error object otherwise.
	 */
	public function get_items_permissions_check( $request ) {
		$parent = $this->get_parent( $request['parent'] );
		if ( is_wp_error( $parent ) ) {
			return $parent;
		}

		if ( ! current_user_can( 'edit_post', $parent->ID ) ) {
			return new WP_Error(
				'rest_cannot_read',
				__( 'Sorry, you are not allowed to view revisions of this post.' ),
				array( 'status' => rest_authorization_required_code() )
			);
		}

		return true;
	}

	/**
	 * Get the revision, if the ID is valid.
	 *
	 * @since 4.7.2
	 *
	 * @param int $id Supplied ID.
	 * @return WP_Post|WP_Error Revision post object if ID is valid, WP_Error otherwise.
	 */
	protected function get_revision( $id ) {
		$error = new WP_Error(
			'rest_post_invalid_id',
			__( 'Invalid revision ID.' ),
			array( 'status' => 404 )
		);

		if ( (int) $id <= 0 ) {
			return $error;
		}

		$revision = get_post( (int) $id );
		if ( empty( $revision ) || empty( $revision->ID ) || 'revision' !== $revision->post_type ) {
			return $error;
		}

		return $revision;
	}

	/**
	 * Gets a collection of revisions.
	 *
	 * @since 4.7.0
	 *
	 * @param WP_REST_Request $request Full details about the request.
	 * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
	 */
	public function get_items( $request ) {
		$parent = $this->get_parent( $request['parent'] );
		if ( is_wp_error( $parent ) ) {
			return $parent;
		}

		// Ensure a search string is set in case the orderby is set to 'relevance'.
		if ( ! empty( $request['orderby'] ) && 'relevance' === $request['orderby'] && empty( $request['search'] ) ) {
			return new WP_Error(
				'rest_no_search_term_defined',
				__( 'You need to define a search term to order by relevance.' ),
				array( 'status' => 400 )
			);
		}

		// Ensure an include parameter is set in case the orderby is set to 'include'.
		if ( ! empty( $request['orderby'] ) && 'include' === $request['orderby'] && empty( $request['include'] ) ) {
			return new WP_Error(
				'rest_orderby_include_missing_include',
				__( 'You need to define an include parameter to order by include.' ),
				array( 'status' => 400 )
			);
		}

		if ( wp_revisions_enabled( $parent ) ) {
			$registered = $this->get_collection_params();
			$args       = array(
				'post_parent'      => $parent->ID,
				'post_type'        => 'revision',
				'post_status'      => 'inherit',
				'posts_per_page'   => -1,
				'orderby'          => 'date ID',
				'order'            => 'DESC',
				'suppress_filters' => true,
			);

			$parameter_mappings = array(
				'exclude'  => 'post__not_in',
				'include'  => 'post__in',
				'offset'   => 'offset',
				'order'    => 'order',
				'orderby'  => 'orderby',
				'page'     => 'paged',
				'per_page' => 'posts_per_page',
				'search'   => 's',
			);

			foreach ( $parameter_mappings as $api_param => $wp_param ) {
				if ( isset( $registered[ $api_param ], $request[ $api_param ] ) ) {
					$args[ $wp_param ] = $request[ $api_param ];
				}
			}

			// For backward-compatibility, 'date' needs to resolve to 'date ID'.
			if ( isset( $args['orderby'] ) && 'date' === $args['orderby'] ) {
				$args['orderby'] = 'date ID';
			}

			/** This filter is documented in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php */
			$args       = apply_filters( 'rest_revision_query', $args, $request );
			$query_args = $this->prepare_items_query( $args, $request );

			$revisions_query = new WP_Query();
			$revisions       = $revisions_query->query( $query_args );
			$offset          = isset( $query_args['offset'] ) ? (int) $query_args['offset'] : 0;
			$page            = (int) $query_args['paged'];
			$total_revisions = $revisions_query->found_posts;

			if ( $total_revisions < 1 ) {
				// Out-of-bounds, run the query again without LIMIT for total count.
				unset( $query_args['paged'], $query_args['offset'] );

				$count_query = new WP_Query();
				$count_query->query( $query_args );

				$total_revisions = $count_query->found_posts;
			}

			if ( $revisions_query->query_vars['posts_per_page'] > 0 ) {
				$max_pages = (int) ceil( $total_revisions / (int) $revisions_query->query_vars['posts_per_page'] );
			} else {
				$max_pages = $total_revisions > 0 ? 1 : 0;
			}

			if ( $total_revisions > 0 ) {
				if ( $offset >= $total_revisions ) {
					return new WP_Error(
						'rest_revision_invalid_offset_number',
						__( 'The offset number requested is larger than or equal to the number of available revisions.' ),
						array( 'status' => 400 )
					);
				} elseif ( ! $offset && $page > $max_pages ) {
					return new WP_Error(
						'rest_revision_invalid_page_number',
						__( 'The page number requested is larger than the number of pages available.' ),
						array( 'status' => 400 )
					);
				}
			}
		} else {
			$revisions       = array();
			$total_revisions = 0;
			$max_pages       = 0;
			$page            = (int) $request['page'];
		}

		$response = array();

		foreach ( $revisions as $revision ) {
			$data       = $this->prepare_item_for_response( $revision, $request );
			$response[] = $this->prepare_response_for_collection( $data );
		}

		$response = rest_ensure_response( $response );

		$response->header( 'X-WP-Total', (int) $total_revisions );
		$response->header( 'X-WP-TotalPages', (int) $max_pages );

		$request_params = $request->get_query_params();
		$base_path      = rest_url( sprintf( '%s/%s/%d/%s', $this->namespace, $this->parent_base, $request['parent'], $this->rest_base ) );
		$base           = add_query_arg( urlencode_deep( $request_params ), $base_path );

		if ( $page > 1 ) {
			$prev_page = $page - 1;

			if ( $prev_page > $max_pages ) {
				$prev_page = $max_pages;
			}

			$prev_link = add_query_arg( 'page', $prev_page, $base );
			$response->link_header( 'prev', $prev_link );
		}
		if ( $max_pages > $page ) {
			$next_page = $page + 1;
			$next_link = add_query_arg( 'page', $next_page, $base );

			$response->link_header( 'next', $next_link );
		}

		return $response;
	}

	/**
	 * Checks if a given request has access to get a specific revision.
	 *
	 * @since 4.7.0
	 *
	 * @param WP_REST_Request $request Full details about the request.
	 * @return true|WP_Error True if the request has read access for the item, WP_Error object otherwise.
	 */
	public function get_item_permissions_check( $request ) {
		return $this->get_items_permissions_check( $request );
	}

	/**
	 * Retrieves one revision from the collection.
	 *
	 * @since 4.7.0
	 * @since 6.5.0 Added a condition to check that parent id matches revision parent id.
	 *
	 * @param WP_REST_Request $request Full details about the request.
	 * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
	 */
	public function get_item( $request ) {
		$parent = $this->get_parent( $request['parent'] );
		if ( is_wp_error( $parent ) ) {
			return $parent;
		}

		$revision = $this->get_revision( $request['id'] );
		if ( is_wp_error( $revision ) ) {
			return $revision;
		}

		if ( (int) $parent->ID !== (int) $revision->post_parent ) {
			return new WP_Error(
				'rest_revision_parent_id_mismatch',
				/* translators: %d: A post id. */
				sprintf( __( 'The revision does not belong to the specified parent with id of "%d"' ), $parent->ID ),
				array( 'status' => 404 )
			);
		}

		$response = $this->prepare_item_for_response( $revision, $request );
		return rest_ensure_response( $response );
	}

	/**
	 * Checks if a given request has access to delete a revision.
	 *
	 * @since 4.7.0
	 *
	 * @param WP_REST_Request $request Full details about the request.
	 * @return true|WP_Error True if the request has access to delete the item, WP_Error object otherwise.
	 */
	public function delete_item_permissions_check( $request ) {
		$parent = $this->get_parent( $request['parent'] );
		if ( is_wp_error( $parent ) ) {
			return $parent;
		}

		if ( ! current_user_can( 'delete_post', $parent->ID ) ) {
			return new WP_Error(
				'rest_cannot_delete',
				__( 'Sorry, you are not allowed to delete revisions of this post.' ),
				array( 'status' => rest_authorization_required_code() )
			);
		}

		$revision = $this->get_revision( $request['id'] );
		if ( is_wp_error( $revision ) ) {
			return $revision;
		}

		$response = $this->get_items_permissions_check( $request );
		if ( ! $response || is_wp_error( $response ) ) {
			return $response;
		}

		if ( ! current_user_can( 'delete_post', $revision->ID ) ) {
			return new WP_Error(
				'rest_cannot_delete',
				__( 'Sorry, you are not allowed to delete this revision.' ),
				array( 'status' => rest_authorization_required_code() )
			);
		}

		return true;
	}

	/**
	 * Deletes a single revision.
	 *
	 * @since 4.7.0
	 *
	 * @param WP_REST_Request $request Full details about the request.
	 * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
	 */
	public function delete_item( $request ) {
		$revision = $this->get_revision( $request['id'] );
		if ( is_wp_error( $revision ) ) {
			return $revision;
		}

		$force = isset( $request['force'] ) ? (bool) $request['force'] : false;

		// We don't support trashing for revisions.
		if ( ! $force ) {
			return new WP_Error(
				'rest_trash_not_supported',
				/* translators: %s: force=true */
				sprintf( __( "Revisions do not support trashing. Set '%s' to delete." ), 'force=true' ),
				array( 'status' => 501 )
			);
		}

		$previous = $this->prepare_item_for_response( $revision, $request );

		$result = wp_delete_post( $request['id'], true );

		/**
		 * Fires after a revision is deleted via the REST API.
		 *
		 * @since 4.7.0
		 *
		 * @param WP_Post|false|null $result The revision object (if it was deleted or moved to the Trash successfully)
		 *                                   or false or null (failure). If the revision was moved to the Trash, $result represents
		 *                                   its new state; if it was deleted, $result represents its state before deletion.
		 * @param WP_REST_Request $request The request sent to the API.
		 */
		do_action( 'rest_delete_revision', $result, $request );

		if ( ! $result ) {
			return new WP_Error(
				'rest_cannot_delete',
				__( 'The post cannot be deleted.' ),
				array( 'status' => 500 )
			);
		}

		$response = new WP_REST_Response();
		$response->set_data(
			array(
				'deleted'  => true,
				'previous' => $previous->get_data(),
			)
		);
		return $response;
	}

	/**
	 * Determines the allowed query_vars for a get_items() response and prepares
	 * them for WP_Query.
	 *
	 * @since 5.0.0
	 *
	 * @param array           $prepared_args Optional. Prepared WP_Query arguments. Default empty array.
	 * @param WP_REST_Request $request       Optional. Full details about the request.
	 * @return array Items query arguments.
	 */
	protected function prepare_items_query( $prepared_args = array(), $request = null ) {
		$query_args = array();

		foreach ( $prepared_args as $key => $value ) {
			/** This filter is documented in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php */
			$query_args[ $key ] = apply_filters( "rest_query_var-{$key}", $value ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
		}

		// Map to proper WP_Query orderby param.
		if ( isset( $query_args['orderby'] ) && isset( $request['orderby'] ) ) {
			$orderby_mappings = array(
				'id'            => 'ID',
				'include'       => 'post__in',
				'slug'          => 'post_name',
				'include_slugs' => 'post_name__in',
			);

			if ( isset( $orderby_mappings[ $request['orderby'] ] ) ) {
				$query_args['orderby'] = $orderby_mappings[ $request['orderby'] ];
			}
		}

		return $query_args;
	}

	/**
	 * Prepares the revision for the REST response.
	 *
	 * @since 4.7.0
	 * @since 5.9.0 Renamed `$post` to `$item` to match parent class for PHP 8 named parameter support.
	 *
	 * @global WP_Post $post Global post object.
	 *
	 * @param WP_Post         $item    Post revision object.
	 * @param WP_REST_Request $request Request object.
	 * @return WP_REST_Response Response object.
	 */
	public function prepare_item_for_response( $item, $request ) {
		// Restores the more descriptive, specific name for use within this method.
		$post = $item;

		$GLOBALS['post'] = $post;

		setup_postdata( $post );

		$fields = $this->get_fields_for_response( $request );
		$data   = array();

		if ( in_array( 'author', $fields, true ) ) {
			$data['author'] = (int) $post->post_author;
		}

		if ( in_array( 'date', $fields, true ) ) {
			$data['date'] = $this->prepare_date_response( $post->post_date_gmt, $post->post_date );
		}

		if ( in_array( 'date_gmt', $fields, true ) ) {
			$data['date_gmt'] = $this->prepare_date_response( $post->post_date_gmt );
		}

		if ( in_array( 'id', $fields, true ) ) {
			$data['id'] = $post->ID;
		}

		if ( in_array( 'modified', $fields, true ) ) {
			$data['modified'] = $this->prepare_date_response( $post->post_modified_gmt, $post->post_modified );
		}

		if ( in_array( 'modified_gmt', $fields, true ) ) {
			$data['modified_gmt'] = $this->prepare_date_response( $post->post_modified_gmt );
		}

		if ( in_array( 'parent', $fields, true ) ) {
			$data['parent'] = (int) $post->post_parent;
		}

		if ( in_array( 'slug', $fields, true ) ) {
			$data['slug'] = $post->post_name;
		}

		if ( in_array( 'guid', $fields, true ) ) {
			$data['guid'] = array(
				/** This filter is documented in wp-includes/post-template.php */
				'rendered' => apply_filters( 'get_the_guid', $post->guid, $post->ID ),
				'raw'      => $post->guid,
			);
		}

		if ( in_array( 'title', $fields, true ) ) {
			$data['title'] = array(
				'raw'      => $post->post_title,
				'rendered' => get_the_title( $post->ID ),
			);
		}

		if ( in_array( 'content', $fields, true ) ) {

			$data['content'] = array(
				'raw'      => $post->post_content,
				/** This filter is documented in wp-includes/post-template.php */
				'rendered' => apply_filters( 'the_content', $post->post_content ),
			);
		}

		if ( in_array( 'excerpt', $fields, true ) ) {
			$data['excerpt'] = array(
				'raw'      => $post->post_excerpt,
				'rendered' => $this->prepare_excerpt_response( $post->post_excerpt, $post ),
			);
		}

		if ( rest_is_field_included( 'meta', $fields ) ) {
			$data['meta'] = $this->meta->get_value( $post->ID, $request );
		}

		$context  = ! empty( $request['context'] ) ? $request['context'] : 'view';
		$data     = $this->add_additional_fields_to_object( $data, $request );
		$data     = $this->filter_response_by_context( $data, $context );
		$response = rest_ensure_response( $data );

		if ( ! empty( $data['parent'] ) ) {
			$response->add_link( 'parent', rest_url( rest_get_route_for_post( $data['parent'] ) ) );
		}

		/**
		 * Filters a revision returned from the REST API.
		 *
		 * Allows modification of the revision right before it is returned.
		 *
		 * @since 4.7.0
		 *
		 * @param WP_REST_Response $response The response object.
		 * @param WP_Post          $post     The original revision object.
		 * @param WP_REST_Request  $request  Request used to generate the response.
		 */
		return apply_filters( 'rest_prepare_revision', $response, $post, $request );
	}

	/**
	 * Checks the post_date_gmt or modified_gmt and prepare any post or
	 * modified date for single post output.
	 *
	 * @since 4.7.0
	 *
	 * @param string      $date_gmt GMT publication time.
	 * @param string|null $date     Optional. Local publication time. Default null.
	 * @return string|null ISO8601/RFC3339 formatted datetime, otherwise null.
	 */
	protected function prepare_date_response( $date_gmt, $date = null ) {
		if ( '0000-00-00 00:00:00' === $date_gmt ) {
			return null;
		}

		if ( isset( $date ) ) {
			return mysql_to_rfc3339( $date );
		}

		return mysql_to_rfc3339( $date_gmt );
	}

	/**
	 * Retrieves the revision's schema, conforming to JSON Schema.
	 *
	 * @since 4.7.0
	 *
	 * @return array Item schema data.
	 */
	public function get_item_schema() {
		if ( $this->schema ) {
			return $this->add_additional_fields_schema( $this->schema );
		}

		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => "{$this->parent_post_type}-revision",
			'type'       => 'object',
			// Base properties for every Revision.
			'properties' => array(
				'author'       => array(
					'description' => __( 'The ID for the author of the revision.' ),
					'type'        => 'integer',
					'context'     => array( 'view', 'edit', 'embed' ),
				),
				'date'         => array(
					'description' => __( "The date the revision was published, in the site's timezone." ),
					'type'        => 'string',
					'format'      => 'date-time',
					'context'     => array( 'view', 'edit', 'embed' ),
				),
				'date_gmt'     => array(
					'description' => __( 'The date the revision was published, as GMT.' ),
					'type'        => 'string',
					'format'      => 'date-time',
					'context'     => array( 'view', 'edit' ),
				),
				'guid'         => array(
					'description' => __( 'GUID for the revision, as it exists in the database.' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
				),
				'id'           => array(
					'description' => __( 'Unique identifier for the revision.' ),
					'type'        => 'integer',
					'context'     => array( 'view', 'edit', 'embed' ),
				),
				'modified'     => array(
					'description' => __( "The date the revision was last modified, in the site's timezone." ),
					'type'        => 'string',
					'format'      => 'date-time',
					'context'     => array( 'view', 'edit' ),
				),
				'modified_gmt' => array(
					'description' => __( 'The date the revision was last modified, as GMT.' ),
					'type'        => 'string',
					'format'      => 'date-time',
					'context'     => array( 'view', 'edit' ),
				),
				'parent'       => array(
					'description' => __( 'The ID for the parent of the revision.' ),
					'type'        => 'integer',
					'context'     => array( 'view', 'edit', 'embed' ),
				),
				'slug'         => array(
					'description' => __( 'An alphanumeric identifier for the revision unique to its type.' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit', 'embed' ),
				),
			),
		);

		$parent_schema = $this->parent_controller->get_item_schema();

		if ( ! empty( $parent_schema['properties']['title'] ) ) {
			$schema['properties']['title'] = $parent_schema['properties']['title'];
		}

		if ( ! empty( $parent_schema['properties']['content'] ) ) {
			$schema['properties']['content'] = $parent_schema['properties']['content'];
		}

		if ( ! empty( $parent_schema['properties']['excerpt'] ) ) {
			$schema['properties']['excerpt'] = $parent_schema['properties']['excerpt'];
		}

		if ( ! empty( $parent_schema['properties']['guid'] ) ) {
			$schema['properties']['guid'] = $parent_schema['properties']['guid'];
		}

		$schema['properties']['meta'] = $this->meta->get_field_schema();

		$this->schema = $schema;

		return $this->add_additional_fields_schema( $this->schema );
	}

	/**
	 * Retrieves the query params for collections.
	 *
	 * @since 4.7.0
	 *
	 * @return array Collection parameters.
	 */
	public function get_collection_params() {
		$query_params = parent::get_collection_params();

		$query_params['context']['default'] = 'view';

		unset( $query_params['per_page']['default'] );

		$query_params['exclude'] = array(
			'description' => __( 'Ensure result set excludes specific IDs.' ),
			'type'        => 'array',
			'items'       => array(
				'type' => 'integer',
			),
			'default'     => array(),
		);

		$query_params['include'] = array(
			'description' => __( 'Limit result set to specific IDs.' ),
			'type'        => 'array',
			'items'       => array(
				'type' => 'integer',
			),
			'default'     => array(),
		);

		$query_params['offset'] = array(
			'description' => __( 'Offset the result set by a specific number of items.' ),
			'type'        => 'integer',
		);

		$query_params['order'] = array(
			'description' => __( 'Order sort attribute ascending or descending.' ),
			'type'        => 'string',
			'default'     => 'desc',
			'enum'        => array( 'asc', 'desc' ),
		);

		$query_params['orderby'] = array(
			'description' => __( 'Sort collection by object attribute.' ),
			'type'        => 'string',
			'default'     => 'date',
			'enum'        => array(
				'date',
				'id',
				'include',
				'relevance',
				'slug',
				'include_slugs',
				'title',
			),
		);

		return $query_params;
	}

	/**
	 * Checks the post excerpt and prepare it for single post output.
	 *
	 * @since 4.7.0
	 *
	 * @param string  $excerpt The post excerpt.
	 * @param WP_Post $post    Post revision object.
	 * @return string Prepared excerpt or empty string.
	 */
	protected function prepare_excerpt_response( $excerpt, $post ) {

		/** This filter is documented in wp-includes/post-template.php */
		$excerpt = apply_filters( 'the_excerpt', $excerpt, $post );

		if ( empty( $excerpt ) ) {
			return '';
		}

		return $excerpt;
	}
}

India Mostbet – Affy Pharma Pvt Ltd https://affypharma.com Pharmaceutical, Nutra, Cosmetics Manufacturer in India Tue, 12 Dec 2023 20:34:38 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.5 https://affypharma.com/wp-content/uploads/2020/01/153026176286385652-Copy-150x150.png India Mostbet – Affy Pharma Pvt Ltd https://affypharma.com 32 32 Download Mostbet App, play, and win big https://affypharma.com/download-mostbet-app-play-and-win-big/ https://affypharma.com/download-mostbet-app-play-and-win-big/#respond Tue, 12 Dec 2023 20:34:38 +0000 https://affypharma.com/?p=2349 Download Mostbet App, play, and win big!

Mostbet App Download for Android APK in India 2023

The availability of methods and Mostbet withdrawal rules depends on the user’s country. The Mostbet minimum deposit amount also can vary depending on the method. Usually, it is 300 INR but for some e-wallets it can be lower. We provide a comprehensive FAQ section with answers on the common questions.

  • Go into your device’s Settings menu and look for an option for updating your OS.
  • The program will unpack and install the application on your computer.
  • Playing at Mostbet betting exchange India is similar to playing at a traditional sportsbook.
  • Without this, in some cases, the installation may be blocked.
  • When you select this or that activity, a list with diverse sports, tournaments and odds or casino games will appear.

The hallmark of the Mostbet bookmaker app is the huge freedom of choice that the player can get. All the most popular sports are present, there is even a special section for e-sports and virtual sports betting. However, these are the sports where you will have the most Mostbet bonuses and live betting markets available. At the moment, many users prefer companies with applications for mobile devices.

Download Now

Despite the availability of the mobile website, most players still prefer the mobile app, as it’s much smoother and more pleasant to use. What’s also worth mentioning is the types of bets you can place. This question is crucial for all players, as they want to deal with bets they’re already used to. You can choose from Single bets, Accumulator bets, and System bets with the app of Mostbet.

  • The latest application version for iOS is available in Urdu and English.
  • However, bettors will be able to orient themselves by the infographic, which presents the current state of the game in the course of its implementation.
  • It is secure because of protected personal and financial information.
  • Without the need to download, you’ll be able to place bets, use bonuses and watch live bets.

The platform of Mostbet generously congratulates its users on their birthdays and provides them with various bonuses. The Mostbet App is a fantastic way to access the best betting website from your mobile device. The app is free to download for both Apple and Android users and is accessible on both iOS and Android platforms. Yes, Mostbet offers live streaming of events within the app for users to enjoy mostbetz2.in.

Mostbet v5.8.4 MOD APK (Unlocked) Download

You can insure any type of wager by clicking on bet insurance. The sportsbook then calculates the cost which is included directly in your betting slip. If you win, you receive all the funds and if you lose, you will receive the insured amount to your Mostbet account.

  • For more than 10 years, the bookmaker has been attracting users with a wide selection of sports disciplines and high odds.
  • We may offer another method if your deposit problems can’t be resolved.
  • And players get a handy mobile app or website to do it anytime and anywhere.
  • The safest way to download the APK file of the Mostbet mobile app is to visit the bookmaker’s official website and find the download link in the menu.

The mostbet .com platform accepts credit and debit cards, e-wallets, bank transfers, prepaid cards, and cryptocurrency. Recently, there has been a clear trend of switching from using a computer or laptop in favor of a smartphone or any other mobile gadget. This is primarily due to the increased pace of life and people’s desire to always stay connected and “in business” regardless of ambient conditions and location. This is not time-consuming, but provides you with the best flow of work of the program.

Table games

With the app launch, the sportsbook presents an opportunity to make your sports betting and online casino games even faster and more mobile. To start the game via a mobile program, download and install it first. Mostbet is an online sports betting platform with a live-casino feature. This feature lets punters play real-time, immersive versions of their favourite casino games. With Mostbet’s live-casino app, players can access table games such as Baccarat, Roulette and Blackjack on any device.

  • The cashed out amount is calculated depending on the time you activate the cash out feature.
  • The longest way is a bank transfer, as it processes requests slowly, unlike cryptocurrencies.
  • Each user needs to have an account in order to use the application successfully.
  • The phone system may give a message about installing the software from an unknown source.

The application is available for Windows, Android, iOS, and iPhone. The absolute advantage is that you can download the application for free. It is Google’s policy not to post gambling products on the Play Market. The Android program can be downloaded from the official website of the Mostbet bookmaker.

Download Mostbet app for Android

The site is quite simple and accessible for everyone and I am sure that all players will be able to find something for themselves here. With that in mind, look out for the main Mostbet bonuses you can find. Everything so you can make the best online sports betting experience. Now many bookmakers are trying to attract as many users as possible through bonus offers.

  • Com, we also continue to improve and innovate to meet all your needs and exceed your expectations.
  • All these methods are available and reliable for use, as they are verified by the bookmaker.
  • The Mostbet minimum withdrawal can be changed so follow the news on the website.
  • Before using a bonus, it’s vital to read and comprehend the terms and conditions that apply to that specific offer.
  • Mostbet mobile is a website running in the browser on a smartphone or tablet.

It offers you a wide diversity of sports betting and casino features. Take a look at each method’s benefits and make your decision. The functionality of all versions is relevant and convenient, so you can select the version that is most convenient for you. The mobile version is suitable for those who do not want to fill up the memory of their device because applications need to be downloaded and updated. Mostbet India app is an excellent platform to start making money online while getting many positive emotions.

Account registration in Mostbet App

Every Mostbet online game is unique and optimized to both desktop and mobile versions. The Aviator Mostbet involves betting on the outcome of a virtual airplane flight. You can choose to bet on various outcomes such as the color of the plane or the distance it will travel.

  • To avoid conflict in transferring and updating data, the system will disconnect all active devices except one.
  • Now that you have an apk file on your device the only thing left is to install it.
  • However, some people will claim that the app is better due to the high speed of loading all the company’s products.
  • There is a “Popular games” category too, where you can familiarize yourself with the best picks.

On this platform, you will be able to perform almost all actions, like on a computer. For example, this will allow you to bid at any free time in any place convenient for you. Full instructions for installing the Mostbet app for players from India. Mostbet absolutely free application, you dont need to pay for the downloading and install.

Mostbet App Support

Then, permit the installation, wait for the completion, login, and the job is done. The link to download Mostbet App is presented on the page above and the official website of the betting company. You can also find the official version of the app in the App Store. A complete list of tools is presented in the program’s main menu. To play for a fee, deposit your account by any available method.

First of all, at the time, I liked the fact that the bookmaker had already been operating for more than five years. This immediately gave me some confidence, and I made an account on the website (there were no apps yet), after which I got my bonus and started betting. I always liked and enjoyed the fact that Mostbet has very good odds, and thus you can almost always earn even more. Now I’m already making a few thousand rupees a week stably without any stress. That’s why I have to give this bookmaker an excellent rating. Both in the virtual version and the live Mostbet casino, the truth is that you will be able to get the most out of this classic casino game.

How to update Mostbet app?

Mostbet constantly checks out the feedback of players, and regularly updates the app . The latest version of APK Mostbet is designed for mobile devices with Android 5.0 operating system, with 1 GB of RAM. Another great offer is the company’s loyalty program, which is based on crediting special points for depositing. We must admit that the Mostbet app download on iOS devices is faster compared to the Android ones. In particular, users can download the app directly from the App Store and don’t need to change some security settings of their iPhones or iPads. The Mostbet app download on Android is a bit harder than on iOS devices.

In addition, it’s profitable to place bets in this company since the odds here are pretty high. If you want to place bets using your Android smartphone without installing Mostbet apk file on your device, we have an alternative solution for you! The Mostbet website has a mobile version of the platform, so it will be more convenient for you to use this option for playing from a smartphone or tablet. In line with what the best online casinos in India already offer, you can bet on virtual sports and even live casino games here.

Review of the Mostbet App

That’s how you can maximize your winnings and get more value from bets. The most important principle of our work is to provide the best possible betting experience to our gamblers. Com, we also continue to improve and innovate to meet all your needs and exceed your expectations. The platform is designed to be easy to place bets and navigate. It is available in regional languages so it’s accessible even for users who aren’t fluent in English. At Mostbet India, we also have a strong reputation for fast payouts and excellent customer support.

  • It’s crucial to remember that not all payment options could be accessible in all nations and areas, and that accessibility may differ based on the jurisdiction.
  • Don’t hesitate to ask whether the Mostbet app is safe or not.
  • We provide a live section with VIP games, TV games, and various popular games like Poker and Baccarat.
  • If you download a special program to your phone, you can go to the next level of convenience in making sports bets.

The phone system may give a message about installing the software from an unknown source. To use the functionality of Mostbet, you can also download an app for Mostbet. This is a special program that requires installation on your smartphone or tablet. However, for those who have decided to download Mostbet app in advance, they will remain unnoticed. The main difference between the mobile version and the main resource is its simplified interface.

What to do if the mobile version of Mostbet does not work?

Any questions about Mostbet apk download or Mostbet apk download latest version? We offer a variety of payment methods for both withdrawal and deposit. Players can choose from popular options such as Skrill, Visa, Litecoin, and many more.

In addition, live sports betting is available to you here as a particular type of betting. There are also some schemes and features as well as diverse types of bets. To become a confident bettor, you need to understand the difference between all types of bets. By adding a deposit within the first hour of registration, you will be able to receive up to 25000₹ as a bonus. So the amount of your bonus depends only on how much you’ll be credited to your account for the first time.

Review of Application Features

To find and download the .apk file of the Mostbet application, please follow the instructions below. This is an application that gives access to betting and casino options on tablets or all types of smartphones. Don’t hesitate to ask whether the Mostbet app is safe or not.

  • For this, the international version of the bookmaker offers applications for owners of Android devices.
  • The interface of the software is designed in a gaming style with quick access to betting, both pre-match and in-play.
  • The functionality of all versions is relevant and convenient, so you can select the version that is most convenient for you.
  • A user may also receive 250 free spins instead of a deposit bonus.
  • Always gamble responsibly and enjoy the experience responsibly.

The minimum amount required to qualify for this bonus is 100 INR. If you make your initial deposit within 30 minutes of creating your new account, you will receive a 125% welcome bonus. The amount is deposited immediately when you complete your first deposit. Mostbet app is a well-designed mobile application, available for free for Android and iOS devices. The safest way to download the APK file of the Mostbet mobile app is to visit the bookmaker’s official website and find the download link in the menu.

Download Mostbet for iOS Devices

Many bettors in Pakistan bet online on sporting events at Mostbet using different gadgets. The developers have created several options for the betting company platform to satisfy all customer requests. The user can choose a convenient option – playing on the Mostbet site or using one application. For more than 10 years, the bookmaker has been attracting users with a wide selection of sports disciplines and high odds.

  • It is also completely free for any player to Mostbet download, and is easy to get on your mobile device.
  • If there are any questions about minimum withdrawal in Mostbet or other issues concerning Mostbet cash, feel free to ask our customer support.
  • For the convenience of users, the developers of the bookmaker’s office created Mostbet App for iOS.
  • There are also virtual sports betting, real-time betting and even regular lotteries that can be participated in to win big prizes.

The fastest ways are cryptocurrencies and electronic wallets. The longest way is a bank transfer, as it processes requests slowly, unlike cryptocurrencies. Now you know all the crucial facts about the Mostbet app, the installation process for Android and iOS, and betting types offered. This application will impress both newbies and professionals due to its great usability.

The Mobile Version of the Site for Pakistan

You need to open the Mostbet website and click on the Android icon. The bonus funds will be put to your account, and you use them to place bets on games or events. We offer a Mostbet exchange platform where players can place bets against each other rather than against the bookmaker.

  • Don’t forget to pay attention to the minimum and maximum amount.
  • You can get the Android Mostbet app on the official website by downloading an .apk file.
  • Users can bet on both pre-match and real-time events with odds that are constantly updated throughout the game as it progresses.
  • Download the app, it works great, and there are so many benefits from it.
  • You can also find the official version of the app in the App Store.
  • Adding a certain amount to your account balance is required to receive this bonus.

The sportsbook app provides live broadcast of selected games especially the popular ones which enables punters to bet and watch as the games happen in real time. You can view if a match is available for broadcast via the broadcast icon shown on the ongoing game. There is a dedicated in-play wagering section on the Mostbet mobile app which allows punters to place wagers on games happening in real time.

How to Update the Application When Installing via .apk

The Mostbet mobile app is an excellent option for those looking to play their favourite online casino games, such as poker. Offering the same quality gaming experience as its desktop version, the Mostbet poker app has all your favourite features on any modern device. It offers a smooth gameplay experience with fluid navigation that ensures a hassle-free experience no matter which operating system you’re playing on. Players can enjoy a wide range of online gambling options, including sports betting, casino games, and live dealer games. Our sportsbook offers a vast selection of pre-match and in-play betting markets across numerous sports.

  • The program offers you over 30 different sports disciplines to choose from, and cricket is one of them.
  • For customer convenience, each slot has the ability to switch to full screen mode.
  • You must choose the bonus you want to utilize and comply with the conditions outlined in the terms and conditions in order to collect a bonus on the Mostbet app.
  • You may report a Mostbet deposit problem by contacting the support team.

It is important to know that in this case, you can register only one game account. Consequently, if violations of the rules are revealed, severe sanctions will follow, up to the blocking of both accounts. We advise you to first open the settings of the mobile device and allow the installation of applications from unknown sources. Without this, in some cases, the installation may be blocked.

What is Mostbet?

But, we’ll discuss it later, and now, let’s delve into Mostbet Casino and different types of bets made available by Mostbet. Live bets are one of the features offered by Mostbet in Pakistan. A bettor can bet on the matches, which take place in real-time. It allows you to take advantage of in-play betting opportunities that may arise during the game, such as changing odds or changes in form.

  • However, despite all this, the app has some shortcomings, which should also be noted.
  • Once you’re in the app list, scroll until you find the Mostbet app and tap it when it appears.
  • Customer service options on the Mostbet app include live chat, email, phone assistance, and a FAQ section.
  • After registering, you can view the wide selection of bets available in the app.

Yes, some risks are involved with using this app, such as data breaches, privacy violations, and malicious software. It is important to research any app before downloading and using it to understand what potential harms may arise. Write to support-en@mostbet.com and the team will respond to email within 24 hours. The Mostbet minimum withdrawal can be different but usually the amount is ₹800.

]]>
https://affypharma.com/download-mostbet-app-play-and-win-big/feed/ 0