HEX
Server: Apache
System: Linux vps75080.inmotionhosting.com 3.10.0-1160.119.1.vz7.224.4 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64
User: reachcon (1003)
PHP: 7.2.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/reachcon/www/wp-content/themes/reach-connects/functions.php
<?php
require(get_template_directory().'/omada.php');
$omada = new omadaTheme(array(






'blocks'=>array(
			// Common
				'core/paragraph'=>true,
				'core/image'=>false,
				'core/heading'=>true,
				'core/subhead'=>true,
				'core/gallery'=>false,
				'core/list'=>true,
				'core/quote'=>true,
				'core/audio'=>false,
				'core/cover-image'=>true,
				'core/file'=>true,
				'core/video'=>true,
			
			// Formatting
				'core/table'=>true,
				'core/verse'=>true,
				'core/code'=>true,
				'core/freeform'=>true,
				'core/html'=>true,
				'core/preformatted'=>true,
				'core/pullquote'=>true,

			// Layout Elements
				'core/button'=>true,
				'core/text-columns'=>false,// — Columns
				'core/more'=>true,
				'core/nextpage'=>true, // — Page break
				'core/separator'=>true,
				'core/spacer'=>true,
				
			// Widgets
				'core/shortcode'=>true,
				'core/archives'=>true,
				'core/categories'=>true,
				'core/latest-comments'=>true,
				'core/latest-posts'=>true,
			
			// Embeds
				'core/embed'=>false,
				'core-embed/twitter'=>false,
				'core-embed/youtube'=>false,
				'core-embed/facebook'=>false,
				'core-embed/instagram'=>false,
				'core-embed/wordpress'=>false,
				'core-embed/soundcloud'=>false,
				'core-embed/spotify'=>false,
				'core-embed/flickr'=>false,
				'core-embed/vimeo'=>false,
				'core-embed/animoto'=>false,
				'core-embed/cloudup'=>false,
				'core-embed/collegehumor'=>false,
				'core-embed/dailymotion'=>false,
				'core-embed/funnyordie'=>false,
				'core-embed/hulu'=>false,
				'core-embed/imgur'=>false,
				'core-embed/issuu'=>false,
				'core-embed/kickstarter'=>false,
				'core-embed/meetup-com'=>false,
				'core-embed/mixcloud'=>false,
				'core-embed/photobucket'=>false,
				'core-embed/polldaddy'=>false,
				'core-embed/reddit'=>false,
				'core-embed/reverbnation'=>false,
				'core-embed/screencast'=>false,
				'core-embed/scribd'=>false,
				'core-embed/slideshare'=>false,
				'core-embed/smugmug'=>false,
				'core-embed/speaker'=>false,
				'core-embed/ted'=>false,
				'core-embed/tumblr'=>false,
				'core-embed/videopress'=>false,
				'core-embed/wordpress-tv'=>false,
				
			// Omada Blocks
				'omada/accordion'=>true,
				'omada/calendar'=>true,
				'omada/cards'=>true,
				'omada/classiceditor'=>true,
				'omada/customfeed'=>true,
				'omada/flipbook'=>true,
				'omada/form'=>true,
				'omada/omadagallery'=>true,
				'omada/album'=>true,
				'omada/htmleditor'=>true,
				'omada/omadaimage'=>true,
				'omada/omadaimageheader'=>true,
				'omada/omadamenu'=>true,
				'omada/omadarow'=>true,
				'omada/slideshow'=>true,
				'omada/tabs'=>true,
				'omada/youtube'=>true,	

				'acf/home-services'=>true,
				'omada/home-services'=>true,
				'home-services'=>true,
				
		),
	
));
$omadaLayout = new omadaLayout();
// $omadaClient = new omadaClient();

// FORM SETTINGS OPTINAL
$omada->formSettings=array(
	'emailHeader' => '<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body style="background:#ccc;padding:20px 0px;"><div class="callout" style="width:90%;max-width:600px;margin:0 auto;padding:15px;background:ghostwhite;border-radius:12px;"><table width="100%">',
	'emailFooter' => '</table></div></body></html>'
);

function loadGutenbergStyles() {
	// Load the theme styles within Gutenberg.
	global $current_screen;
	$current_screen = get_current_screen();
	if ( method_exists($current_screen, 'is_block_editor') && $current_screen->is_block_editor() ) {
		
		wp_enqueue_style( 'swiper', get_template_directory_uri().'/inc/js/swiper/swiper.min.css', false, '@@pkg.version', 'all' );
		wp_enqueue_style( 'browserFixes', get_stylesheet_directory_uri().'/css/browser-fixes.css', false, '@@pkg.version', 'all' );
		wp_enqueue_style( 'themeContainers', get_stylesheet_directory_uri().'/css/containers.css', false, '@@pkg.version', 'all' );
		wp_enqueue_style( 'themeForms', get_stylesheet_directory_uri().'/css/forms.css', false, '@@pkg.version', 'all' );
		wp_enqueue_style( 'themeGrid', get_stylesheet_directory_uri().'/css/grid.css', false, '@@pkg.version', 'all' );
		wp_enqueue_style( 'themeMenus', get_stylesheet_directory_uri().'/css/menus.css', false, '@@pkg.version', 'all' );
		wp_enqueue_style( 'themeMisc', get_stylesheet_directory_uri().'/css/misc.css', false, '@@pkg.version', 'all' );
		wp_enqueue_style( 'themeTypography', get_stylesheet_directory_uri().'/css/typography.css', false, '@@pkg.version', 'all' );
		wp_enqueue_style( 'fullCalendar', get_template_directory_uri().'/inc/js/fullcalendar/fullcalendar.min.css' ); 
		
		wp_enqueue_style( 'themeStylesheet', get_stylesheet_directory_uri().'/style.css', false, '@@pkg.version', 'all' );
		
		wp_enqueue_style( 'themeAdminOverride', get_template_directory_uri().'/inc/css/gutenbergFixes.css', false, '@@pkg.version', 'all' );
		

		// SCRIPTS
		wp_enqueue_script( 'Foundation', get_template_directory_uri().'/inc/js/foundation.min.js', false, '@@pkg.version', 'all' );
		wp_enqueue_script( 'BlockFunctions', get_template_directory_uri().'/inc/plugins/blocks/blockFunctions.js', false, '@@pkg.version', 'all');
		
		//////////// ADD FULL CALENDAR IF CALENDAR IS ACTIVE FOR BLOCK
		wp_enqueue_script( 'moment', get_template_directory_uri().'/inc/js/fullcalendar/lib/moment.min.js' );
		wp_enqueue_script( 'fullCalendar', get_template_directory_uri().'/inc/js/fullcalendar/fullcalendar.min.js',array('moment') );
		wp_enqueue_script( 'LazyLoad', get_template_directory_uri().'/inc/js/lazyload.js', false, '@@pkg.version', 'all');
		
		// set js variable for max width
		add_action('admin_head', function(){ echo '<script>var omadaThemeWidth="'.get_field('omada_page_width','option').'";</script>'; });
	}
	
}
add_action( 'enqueue_block_editor_assets', 'loadGutenbergStyles', 999 );





if( function_exists('acf_register_block_type') ) { add_action('init', 'register_acf_block_types'); }

function register_acf_block_types(){
	acf_register_block_type(array('name'=>'home-services','title'=> __('Home Services'),'description'=>__('Home Services Row System'),'render_callback'=>'customBlockHandler','category'=>'common','keywords'=>array('services','home','omada'),'mode'=>'preview','supports'=>array( 'align'=>false, 'customClassName'=>false )));
	$block_types = WP_Block_Type_Registry::get_instance()->get_all_registered();
}

// Load Block Template based on slug
function customBlockHandler( $block ) {
	$slug = str_replace('acf/', '', strtolower($block['name'])); 
	if(file_exists(get_stylesheet_directory()."/page-templates/{$slug}.php")){include(get_stylesheet_directory()."/page-templates/{$slug}.php");}else{ echo '<h1>ERROR</h1><h2>Missing Template</h2><p>The following template is missing.</p><p>'.get_stylesheet_directory()."/inc/plugins/blocks/templates/{$slug}.php".'</p>';}
}


add_shortcode('blogfeed','blogfeed');
function blogfeed(){
	$x='';	
	$args = array( 'post_type'=>'post', 'posts_per_page'=>'1' );
	$the_query = new WP_Query( $args );
	while ( $the_query->have_posts() ){
		$the_query->the_post();
		$thumbnail_id = get_post_thumbnail_id( get_the_ID() );
		$featured_img_url = get_the_post_thumbnail_url(get_the_ID(),'full');
		$permalink = get_the_permalink(get_the_ID());
		$alt = get_post_meta($thumbnail_id, '_wp_attachment_image_alt', true);
		$x= '<div class="grid-x align-center"><div class="large-12 cell"><div class="grid-x">';
		$x.= '<div class="large-4 xlarge-5 cell">';
			$x.= '<div class="content"><h2>Tech Tips</h2>';
				$x.= '<a href="'.$permalink.'"><h3>'.get_the_title(get_the_ID()).'</h3>';
				$x.= '<p class="date">'.get_the_date("l F j, Y").'</p>';
				$x.= '<p>'.get_the_excerpt(get_the_ID()).'</p>';
				$x.= '<p class="nm">';
				$x.= '<button class="button mr">Read More</button><br class="hide-for-large"><a href="#"><button class="button">View all Tech Tips</button></a>';
				$x.= '</p>';
			$x.= '</div>';
		$x.= '</div>';
		$x.= '<div class="large-8 xlarge-7 cell">';
			$x.= '<img src="'.$featured_img_url.'" alt="'. $alt.'" class="fw lh">';
		$x.= '</div>';
		$x.= '</div>';
		$x.= '</div>';
		$x.= '</div></a>';
		// Reset Post Data
		wp_reset_postdata();
		return $x;
	}

}
add_shortcode('PS','PS');
function PS(){
	global $post;
	$x.='<div class="ps"><div class="grid-x align-center"><div class="large-10 cell">';
	$x.='<h2 class="text-center">Products & Services</h2>';
	$x.='<div class="grid-x grid-padding-x large-up-4 spc align-center" data-equalizer data-equalize-on="medium">';
	
	if( have_rows('products_and_services',$post->ID) ):
		while( have_rows('products_and_services',$post->ID) ) : the_row();

			// Load sub field value.
			$title = get_sub_field('title');
				$x.='<div class="cell"><div class="singlePS"><h3 data-equalizer-watch>'.$title.'</h3></div></div>';
		
		endwhile;
	endif;

	
	$x.='</div></div></div></div>';
	return $x;
}



// include('api.php');