SILENT KILLERPanel

Current Path: > home > codekrsu > > ameliagraphics.com > wp-content > plugins > essential-blocks > includes > Blocks


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: /home/codekrsu//ameliagraphics.com/wp-content/plugins/essential-blocks/includes/Blocks

NameTypeSizeLast ModifiedActions
Accordion.php File 1059 bytes February 26 2025 16:22:10.
AccordionItem.php File 335 bytes October 30 2024 16:05:38.
AddToCart.php File 3515 bytes October 30 2024 16:05:38.
AdvancedHeading.php File 4700 bytes December 24 2024 15:38:54.
AdvancedImage.php File 1983 bytes October 30 2024 16:05:38.
AdvancedNavigation.php File 703 bytes October 30 2024 16:05:38.
AdvancedTabs.php File 886 bytes October 30 2024 16:05:38.
AdvancedVideo.php File 1021 bytes October 30 2024 16:05:38.
Breadcrumbs.php File 11646 bytes January 12 2025 17:13:54.
Button.php File 351 bytes October 30 2024 16:05:38.
CallToAction.php File 365 bytes October 30 2024 16:05:38.
Column.php File 220 bytes August 27 2024 16:37:06.
CountDown.php File 605 bytes October 30 2024 16:05:38.
DualButton.php File 666 bytes October 30 2024 16:05:38.
FeatureList.php File 332 bytes October 30 2024 16:05:38.
FlipBox.php File 648 bytes October 30 2024 16:05:38.
FluentForms.php File 3865 bytes October 30 2024 16:05:38.
Form.php File 5859 bytes June 29 2025 14:07:42.
FormTextField.php File 246 bytes August 27 2024 16:37:06.
GoogleMap.php File 2615 bytes October 30 2024 16:05:38.
Icon.php File 323 bytes October 30 2024 16:05:38.
ImageComparison.php File 620 bytes August 27 2024 16:37:06.
ImageGallery.php File 2318 bytes December 24 2024 17:17:58.
InfoBox.php File 723 bytes July 27 2025 13:25:28.
InstagramFeed.php File 6032 bytes February 26 2025 16:22:10.
InteractivePromo.php File 321 bytes August 27 2024 16:37:06.
LottieAnimation.php File 608 bytes February 18 2025 14:31:10.
NftGallery.php File 649 bytes October 30 2024 16:05:38.
Notice.php File 580 bytes October 30 2024 16:05:38.
NumberCounter.php File 598 bytes August 27 2024 16:37:06.
Openverse.php File 480 bytes October 30 2024 16:05:38.
ParallaxSlider.php File 664 bytes October 30 2024 16:05:38.
PopUp.php File 625 bytes October 30 2024 16:05:38.
PostBlock.php File 1610 bytes August 27 2024 16:37:06.
PostCarousel.php File 4734 bytes May 19 2025 15:07:08.
PostGrid.php File 5888 bytes January 12 2025 17:13:54.
PostMeta.php File 3596 bytes December 24 2024 15:38:54.
PricingTable.php File 333 bytes October 30 2024 16:05:38.
ProductDetails.php File 3598 bytes October 30 2024 16:05:38.
ProductImages.php File 2903 bytes May 08 2025 15:01:12.
ProductPrice.php File 4866 bytes October 30 2024 16:05:38.
ProductRating.php File 3041 bytes October 30 2024 16:05:38.
ProgressBar.php File 604 bytes October 30 2024 16:05:38.
Row.php File 455 bytes October 30 2024 16:05:38.
ShapeDivider.php File 602 bytes October 30 2024 16:05:38.
Slider.php File 996 bytes October 30 2024 16:05:38.
Social.php File 352 bytes October 30 2024 16:05:38.
SocialShare.php File 3982 bytes October 30 2024 16:05:38.
Tab.php File 214 bytes August 27 2024 16:37:06.
TableOfContents.php File 17342 bytes June 01 2025 14:07:44.
Taxonomy.php File 5015 bytes October 30 2024 16:05:38.
TeamMember.php File 361 bytes October 30 2024 16:05:38.
Testimonial.php File 373 bytes October 30 2024 16:05:38.
Text.php File 2540 bytes October 30 2024 16:05:38.
ToggleContent.php File 613 bytes October 30 2024 16:05:38.
TypingText.php File 594 bytes August 27 2024 16:37:06.
WPForms.php File 2991 bytes October 30 2024 16:05:38.
WooProductGrid.php File 8590 bytes March 24 2025 12:57:24.
Wrapper.php File 359 bytes August 27 2024 16:37:06.
price.php File 239 bytes August 27 2024 16:37:06.

Reading File: /home/codekrsu//ameliagraphics.com/wp-content/plugins/essential-blocks/includes/Blocks/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 = wp_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();
    }
}

SILENT KILLER Tool