__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
namespace EssentialBlocks\Blocks;
use EssentialBlocks\Core\Block;
use EssentialBlocks\Utils\Helper;
class Taxonomy extends Block
{
protected $frontend_styles = [ 'essential-blocks-fontawesome' ];
/**
* Unique name of the block.
*
* @return string
*/
public function get_name()
{
return 'taxonomy';
}
protected static $default_attributes = [
'source' => 'current-post',
'selectedTaxonomy' => '',
'prefixType' => 'none',
'prefixIcon' => 'fas fa-list',
'prefixText' => 'Prefix Text',
'suffixType' => 'none',
'suffixIcon' => 'fas fa-list',
'suffixText' => 'Suffix Text',
'displayStyle' => 'display-inline',
'showSeparator' => false,
'separator' => "|",
'taxonomyLimit' => 1
];
/**
* Block render callback.
*
* @param mixed $attributes
* @param mixed $content
* @return mixed
*/
public function render_callback( $attributes, $content )
{
if ( is_admin() ) {
return;
}
$attributes = wp_parse_args( $attributes, self::$default_attributes );
$className = isset( $attributes[ "className" ] ) ? $attributes[ "className" ] : "";
$classHook = isset( $attributes[ 'classHook' ] ) ? $attributes[ 'classHook' ] : '';
$prefixType = isset( $attributes[ 'prefixType' ] ) ? $attributes[ 'prefixType' ] : '';
$suffixType = isset( $attributes[ 'suffixType' ] ) ? $attributes[ 'suffixType' ] : '';
if ( $attributes[ 'source' ] === 'current-post' ) {
$terms = get_the_terms( get_the_ID(), $attributes[ 'selectedTaxonomy' ] );
if ( is_array( $terms ) && ! empty( $terms ) && ! empty( $attributes[ 'taxonomyLimit' ] ) && $attributes[ 'taxonomyLimit' ] !== -1 ) {
$terms = array_slice( $terms, 0, $attributes[ 'taxonomyLimit' ] );
}
} else {
$args = [
'taxonomy' => $attributes[ 'selectedTaxonomy' ],
'hide_empty' => false
];
if ( $attributes[ 'taxonomyLimit' ] !== -1 ) {
$args[ 'number' ] = $attributes[ 'taxonomyLimit' ];
}
$terms = get_terms( $args );
}
$categories = '';
if ( ! empty( $terms ) ) {
$categories .= '<div class="eb-tax-wrap">';
foreach ( $terms as $term ) {
$categories .= sprintf(
'<span class="eb-tax-item"><a href="%1$s" title="%2$s">%2$s</a></span>',
esc_attr( esc_url( get_category_link( $term->term_id ) ) ),
esc_html( $term->name )
);
if ( $attributes[ 'showSeparator' ] ) {
$categories .= sprintf( '<span class="eb-tax-separator">%1$s</span>', esc_html( $attributes[ 'separator' ] ) );
}
}
$categories .= '</div>';
} else {
return;
}
if ( $prefixType !== 'none' ) {
if ( $prefixType === 'icon' ) {
$prefix_icon = sprintf(
'%1$s',
Helper::eb_render_icon( Helper::eb_get_icon_type( $attributes[ 'prefixIcon' ] ), 'eb-button-icon', $attributes[ 'prefixIcon' ] )
);
$prefix_markup = sprintf(
'<div class="prefix-wrap">%1$s</div>',
$prefix_icon
);
}
if ( $prefixType === 'text' ) {
$prefix_markup = sprintf(
'<div class="prefix-wrap"><span>%1$s</span></div>',
$attributes[ 'prefixText' ]
);
}
} else {
$prefix_markup = '';
}
if ( $suffixType !== 'none' ) {
if ( $suffixType === 'icon' ) {
$suffix_icon = sprintf(
'%1$s',
Helper::eb_render_icon( Helper::eb_get_icon_type( $attributes[ 'suffixIcon' ] ), 'eb-button-icon', $attributes[ 'suffixIcon' ] )
);
$suffix_markup = sprintf(
'<div class="suffix-wrap">%1$s</div>',
$suffix_icon
);
}
if ( $suffixType === 'text' ) {
$suffix_markup = sprintf(
'<div class="suffix-wrap"><span>%1$s</span></div>',
$attributes[ 'suffixText' ]
);
}
} else {
$suffix_markup = '';
}
ob_start();
Helper::views( 'taxonomy', array_merge( $attributes, [
'className' => $className,
'classHook' => $classHook,
'categories' => $categories,
'prefix_markup' => $prefix_markup,
'suffix_markup' => $suffix_markup
] ) );
return ob_get_clean();
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| Accordion.php | File | 1.03 KB | 0640 |
|
| AccordionItem.php | File | 335 B | 0640 |
|
| AddToCart.php | File | 3.43 KB | 0640 |
|
| AdvancedHeading.php | File | 5.73 KB | 0640 |
|
| AdvancedImage.php | File | 2.77 KB | 0640 |
|
| AdvancedNavigation.php | File | 703 B | 0640 |
|
| AdvancedTabs.php | File | 886 B | 0640 |
|
| AdvancedVideo.php | File | 1021 B | 0640 |
|
| Breadcrumbs.php | File | 11.37 KB | 0640 |
|
| Button.php | File | 3.82 KB | 0640 |
|
| CallToAction.php | File | 365 B | 0640 |
|
| Column.php | File | 220 B | 0640 |
|
| CountDown.php | File | 605 B | 0640 |
|
| DualButton.php | File | 666 B | 0640 |
|
| FeatureList.php | File | 332 B | 0640 |
|
| FlexContainer.php | File | 371 B | 0640 |
|
| FlipBox.php | File | 648 B | 0640 |
|
| FluentForms.php | File | 3.77 KB | 0640 |
|
| Form.php | File | 5.72 KB | 0640 |
|
| FormTextField.php | File | 246 B | 0640 |
|
| GoogleMap.php | File | 2.55 KB | 0640 |
|
| Icon.php | File | 323 B | 0640 |
|
| ImageComparison.php | File | 620 B | 0640 |
|
| ImageGallery.php | File | 2.26 KB | 0640 |
|
| InfoBox.php | File | 761 B | 0640 |
|
| InstagramFeed.php | File | 5.89 KB | 0640 |
|
| InteractivePromo.php | File | 321 B | 0640 |
|
| LottieAnimation.php | File | 608 B | 0640 |
|
| NftGallery.php | File | 649 B | 0640 |
|
| Notice.php | File | 580 B | 0640 |
|
| NumberCounter.php | File | 598 B | 0640 |
|
| Openverse.php | File | 480 B | 0640 |
|
| ParallaxSlider.php | File | 664 B | 0640 |
|
| PopUp.php | File | 625 B | 0640 |
|
| PostBlock.php | File | 1.57 KB | 0640 |
|
| PostCarousel.php | File | 4.62 KB | 0640 |
|
| PostGrid.php | File | 5.79 KB | 0640 |
|
| PostMeta.php | File | 7.24 KB | 0640 |
|
| PricingTable.php | File | 333 B | 0640 |
|
| ProductDetails.php | File | 3.51 KB | 0640 |
|
| ProductImages.php | File | 2.83 KB | 0640 |
|
| ProductPrice.php | File | 4.75 KB | 0640 |
|
| ProductRating.php | File | 2.97 KB | 0640 |
|
| ProgressBar.php | File | 604 B | 0640 |
|
| Row.php | File | 455 B | 0640 |
|
| ShapeDivider.php | File | 602 B | 0640 |
|
| Slider.php | File | 1.09 KB | 0640 |
|
| Social.php | File | 352 B | 0640 |
|
| SocialShare.php | File | 3.89 KB | 0640 |
|
| Tab.php | File | 214 B | 0640 |
|
| TableOfContents.php | File | 17.38 KB | 0640 |
|
| Taxonomy.php | File | 4.92 KB | 0640 |
|
| TeamMember.php | File | 361 B | 0640 |
|
| Testimonial.php | File | 373 B | 0640 |
|
| Text.php | File | 5.17 KB | 0640 |
|
| ToggleContent.php | File | 613 B | 0640 |
|
| TypingText.php | File | 594 B | 0640 |
|
| WPForms.php | File | 2.92 KB | 0640 |
|
| WooProductGrid.php | File | 8.39 KB | 0640 |
|
| Wrapper.php | File | 359 B | 0640 |
|
| price.php | File | 239 B | 0640 |
|