golden hour
/home/godaofbq/hyperxmed.com/wp-content/plugins/essential-blocks/includes/Blocks
⬆️ Go Up
Upload
File/Folder
Size
Actions
Accordion.php
1.01 KB
Del
OK
AccordionItem.php
335 B
Del
OK
AddToCart.php
3.43 KB
Del
OK
AdvancedHeading.php
4.33 KB
Del
OK
AdvancedImage.php
1.94 KB
Del
OK
AdvancedNavigation.php
703 B
Del
OK
AdvancedTabs.php
886 B
Del
OK
AdvancedVideo.php
1021 B
Del
OK
Breadcrumbs.php
11.35 KB
Del
OK
Button.php
351 B
Del
OK
CallToAction.php
365 B
Del
OK
Column.php
220 B
Del
OK
CountDown.php
605 B
Del
OK
DualButton.php
666 B
Del
OK
FeatureList.php
332 B
Del
OK
FlipBox.php
648 B
Del
OK
FluentForms.php
3.77 KB
Del
OK
Form.php
5.4 KB
Del
OK
FormTextField.php
246 B
Del
OK
GoogleMap.php
2.55 KB
Del
OK
Icon.php
323 B
Del
OK
ImageComparison.php
620 B
Del
OK
ImageGallery.php
2.23 KB
Del
OK
InfoBox.php
374 B
Del
OK
InstagramFeed.php
6.05 KB
Del
OK
InteractivePromo.php
321 B
Del
OK
NftGallery.php
649 B
Del
OK
Notice.php
580 B
Del
OK
NumberCounter.php
598 B
Del
OK
Openverse.php
480 B
Del
OK
ParallaxSlider.php
664 B
Del
OK
PopUp.php
625 B
Del
OK
PostBlock.php
1.57 KB
Del
OK
PostCarousel.php
4.42 KB
Del
OK
PostGrid.php
5.75 KB
Del
OK
PostMeta.php
3.51 KB
Del
OK
PricingTable.php
333 B
Del
OK
ProductDetails.php
3.51 KB
Del
OK
ProductImages.php
2.8 KB
Del
OK
ProductPrice.php
4.75 KB
Del
OK
ProductRating.php
2.97 KB
Del
OK
ProgressBar.php
604 B
Del
OK
Row.php
455 B
Del
OK
ShapeDivider.php
602 B
Del
OK
Slider.php
996 B
Del
OK
Social.php
352 B
Del
OK
SocialShare.php
3.89 KB
Del
OK
Tab.php
214 B
Del
OK
TableOfContents.php
17.3 KB
Del
OK
Taxonomy.php
4.9 KB
Del
OK
TeamMember.php
361 B
Del
OK
Testimonial.php
373 B
Del
OK
Text.php
2.48 KB
Del
OK
ToggleContent.php
613 B
Del
OK
TypingText.php
594 B
Del
OK
WPForms.php
2.92 KB
Del
OK
WooProductGrid.php
8.3 KB
Del
OK
Wrapper.php
359 B
Del
OK
error_log
268.39 KB
Del
OK
price.php
239 B
Del
OK
Edit: PostGrid.php
<?php namespace EssentialBlocks\Blocks; use EssentialBlocks\Utils\Helper; class PostGrid extends PostBlock { protected $frontend_scripts = [ 'essential-blocks-post-grid-frontend' ]; protected $frontend_styles = [ 'essential-blocks-fontawesome', 'essential-blocks-common-style' ]; protected static $default_attributes = [ 'thumbnailSize' => '', 'loadMoreOptions' => false, 'showTaxonomyFilter' => false, 'showSearch' => false, 'enableAjaxSearch' => false, 'addIcon' => false, 'iconPosition' => 'left', 'icon' => 'fas fa-chevron-right', 'preset' => 'style-1', 'enableThumbnailSort' => true, 'defaultFilter' => 'all', 'version' => "", 'showFallbackImg' => false, 'fallbackImgUrl' => '' ]; public function get_default_attributes() { return array_merge( parent::$default_attributes, self::$default_attributes ); } /** * Unique name of the block. * @return string */ public function get_name() { return 'post-grid'; } /** * Register all other scripts * @return void */ public function register_scripts() { $this->assets_manager->register( 'post-grid-frontend', $this->path() . '/frontend.js' ); } /** * Block render callback. * * @param mixed $attributes * @param mixed $content * @return mixed */ public function render_callback( $attributes, $content ) { if ( is_admin() ) { return; } $queryData = $attributes[ "queryData" ]; $customQueryData = $queryData; //Update with filter data if ( isset( $attributes[ 'showTaxonomyFilter' ] ) && $attributes[ 'showTaxonomyFilter' ] ) { $defaultFilter = isset( $attributes[ "defaultFilter" ] ) ? $attributes[ "defaultFilter" ] : "all"; if ( $defaultFilter !== "all" ) { $taxonomy = json_decode( $attributes[ 'selectedTaxonomy' ] ); $category = get_term_by( 'slug', sanitize_text_field( $defaultFilter ), sanitize_text_field( $taxonomy->value ) ); $catString = json_encode( [ [ "label" => $category->name, "value" => $category->term_id ] ] ); $defaultTaxonomy[ $taxonomy->value ] = [ 'name' => $defaultFilter, 'slug' => $defaultFilter, 'value' => $catString ]; $customQueryData[ 'taxonomies' ] = $defaultTaxonomy; } } $attributes = wp_parse_args( $attributes, $this->get_default_attributes() ); //Set enableThumbnailSort to false if preset is 4/5 if ( isset( $attributes[ 'enableThumbnailSort' ] ) && ! in_array( $attributes[ "preset" ], [ 'style-1', 'style-2', 'style-3' ] ) ) { $attributes[ 'enableThumbnailSort' ] = false; } $classHook = isset( $attributes[ 'classHook' ] ) ? $attributes[ 'classHook' ] : ''; $_default_attributes = array_keys( parent::$default_attributes ); $_essential_attrs = [ 'thumbnailSize' => $attributes[ "thumbnailSize" ], 'loadMoreOptions' => $attributes[ 'loadMoreOptions' ], 'showSearch' => $attributes[ 'showSearch' ], 'showTaxonomyFilter' => $attributes[ 'showTaxonomyFilter' ], 'enableAjaxSearch' => $attributes[ 'enableAjaxSearch' ], 'addIcon' => $attributes[ 'addIcon' ], 'iconPosition' => $attributes[ 'iconPosition' ], 'icon' => $attributes[ 'icon' ], 'preset' => $attributes[ 'preset' ], 'defaultFilter' => $attributes[ 'defaultFilter' ], 'version' => isset( $attributes[ 'version' ] ) ? $attributes[ 'version' ] : '', 'showBlockContent' => $attributes[ 'showBlockContent' ], 'showFallbackImg' => isset( $attributes[ 'showFallbackImg' ] ) ? $attributes[ 'showFallbackImg' ] : false, 'fallbackImgUrl' => isset( $attributes[ 'fallbackImgUrl' ] ) ? $attributes[ 'fallbackImgUrl' ] : '' ]; if ( isset( $_essential_attrs[ 'showBlockContent' ] ) && $_essential_attrs[ 'showBlockContent' ] === false ) { return ''; } //Query Result $result = $this->get_posts( $customQueryData ); $query = [ ]; if ( isset( $result->posts ) && is_array( $result->posts ) && count( $result->posts ) > 0 ) { $query = apply_filters( 'eb_post_grid_query_results', $result->posts ); } //set total posts if ( isset( $result->found_posts ) ) { if ( isset( $attributes[ 'loadMoreOptions' ][ 'totalPosts' ] ) ) { $attributes[ 'loadMoreOptions' ][ 'totalPosts' ] = $result->found_posts; } if ( isset( $_essential_attrs[ 'loadMoreOptions' ][ 'totalPosts' ] ) ) { $_essential_attrs[ 'loadMoreOptions' ][ 'totalPosts' ] = $result->found_posts; } } array_walk( $_default_attributes, function ( $key ) use ( $attributes, &$_essential_attrs ) { $_essential_attrs[ $key ] = $attributes[ $key ]; } ); ob_start(); Helper::views( 'post-grid', array_merge( $attributes, [ 'essentialAttr' => $_essential_attrs, 'classHook' => $classHook, 'queryData' => $queryData, 'posts' => $query, 'block_object' => $this ] ) ); return ob_get_clean(); } }
Save