403Webshell
Server IP : 5.129.245.98  /  Your IP : 216.73.216.246
Web Server : Apache/2.4.66 (Debian)
System : Linux 1b8c17c336b9 6.8.0-111-generic #111-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 11 23:16:02 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.3.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/html/wp-content/plugins/rehub-framework/gutenberg/blocks/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/wp-content/plugins/rehub-framework/gutenberg/blocks/class-colorheading.php
<?php

namespace Rehub\Gutenberg\Blocks;

defined( 'ABSPATH' ) OR exit;

class ColorHeading extends Basic {
	protected $name = 'color-heading';

	protected $attributes = array(
		'title'           => array(
			'type'    => 'string',
			'default' => '',
		),
		'titleTag'        => array(
			'type'    => 'string',
			'default' => 'h2',
		),
		'subtitle'        => array(
			'type'    => 'string',
			'default' => '',
		),
		'backgroundColor' => array(
			'type'    => 'string',
			'default' => '#ebf2fc',
		),
		'titleColor'      => array(
			'type'    => 'string',
			'default' => '#111'
		),
		'subtitleColor'   => array(
			'type'    => 'string',
			'default' => '#111'
		),
	);

	protected function render( $settings = array(), $inner_content = '' ) {
		$html            = '';
		$title           = esc_html($settings['title']);
		$subtitle        = esc_html($settings['subtitle']);
		$styles          = 'background-color:' . $settings['backgroundColor'] . ';';
		$title_styles    = 'color:' . $settings['titleColor'] . ';';
		$subtitle_styles = 'color:' . $settings['subtitleColor'] . ';';
		$allowed_tags = array('h1', 'h2', 'h3', 'h4', 'h5', 'h6');
		$title_tag        = in_array($settings['titleTag'], $allowed_tags) ? $settings['titleTag'] : 'h2';

		if ( empty( $title ) && empty( $subtitle ) ) {
			return;
		}
		$anchormatches = preg_match( '/id="([^"]*)"/', $inner_content, $matches );
		
		if(!empty($matches[1])){
			$anchor = $matches[1];
		}else{
			$anchor = rh_convert_cyr_symbols($subtitle);
			$anchor = str_replace(array('\'', '"'), '', $anchor); 
			$spec = preg_quote( '\'.+$*~=' );
			$anchor = preg_replace("/[^a-zA-Z0-9_$spec\-]+/", '-', $anchor );
			$anchor = strtolower( trim( $anchor, '-') );
			$anchor = substr( $anchor, 0, 70 );
		}


	    $paddingcss = (\REHub_Framework::get_option('rehub_content_shadow')) ? '' : ' pr25 pl25';

		$html .= '<div class="rh-color-heading alignfull pt30 pb30 blackcolor mb35" style="' . esc_attr( $styles ) . '">';
		$html .= '<style>.main-side:not(.alignfulloutside):not(.fullgutenberg) .rh-color-heading .rh-container{width:auto;}</style>';
		$html .= '	<div class="rh-container'.$paddingcss.'">';
		$html .= '			<p id="'.$anchor.'" class="mb15 font130" style="' . esc_attr( $subtitle_styles ) . '">';
		$html .= '			' . $subtitle . '';
		$html .= '			</p>';
		$html .= '			<' . $title_tag . ' class="mt0 mb10 font200" style="' . esc_attr( $title_styles ) . '">';
		$html .= '			' . $title . '';
		$html .= '			</' . $title_tag . '>';
		$html .= '	</div>';
		$html .= '</div>';

		echo $html;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit