get_meta_type example


    public function get_value( $object_id$request ) {
        $fields   = $this->get_registered_fields();
        $response = array();

        foreach ( $fields as $meta_key => $args ) {
            $name       = $args['name'];
            $all_values = get_metadata( $this->get_meta_type()$object_id$meta_key, false );

            if ( $args['single'] ) {
                if ( empty( $all_values ) ) {
                    $value = $args['schema']['default'];
                } else {
                    $value = $all_values[0];
                }

                $value = $this->prepare_value_for_response( $value$request$args );
            } else {
                $value = array();

                
Home | Imprint | This part of the site doesn't use cookies.