8n', 'wp-element', 'wp-block-editor', 'wp-server-side-render'], filemtime(plugin_dir_path(dirname(dirname(dirname(__FILE__)))) . 'assets/js/blocks/block-wpp-widget.js') ); wp_register_style( 'block-wpp-editor-css', plugins_url('editor.css', __FILE__), [], filemtime(plugin_dir_path(__FILE__) . 'editor.css') ); register_block_type( 'wordpress-popular-posts/widget', [ 'editor_style' => 'block-wpp-editor-css', 'editor_script' => 'block-wpp-widget-js', 'render_callback' => [$this, 'render'], 'attributes' => [ '_editMode' => [ 'type' => 'boolean', 'default' => true ], '_isSelected' => [ 'type' => 'boolean', 'default' => false ], 'title' => [ 'type' => 'string', 'default' => '' ], 'limit' => [ 'type' =>'number', 'default' => 10 ], 'offset' => [ 'type' => 'number', 'default' => 0 ], 'order_by' => [ 'type' => 'string', 'default' => 'views' ], 'range' => [ 'type' => 'string', 'default' => 'last24hours' ], 'time_quantity' => [ 'type' => 'number', 'default' => 24 ], 'time_unit' => [ 'type' => 'string', 'default' => 'hour' ], 'freshness' => [ 'type' => 'boolean', 'default' => false ], /* filters */ 'post_type' => [ 'type' => 'string', 'default' => 'post' ], 'pid' => [ 'type' => 'string', 'default' => '' ], 'author' => [ 'type' => 'string', 'default' => '' ], 'tax' => [ 'type' => 'string', 'default' => '' ], 'term_id' => [ 'type' => 'string', 'default' => '' ], /* post settings */ 'shorten_title' => [ 'type' => 'boolean', 'default' => false ], 'title_length' => [ 'type' =>'number', 'default' => 0 ], 'title_by_words' => [ 'type' =>'number', 'default' => 0 ], 'display_post_excerpt' => [ 'type' => 'boolean', 'default' => false ], 'excerpt_format' => [ 'type' => 'boolean', 'default' => false ], 'excerpt_length' => [ 'type' =>'number', 'default' => 0 ], 'excerpt_by_words' => [ 'type' =>'number', 'default' => 0 ], 'display_post_thumbnail' => [ 'type' => 'boolean', 'default' => false ], 'thumbnail_width' => [ 'type' =>'number', 'default' => 0 ], 'thumbnail_height' => [ 'type' =>'number', 'default' => 0 ], 'thumbnail_build' => [ 'type' => 'string', 'default' => 'manual' ], 'thumbnail_size' => [ 'type' => 'string', 'default' => '' ], /* stats tag settings */ 'stats_comments' => [ 'type' => 'boolean', 'default' => false ], 'stats_views' => [ 'type' => 'boolean', 'default' => true ], 'stats_author' => [ 'type' => 'boolean', 'default' => false ], 'stats_date' => [ 'type' => 'boolean', 'default' => false ], 'stats_date_format' => [ 'type' => 'string', 'default' => 'F j, Y' ], 'stats_taxonomy' => [ 'type' => 'boolean', 'default' => false ], 'taxonomy' => [ 'type' => 'string', 'default' => 'category' ], /* HTML markup settings */ 'custom_html' => [ 'type' => 'boolean', 'default' => false ], 'header_start' => [ 'type' => 'string', 'default' => '

' ], 'header_end' => [ 'type' => 'string', 'default' => '

' ], 'wpp_start' => [ 'type' => 'string', 'default' => '' ], 'post_html' => [ 'type' => 'string', 'default' => '
  • {thumb} {title} {stats}
  • ' ], 'theme' => [ 'type' => 'string', 'default' => '' ], ] ] ); } /** * Renders the block. * * @since 5.4.0 * @param array * @return string */ public function render(array $attributes) { extract($this->parse_attributes($attributes)); $html = ''; return $html; } /** * Parses attributes. * * @since 5.4.0 * @param array * @return array */ private function parse_attributes($atts = []) { $out = array(); foreach ( $this->defaults as $name => $default ) { $out[$name] = array_key_exists($name, $atts) ? trim($atts[$name]) : $default; } return $out; } }
    Fatal error: Uncaught Error: Class 'WordPressPopularPosts\Block\Widget\Widget' not found in /var/www/html/sirinerd.com.br/web/wp-content/plugins/wordpress-popular-posts/src/Container/WordPressPopularPostsConfiguration.php:44 Stack trace: #0 /var/www/html/sirinerd.com.br/web/wp-content/plugins/wordpress-popular-posts/src/Container/Container.php(104): WordPressPopularPosts\Container\WordPressPopularPostsConfiguration->WordPressPopularPosts\Container\{closure}(Object(WordPressPopularPosts\Container\Container)) #1 /var/www/html/sirinerd.com.br/web/wp-content/plugins/wordpress-popular-posts/src/Container/Container.php(88): WordPressPopularPosts\Container\Container->WordPressPopularPosts\Container\{closure}(Object(WordPressPopularPosts\Container\Container)) #2 /var/www/html/sirinerd.com.br/web/wp-content/plugins/wordpress-popular-posts/src/Container/WordPressPopularPostsConfiguration.php(84): WordPressPopularPosts\Container\Container->offsetGet('block_widget') #3 /var/www/html/sirinerd.com.br/web/wp-content/plugins/wordpress-po in /var/www/html/sirinerd.com.br/web/wp-content/plugins/wordpress-popular-posts/src/Container/WordPressPopularPostsConfiguration.php on line 44