readonly' => true, ); $schema['properties']['type'] = array( 'description' => __( 'The family of objects originally represented, such as "post_type" or "taxonomy".' ), 'type' => 'string', 'enum' => array( 'taxonomy', 'post_type', 'post_type_archive', 'custom' ), 'context' => array( 'view', 'edit', 'embed' ), 'default' => 'custom', ); $schema['properties']['status'] = array( 'description' => __( 'A named status for the object.' ), 'type' => 'string', 'enum' => array_keys( get_post_stati( array( 'internal' => false ) ) ), 'default' => 'publish', 'context' => array( 'view', 'edit', 'embed' ), ); $schema['properties']['parent'] = array( 'description' => __( 'The ID for the parent of the object.' ), 'type' => 'integer', 'minimum' => 0, 'default' => 0, 'context' => array( 'view', 'edit', 'embed' ), ); $schema['properties']['attr_title'] = array( 'description' => __( 'Text for the title attribute of the link element for this menu item.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), ); $schema['properties']['classes'] = array( 'description' => __( 'Class names for the link element of this menu item.' ), 'type' => 'array', 'items' => array( 'type' => 'string', ), 'context' => array( 'view', 'edit', 'embed' ), 'arg_options' => array( 'sanitize_callback' => static function ( $value ) { return array_map( 'sanitize_html_class', wp_parse_list( $value ) ); }, ), ); $schema['properties']['description'] = array( 'description' => __( 'The description of this menu item.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), ); $schema['properties']['menu_order'] = array( 'description' => __( 'The DB ID of the nav_menu_item that is this item\'s menu parent, if any, otherwise 0.' ), 'context' => array( 'view', 'edit', 'embed' ), 'type' => 'integer', 'minimum' => 1, 'default' => 1, ); $schema['properties']['object'] = array( 'description' => __( 'The type of object originally represented, such as "category", "post", or "attachment".' ), 'context' => array( 'view', 'edit', 'embed' ), 'type' => 'string', 'arg_options' => array( 'sanitize_callback' => 'sanitize_key', ), ); $schema['properties']['object_id'] = array( 'description' => __( 'The database ID of the original object this menu item represents, for example the ID for posts or the term_id for categories.' ), 'context' => array( 'view', 'edit', 'embed' ), 'type' => 'integer', 'minimum' => 0, 'default' => 0, ); $schema['properties']['target'] = array( 'description' => __( 'The target attribute of the link element for this menu item.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'enum' => array( '_blank', '', ), ); $schema['properties']['url'] = array( 'description' => __( 'The URL to which this menu item points.' ), 'type' => 'string', 'format' => 'uri', 'context' => array( 'view', 'edit', 'embed' ), 'arg_options' => array( 'validate_callback' => static function ( $url ) { if ( '' === $url ) { return true; } if ( sanitize_url( $url ) ) { return true; } return new WP_Error( 'rest_invalid_url', __( 'Invalid URL.' ) ); }, ), ); $schema['properties']['xfn'] = array( 'description' => __( 'The XFN relationship expressed in the link of this menu item.' ), 'type' => 'array', 'items' => array( 'type' => 'string', ), 'context' => array( 'view', 'edit', 'embed' ), 'arg_options' => array( 'sanitize_callback' => static function ( $value ) { return array_map( 'sanitize_html_class', wp_parse_list( $value ) ); }, ), ); $schema['properties']['invalid'] = array( 'description' => __( 'Whether the menu item represents an object that no longer exists.' ), 'context' => array( 'view', 'edit', 'embed' ), 'type' => 'boolean', 'readonly' => true, ); $taxonomies = wp_list_filter( get_object_taxonomies( $this->post_type, 'objects' ), array( 'show_in_rest' => true ) ); foreach ( $taxonomies as $taxonomy ) { $base = ! empty( $taxonomy->rest_base ) ? $taxonomy->rest_base : $taxonomy->name; $schema['properties'][ $base ] = array( /* translators: %s: taxonomy name */ 'description' => sprintf( __( 'The terms assigned to the object in the %s taxonomy.' ), $taxonomy->name ), 'type' => 'array', 'items' => array( 'type' => 'integer', ), 'context' => array( 'view', 'edit' ), ); if ( 'nav_menu' === $taxonomy->name ) { $schema['properties'][ $base ]['type'] = 'integer'; unset( $schema['properties'][ $base ]['items'] ); } } $schema['properties']['meta'] = $this->meta->get_field_schema(); $schema_links = $this->get_schema_links(); if ( $schema_links ) { $schema['links'] = $schema_links; } $this->schema = $schema; return $this->add_additional_fields_schema( $this->schema ); } /** * Retrieves the query params for the nav menu items collection. * * @since 5.9.0 * * @return array Collection parameters. */ public function get_collection_params() { $query_params = parent::get_collection_params(); $query_params['menu_order'] = array( 'description' => __( 'Limit result set to posts with a specific menu_order value.' ), 'type' => 'integer', ); $query_params['order'] = array( 'description' => __( 'Order sort attribute ascending or descending.' ), 'type' => 'string', 'default' => 'asc', 'enum' => array( 'asc', 'desc' ), ); $query_params['orderby'] = array( 'description' => __( 'Sort collection by object attribute.' ), 'type' => 'string', 'default' => 'menu_order', 'enum' => array( 'author', 'date', 'id', 'include', 'modified', 'parent', 'relevance', 'slug', 'include_slugs', 'title', 'menu_order', ), ); // Change default to 100 items. $query_params['per_page']['default'] = 100; return $query_params; } /** * Determines the allowed query_vars for a get_items() response and prepares * them for WP_Query. * * @since 5.9.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 = parent::prepare_items_query( $prepared_args, $request ); // Map to proper WP_Query orderby param. if ( isset( $query_args['orderby'], $request['orderby'] ) ) { $orderby_mappings = array( 'id' => 'ID', 'include' => 'post__in', 'slug' => 'post_name', 'include_slugs' => 'post_name__in', 'menu_order' => 'menu_order', ); if ( isset( $orderby_mappings[ $request['orderby'] ] ) ) { $query_args['orderby'] = $orderby_mappings[ $request['orderby'] ]; } } $query_args['update_menu_item_cache'] = true; return $query_args; } /** * Gets the id of the menu that the given menu item belongs to. * * @since 5.9.0 * * @param int $menu_item_id Menu item id. * @return int */ protected function get_menu_id( $menu_item_id ) { $menu_ids = wp_get_post_terms( $menu_item_id, 'nav_menu', array( 'fields' => 'ids' ) ); $menu_id = 0; if ( $menu_ids && ! is_wp_error( $menu_ids ) ) { $menu_id = array_shift( $menu_ids ); } return $menu_id; } } {"id":42767,"date":"2025-02-20T06:24:30","date_gmt":"2025-02-20T02:54:30","guid":{"rendered":"https:\/\/itimes.ir\/%da%af%d9%81%d8%aa%d9%86%d8%af-%d8%b9%d9%85%d8%af%d8%a7%d9%8b-%da%af%d9%84-%d8%ae%d9%88%d8%b1%d8%af%db%8c-%d8%aa%d8%a7-%d9%86%d8%aa%db%8c%d8%ac%d9%87-%d8%a8%d8%a7%d8%b2%db%8c-%d8%b9%d9%88%d8%b6-%d8%b4\/"},"modified":"2025-02-20T06:24:30","modified_gmt":"2025-02-20T02:54:30","slug":"%da%af%d9%81%d8%aa%d9%86%d8%af-%d8%b9%d9%85%d8%af%d8%a7%d9%8b-%da%af%d9%84-%d8%ae%d9%88%d8%b1%d8%af%db%8c-%d8%aa%d8%a7-%d9%86%d8%aa%db%8c%d8%ac%d9%87-%d8%a8%d8%a7%d8%b2%db%8c-%d8%b9%d9%88%d8%b6-%d8%b4","status":"publish","type":"post","link":"https:\/\/itimes.ir\/%da%af%d9%81%d8%aa%d9%86%d8%af-%d8%b9%d9%85%d8%af%d8%a7%d9%8b-%da%af%d9%84-%d8%ae%d9%88%d8%b1%d8%af%db%8c-%d8%aa%d8%a7-%d9%86%d8%aa%db%8c%d8%ac%d9%87-%d8%a8%d8%a7%d8%b2%db%8c-%d8%b9%d9%88%d8%b6-%d8%b4\/","title":{"rendered":"\u06af\u0641\u062a\u0646\u062f \u0639\u0645\u062f\u0627\u064b \u06af\u0644 \u062e\u0648\u0631\u062f\u06cc \u062a\u0627 \u0646\u062a\u06cc\u062c\u0647 \u0628\u0627\u0632\u06cc \u0639\u0648\u0636 \u0634\u0648\u062f\/ \u067e\u0646\u062c \u062f\u0642\u06cc\u0642\u0647 \u0627\u06cc \u0642\u0631\u0627\u0631\u062f\u0627\u062f\u0645 \u0631\u0627 \u0628\u0627 \u0627\u0633\u062a\u0642\u0644\u0627\u0644 \u062a\u0645\u062f\u06cc\u062f \u06a9\u0631\u062f\u0645\/ \u067e\u062f\u0631\u0628\u0632\u0631\u06af\u0645 \u0627\u0635\u0631\u0627\u0631 \u062f\u0627\u0634\u062a \u0645\u06a9\u0627\u0646\u06cc\u06a9 \u0634\u0648\u0645"},"content":{"rendered":"\n
\u0628\u0647 \u06af\u0632\u0627\u0631\u0634 \u062e\u0628\u0631 \u0648\u0631\u0632\u0634\u06cc\u060c \u062d\u0633\u06cc\u0646 \u062d\u0633\u06cc\u0646\u06cc \u0647\u0645 \u0627\u06a9\u0646\u0648\u0646 \u062f\u0631\u0648\u0627\u0632\u0647\u200c\u0628\u0627\u0646 \u0627\u0648\u0644 \u0648 \u06a9\u0627\u067e\u06cc\u062a\u0627\u0646 \u0627\u0633\u062a\u0642\u0644\u0627\u0644 \u0645\u062d\u0633\u0648\u0628 \u0645\u06cc\u200c\u0634\u0648\u062f \u0648\u0644\u06cc \u06f8 \u0633\u0627\u0644 \u0642\u0628\u0644 \u06cc\u06a9\u06cc \u0627\u0632 \u0628\u0627\u0632\u06cc\u06a9\u0646\u0627\u0646 \u062c\u0648\u0627\u0646 \u0648 \u062a\u0627\u0632\u0647 \u0645\u0637\u0631\u062d \u0634\u062f\u0647 \u062f\u0631 \u0627\u06cc\u0646 \u062a\u06cc\u0645 \u0628\u0647 \u062d\u0633\u0627\u0628 \u0645\u06cc\u200c\u0622\u0645\u062f. \u0628\u0627 \u062d\u0633\u06cc\u0646\u06cc \u062f\u0631 \u062f\u0648\u0645 \u0627\u0633\u0641\u0646\u062f \u0633\u0627\u0644 \u06f1\u06f3\u06f9\u06f5 \u0645\u0635\u0627\u062d\u0628\u0647 \u062c\u0627\u0644\u0628\u06cc \u0627\u0646\u062c\u0627\u0645 \u062f\u0627\u062f\u06cc\u0645 \u06a9\u0647 \u0628\u062f \u0646\u06cc\u0633\u062a \u062f\u0648\u0628\u0627\u0631\u0647 \u0628\u0647 \u0622\u0646 \u0646\u06af\u0627\u0647 \u0628\u06cc\u0646\u062f\u0627\u0632\u06cc\u0645:<\/p>\n
-\u0627\u0632 \u0686\u0627\u0644\u0634 \u0628\u0632\u0631\u06af \u062e\u0648\u0634\u0645 \u0645\u06cc\u200c\u0622\u06cc\u062f. \u0647\u06cc\u062c\u0627\u0646 \u0628\u0647 \u0645\u0646 \u0627\u0646\u0631\u0698\u06cc \u0645\u06cc\u200c\u062f\u0647\u062f. \u0627\u0644\u0628\u062a\u0647 \u0686\u0648\u0646 \u062c\u0627\u0646\u0634\u06cc\u0646 \u0645\u0647\u062f\u06cc \u0631\u062d\u0645\u062a\u06cc \u0634\u062f\u0647\u200c\u0627\u0645 \u0637\u0628\u06cc\u0639\u06cc \u0627\u0633\u062a \u0631\u0648\u06cc\u0645 \u0641\u0634\u0627\u0631 \u0628\u0627\u0634\u062f (\u062d\u0633\u06cc\u0646\u06cc \u062f\u0631 \u0632\u0645\u0633\u062a\u0627\u0646 \u0633\u0627\u0644 \u06f9\u06f5 \u0628\u0631\u0627\u06cc \u0645\u0642\u0637\u0639\u06cc \u0645\u0647\u062f\u06cc \u0631\u062d\u0645\u062a\u06cc \u0631\u0627 \u0646\u06cc\u0645\u06a9\u062a \u0646\u0634\u06cc\u0646 \u06a9\u0631\u062f\u0647 \u0628\u0648\u062f )<\/p>\n
– \u0638\u0631\u0641 \u06f5 \u062f\u0642\u06cc\u0642\u0647 \u0628\u0627 \u0627\u0633\u062a\u0642\u0644\u0627\u0644 \u06f3 \u0633\u0627\u0644\u0647 \u062a\u0645\u062f\u06cc\u062f \u06a9\u0631\u062f\u0645.<\/p>\n
-\u0647\u0646\u0648\u0632 \u0628\u0647 \u0686\u06cc\u0632\u06cc \u06a9\u0647 \u062e\u0648\u062f\u0645 \u0645\u06cc\u200c\u062e\u0648\u0627\u0647\u0645\u060c \u062f\u0631 \u0641\u0648\u062a\u0628\u0627\u0644 \u0646\u0631\u0633\u06cc\u062f\u0647\u200c\u0627\u0645.<\/p>\n
– \u0631\u0648\u0632\u06cc \u06a9\u0647 \u0628\u0647 \u0627\u0633\u062a\u0642\u0644\u0627\u0644 \u0622\u0645\u062f\u0645\u060c \u06a9\u0633\u06cc \u0645\u0646 \u0631\u0627 \u0646\u0645\u06cc\u200c\u0634\u0646\u0627\u062e\u062a \u0648 \u0627\u0635\u0644\u0627\u064b \u0641\u06a9\u0631 \u0646\u0645\u06cc\u200c\u06a9\u0631\u062f\u0645 \u06a9\u0647 \u0628\u062a\u0648\u0627\u0646\u0645 \u0645\u0647\u062f\u06cc \u0631\u062d\u0645\u062a\u06cc \u0631\u0627 \u0646\u06cc\u0645\u06a9\u062a \u0646\u0634\u06cc\u0646 \u06a9\u0646\u0645.<\/p>\n
– \u0648\u0642\u062a\u06cc \u062f\u0631 \u0645\u0644\u0648\u0627\u0646 \u0628\u0627\u0632\u06cc \u0645\u06cc\u200c\u06a9\u0631\u062f\u0645 \u06cc\u06a9\u0628\u0627\u0631 \u067e\u06cc\u0634 \u0627\u0632 \u0622\u063a\u0627\u0632 \u062c\u062f\u0627\u0644 \u0645\u0642\u0627\u0628\u0644 \u0627\u0633\u062a\u0642\u0644\u0627\u0644 \u0628\u0647 \u062a\u0645\u0627\u0634\u0627\u06af\u0631\u0627\u0646 \u0637\u0631\u0641\u062f\u0627\u0631 \u0622\u0628\u06cc \u0642\u0644\u0628 \u0646\u0634\u0627\u0646 \u062f\u0627\u062f\u0645 \u0627\u0645\u0627 \u0628\u0639\u062f \u0627\u0632 \u067e\u0627\u06cc\u0627\u0646 \u0645\u0633\u0627\u0628\u0642\u0647 \u0648\u0642\u062a\u06cc \u0628\u0627\u062e\u062a\u06cc\u0645\u060c \u0628\u0647 \u0645\u0646 \u06af\u0641\u062a\u0646\u062f \u0627\u06cc\u0646 \u0639\u0645\u062f\u0627\u064b \u06af\u0644 \u062e\u0648\u0631\u062f\u0647 \u0648 \u0628\u0627\u06cc\u062f \u0627\u0632 \u0645\u0644\u0648\u0627\u0646 \u0627\u062e\u0631\u0627\u062c \u0634\u0648\u062f \u062f\u0631 \u062d\u0627\u0644\u06cc \u06a9\u0647 \u0628\u0647 \u062e\u062f\u0627 \u0642\u0633\u0645 \u0686\u0646\u06cc\u0646 \u0645\u0648\u0636\u0648\u0639\u06cc \u0635\u062d\u062a \u0646\u062f\u0627\u0634\u062a.<\/p>\n
– \u067e\u062f\u0631 \u0647\u0645\u0633\u0631\u0645 \u067e\u0631\u0633\u067e\u0648\u0644\u06cc\u0633\u06cc \u062f\u0648 \u0622\u062a\u0634\u0647 \u0627\u0633\u062a \u0648\u0644\u06cc \u062e\u0648\u062f \u0647\u0645\u0633\u0631\u0645 \u0637\u0631\u0641\u062f\u0627\u0631 \u0627\u0633\u062a\u0642\u0644\u0627\u0644…<\/p>\n
– \u0634\u06cc\u06a9 \u067e\u0648\u0634 \u0647\u0633\u062a\u0645 \u0627\u0645\u0627 \u0627\u0647\u0644 \u0642\u0631 \u0648 \u0641\u0631 \u0646\u06cc\u0633\u062a\u0645.<\/p>\n
– \u067e\u062f\u0631\u0628\u0632\u0631\u06af\u0645 \u0627\u0635\u0631\u0627\u0631 \u062f\u0627\u0634\u062a \u0645\u06a9\u0627\u0646\u06cc\u06a9 \u0634\u0648\u0645.<\/p>\n
– \u0627\u0648\u0644\u06cc\u0646 \u0642\u0631\u0627\u0631\u062f\u0627\u062f\u0645 \u0628\u0627 \u0627\u0633\u062a\u0642\u0644\u0627\u0644 \u06f9\u06f0 \u0645\u06cc\u0644\u06cc\u0648\u0646 \u062a\u0648\u0645\u0627\u0646 \u0628\u0648\u062f.<\/p>\n
<\/p>\n