k; default: return $block_content; break; } return; } /** * Generates the render output for the block. * * @since 5.5.0 * @since 6.5.0 Added block bindings processing. * * @global WP_Post $post Global post object. * * @param array $options { * Optional options object. * * @type bool $dynamic Defaults to 'true'. Optionally set to false to avoid using the block's render_callback. * } * @return string Rendered block output. */ public function render( $options = array() ) { global $post; $options = wp_parse_args( $options, array( 'dynamic' => true, ) ); // Process the block bindings and get attributes updated with the values from the sources. $computed_attributes = $this->process_block_bindings(); if ( ! empty( $computed_attributes ) ) { // Merge the computed attributes with the original attributes. $this->attributes = array_merge( $this->attributes, $computed_attributes ); } $is_dynamic = $options['dynamic'] && $this->name && null !== $this->block_type && $this->block_type->is_dynamic(); $block_content = ''; if ( ! $options['dynamic'] || empty( $this->block_type->skip_inner_blocks ) ) { $index = 0; foreach ( $this->inner_content as $chunk ) { if ( is_string( $chunk ) ) { $block_content .= $chunk; } else { $inner_block = $this->inner_blocks[ $index ]; $parent_block = $this; /** This filter is documented in wp-includes/blocks.php */ $pre_render = apply_filters( 'pre_render_block', null, $inner_block->parsed_block, $parent_block ); if ( ! is_null( $pre_render ) ) { $block_content .= $pre_render; } else { $source_block = $inner_block->parsed_block; /** This filter is documented in wp-includes/blocks.php */ $inner_block->parsed_block = apply_filters( 'render_block_data', $inner_block->parsed_block, $source_block, $parent_block ); /** This filter is documented in wp-includes/blocks.php */ $inner_block->context = apply_filters( 'render_block_context', $inner_block->context, $inner_block->parsed_block, $parent_block ); $block_content .= $inner_block->render(); } ++$index; } } } if ( ! empty( $computed_attributes ) && ! empty( $block_content ) ) { foreach ( $computed_attributes as $attribute_name => $source_value ) { $block_content = $this->replace_html( $block_content, $attribute_name, $source_value ); } } if ( $is_dynamic ) { $global_post = $post; $parent = WP_Block_Supports::$block_to_render; WP_Block_Supports::$block_to_render = $this->parsed_block; $block_content = (string) call_user_func( $this->block_type->render_callback, $this->attributes, $block_content, $this ); WP_Block_Supports::$block_to_render = $parent; $post = $global_post; } if ( ( ! empty( $this->block_type->script_handles ) ) ) { foreach ( $this->block_type->script_handles as $script_handle ) { wp_enqueue_script( $script_handle ); } } if ( ! empty( $this->block_type->view_script_handles ) ) { foreach ( $this->block_type->view_script_handles as $view_script_handle ) { wp_enqueue_script( $view_script_handle ); } } if ( ! empty( $this->block_type->view_script_module_ids ) ) { foreach ( $this->block_type->view_script_module_ids as $view_script_module_id ) { wp_enqueue_script_module( $view_script_module_id ); } } if ( ( ! empty( $this->block_type->style_handles ) ) ) { foreach ( $this->block_type->style_handles as $style_handle ) { wp_enqueue_style( $style_handle ); } } if ( ( ! empty( $this->block_type->view_style_handles ) ) ) { foreach ( $this->block_type->view_style_handles as $view_style_handle ) { wp_enqueue_style( $view_style_handle ); } } /** * Filters the content of a single block. * * @since 5.0.0 * @since 5.9.0 The `$instance` parameter was added. * * @param string $block_content The block content. * @param array $block The full block, including name and attributes. * @param WP_Block $instance The block instance. */ $block_content = apply_filters( 'render_block', $block_content, $this->parsed_block, $this ); /** * Filters the content of a single block. * * The dynamic portion of the hook name, `$name`, refers to * the block name, e.g. "core/paragraph". * * @since 5.7.0 * @since 5.9.0 The `$instance` parameter was added. * * @param string $block_content The block content. * @param array $block The full block, including name and attributes. * @param WP_Block $instance The block instance. */ $block_content = apply_filters( "render_block_{$this->name}", $block_content, $this->parsed_block, $this ); return $block_content; } } @return stdClass */ public function prepare_item_for_database( $request ) { $object = new Settings(); $data = $object->get(); $schema = $this->get_item_schema(); $properties = isset( $schema['properties'] ) && is_array( $schema['properties'] ) ? $schema['properties'] : array(); if ( ! empty( $properties ) ) { $properties_keys = array_keys( array_filter( $properties, function( $property ) { return isset( $property['readonly'] ) && true === $property['readonly'] ? false : true; } ) ); foreach ( $properties_keys as $key ) { $value = isset( $request[ $key ] ) ? $request[ $key ] : ''; $data[ $key ] = $value; } } $object->update( $data ); return $object->get(); } /** * Get the query params for collections. * * @return array */ public function get_collection_params() { return array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), 'paged' => array( 'description' => __( 'Current page of the collection.', 'cookie-law-info' ), 'type' => 'integer', 'default' => 1, 'sanitize_callback' => 'absint', 'validate_callback' => 'rest_validate_request_arg', 'minimum' => 1, ), 'per_page' => array( 'description' => __( 'Maximum number of items to be returned in result set.', 'cookie-law-info' ), 'type' => 'integer', 'default' => 10, 'minimum' => 1, 'maximum' => 100, 'sanitize_callback' => 'absint', 'validate_callback' => 'rest_validate_request_arg', ), 'search' => array( 'description' => __( 'Limit results to those matching a string.', 'cookie-law-info' ), 'type' => 'string', 'sanitize_callback' => 'sanitize_text_field', 'validate_callback' => 'rest_validate_request_arg', ), 'force' => array( 'type' => 'boolean', 'description' => __( 'Force fetch data', 'cookie-law-info' ), ), ); } /** * Get the Consent logs's schema, conforming to JSON Schema. * * @return array */ public function get_item_schema() { $schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'consentlogs', 'type' => 'object', 'properties' => array( 'id' => array( 'description' => __( 'Unique identifier for the resource.', 'cookie-law-info' ), 'type' => 'integer', 'context' => array( 'view' ), 'readonly' => true, ), 'site' => array( 'description' => __( 'Unique identifier for the resource.', 'cookie-law-info' ), 'type' => 'object', 'context' => array( 'view', 'edit' ), ), 'api' => array( 'description' => __( 'Language.', 'cookie-law-info' ), 'type' => 'object', 'context' => array( 'view', 'edit' ), ), 'account' => array( 'description' => __( 'Language.', 'cookie-law-info' ), 'type' => 'object', 'context' => array( 'view', 'edit' ), ), 'consent_logs' => array( 'description' => __( 'Language.', 'cookie-law-info' ), 'type' => 'object', 'context' => array( 'view', 'edit' ), ), 'languages' => array( 'description' => __( 'Language.', 'cookie-law-info' ), 'type' => 'object', 'context' => array( 'view', 'edit' ), ), 'onboarding' => array( 'description' => __( 'Language.', 'cookie-law-info' ), 'type' => 'object', 'context' => array( 'view', 'edit' ), ), ), ); return $this->add_additional_fields_schema( $schema ); } } // End the class.
Fatal error: Uncaught Error: Class 'CookieYes\Lite\Admin\Modules\Settings\Api\Api' not found in /var/www/html/helitower.com.br/web/wp-content/plugins/cookie-law-info/lite/admin/modules/settings/class-settings.php:43 Stack trace: #0 /var/www/html/helitower.com.br/web/wp-content/plugins/cookie-law-info/lite/admin/modules/settings/class-settings.php(34): CookieYes\Lite\Admin\Modules\Settings\Settings->load_apis() #1 /var/www/html/helitower.com.br/web/wp-content/plugins/cookie-law-info/lite/includes/class-modules.php(54): CookieYes\Lite\Admin\Modules\Settings\Settings->init() #2 /var/www/html/helitower.com.br/web/wp-content/plugins/cookie-law-info/lite/admin/class-admin.php(179): CookieYes\Lite\Includes\Modules->__construct('settings') #3 /var/www/html/helitower.com.br/web/wp-content/plugins/cookie-law-info/lite/admin/class-admin.php(81): CookieYes\Lite\Admin\Admin->load_modules() #4 /var/www/html/helitower.com.br/web/wp-content/plugins/cookie-law-info/lite/includes/class-cli.php(153): CookieYes\Lite\Admin\Admin->__construct( in /var/www/html/helitower.com.br/web/wp-content/plugins/cookie-law-info/lite/admin/modules/settings/class-settings.php on line 43