array of property names on the parent object schema. * * This mirrors rest_validate_object_value_from_schema(), where a draft-04 * `required` array takes precedence: when one is present, per-property * booleans are ignored during validation. They are therefore left out of * the array here as well (but still stripped from the output) so the * published schema describes exactly what gets enforced. */ if ( isset( $schema['properties'] ) && is_array( $schema['properties'] ) ) { $has_required_array = isset( $schema['required'] ) && is_array( $schema['required'] ); $required = array(); foreach ( $schema['properties'] as $property => &$property_schema ) { if ( is_array( $property_schema ) && ! wp_is_numeric_array( $property_schema ) && isset( $property_schema['required'] ) && is_bool( $property_schema['required'] ) ) { if ( ! $has_required_array && true === $property_schema['required'] ) { $required[] = (string) $property; } unset( $property_schema['required'] ); } } unset( $property_schema ); /* * Property keys are unique, so the collected list needs no deduplication. * When a draft-04 array is already present, leave it untouched. */ if ( ! $has_required_array && count( $required ) > 0 ) { $schema['required'] = $required; } } /* * A boolean `required` outside of an object's property list has no draft-04 * equivalent, so drop it rather than emit an invalid keyword. */ if ( isset( $schema['required'] ) && is_bool( $schema['required'] ) ) { unset( $schema['required'] ); } /* * Sub-schema maps: keys are user-defined, values are sub-schemas. * Note: 'dependencies' values can also be property-dependency arrays * (numeric arrays of strings) which are skipped via wp_is_numeric_array(). */ foreach ( array( 'properties', 'patternProperties', 'definitions', 'dependencies' ) as $keyword ) { if ( isset( $schema[ $keyword ] ) && is_array( $schema[ $keyword ] ) ) { foreach ( $schema[ $keyword ] as $key => $child_schema ) { if ( is_array( $child_schema ) && ! wp_is_numeric_array( $child_schema ) ) { $schema[ $keyword ][ $key ] = _wp_prepare_json_schema_for_client_with_allowed_keywords( $child_schema, $allowed_keywords ); } } } } // Single sub-schema keywords. foreach ( array( 'not', 'additionalProperties', 'additionalItems' ) as $keyword ) { if ( isset( $schema[ $keyword ] ) && is_array( $schema[ $keyword ] ) && ! wp_is_numeric_array( $schema[ $keyword ] ) ) { $schema[ $keyword ] = _wp_prepare_json_schema_for_client_with_allowed_keywords( $schema[ $keyword ], $allowed_keywords ); } } // Items: single schema or tuple array of schemas. if ( isset( $schema['items'] ) && is_array( $schema['items'] ) ) { if ( ! wp_is_numeric_array( $schema['items'] ) ) { $schema['items'] = _wp_prepare_json_schema_for_client_with_allowed_keywords( $schema['items'], $allowed_keywords ); } else { foreach ( $schema['items'] as $index => $item_schema ) { if ( is_array( $item_schema ) && ! wp_is_numeric_array( $item_schema ) ) { $schema['items'][ $index ] = _wp_prepare_json_schema_for_client_with_allowed_keywords( $item_schema, $allowed_keywords ); } } } } // Array-of-schemas keywords. foreach ( array( 'anyOf', 'oneOf', 'allOf' ) as $keyword ) { if ( isset( $schema[ $keyword ] ) && is_array( $schema[ $keyword ] ) ) { foreach ( $schema[ $keyword ] as $index => $sub_schema ) { if ( is_array( $sub_schema ) && ! wp_is_numeric_array( $sub_schema ) ) { $schema[ $keyword ][ $index ] = _wp_prepare_json_schema_for_client_with_allowed_keywords( $sub_schema, $allowed_keywords ); } } } } return $schema; } মেহেদী হাসান নিঝুম, Author at এপিক ভার্স জার্নাল - Page 13 of 18
Sunday, September 13, 2026
29.3 C
Bangladesh

মেহেদী হাসান নিঝুম

91 POSTS

Exclusive articles:

নিউরালিঙ্ক, মানুষের চিন্তা কি এখন চিপের নিয়ন্ত্রণে?

কল্পনা করুন, আপনি কেবল মনে মনে ভাবলেন এবং আপনার স্মার্টফোনে টাইপ হয়ে গেল, কিংবা শুধু চিন্তার মাধ্যমেই কম্পিউটার গেম খেলছেন। ইলন মাস্কের প্রতিষ্ঠান নিউরালিঙ্ক ঠিক এই...

সংসদে আইন প্রণয়ন প্রক্রিয়া, জনমত নাকি কেবলই আনুষ্ঠানিকতা?

একটি গণতান্ত্রিক রাষ্ট্রের হৃদপিণ্ড হলো তার সংসদ। আর সেই সংসদের প্রধান কাজ হলো আইন প্রণয়ন করা। কিন্তু প্রশ্ন উঠেছে, যে আইন জনগণের জীবনের ওপর...

আল-কুরআনে ভ্রূণ বিকাশ,ঐশ্বরিক বাণী ও আধুনিক বিজ্ঞানের বিস্ময়কর মিল

মানব সৃষ্টির রহস্য চিরকালই মানুষের কৌতূহলের কেন্দ্রবিন্দু। আধুনিক চিকিৎসাবিজ্ঞান ও উন্নত প্রযুক্তির কল্যাণে আজ আমরা ভ্রূণের বিকাশের বিভিন্ন ধাপ সম্পর্কে বিস্তারিত জানতে পারছি। তবে...

সময়ের আপেক্ষিকতা ও কুরআনের দৃষ্টিভঙ্গি, বিজ্ঞান ও ধর্মতত্ত্বের মেলবন্ধন

বিংশ শতাব্দীর শুরুতে বিজ্ঞানী আলবার্ট আইনস্টাইন যখন তার 'সাধারণ আপেক্ষিকতা তত্ত্ব' (General Theory of Relativity) প্রচার করেন, তখন মহাবিশ্ব সম্পর্কে মানুষের ধারণা বদলে যায়।...

মহাজাগতিক দান ‘লোহা’,আধুনিক বিজ্ঞান ও কুরআনের এক অনন্য সংগতি

মানব সভ্যতার অগ্রগতিতে লোহার অবদান অনস্বীকার্য। ঘর বাড়ির নির্মাণ থেকে শুরু করে মানব জীবনে লোহার অবদান অপরিহার্য । কিন্তু আমরা কি কখনো ভেবে দেখেছি,...

Breaking

একা না খেয়ে প্রিয়জনের টেবিলে বসাই দূর করতে পারে বিষণ্ণতা ও ডিমেনশিয়া

বিশেষ প্রতিনিধি: আমরা প্রতিদিন কী খাচ্ছি, খাবারটা কতটা সুষম...

নেপালে ভয়াবহ বন্যা ও ভূমিধস,নিহত ১৫৭, নিখোঁজ চার শতাধিক

বিশেষ প্রতিনিধি: ভয়াবহ এক প্রাকৃতিক বিপর্যয়ের মুখোমুখি হয়েছে হিমালয়কন্যা...
spot_imgspot_img