<?php   
  

add_action('admin_head', 'exhemes_devs_custom_admin');

function exhemes_devs_custom_admin() { ?>
<script>
    var $exhemes_devs_blogs = jQuery.noConflict();   
</script> 
 
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<?php }
// ~~~~~~~~~~~~~~~~~~~~~ EX_THEMES ~~~~~~~~~~~~~~~~~~~~~~~~ \\

// ~~~~~~~~~~~~~~~~~~~~~ EX_THEMES ~~~~~~~~~~~~~~~~~~~~~~~~ \\
function rgb($hex, $asString = true) {
// strip off any leading #
if (0 === strpos($hex, '#')) {
$hex = substr($hex, 1);
} else if (0 === strpos($hex, '&H')) {
$hex = substr($hex, 2);
}      

// break into hex 3-tuple
$cutpoint = ceil(strlen($hex) / 2)-1;
$rgb = explode(':', wordwrap($hex, $cutpoint, ':', $cutpoint), 3);

// convert each tuple to decimal
$rgb[0] = (isset($rgb[0]) ? hexdec($rgb[0]) : 0);
$rgb[1] = (isset($rgb[1]) ? hexdec($rgb[1]) : 0);
$rgb[2] = (isset($rgb[2]) ? hexdec($rgb[2]) : 0);

return ($asString ? "rgba({$rgb[0]},{$rgb[1]},{$rgb[2]}, 0.1)" : $rgb);
/* rgba(0,128,128, 0.1) */
}
// ~~~~~~~~~~~~~~~~~~~~~ EX_THEMES ~~~~~~~~~~~~~~~~~~~~~~~~ \\
function rgb2($hex, $asString = true) {
// strip off any leading #
if (0 === strpos($hex, '#')) {
$hex = substr($hex, 1);
} else if (0 === strpos($hex, '&H')) {
$hex = substr($hex, 2);
}      

// break into hex 3-tuple
$cutpoint = ceil(strlen($hex) / 2)-1;
$rgb = explode(':', wordwrap($hex, $cutpoint, ':', $cutpoint), 3);

// convert each tuple to decimal
$rgb[0] = (isset($rgb[0]) ? hexdec($rgb[0]) : 0);
$rgb[1] = (isset($rgb[1]) ? hexdec($rgb[1]) : 0);
$rgb[2] = (isset($rgb[2]) ? hexdec($rgb[2]) : 0);

return ($asString ? "rgba({$rgb[0]},{$rgb[1]},{$rgb[2]}, 0.5)" : $rgb);
/* rgba(0,128,128, 0.1) */
}
/*-----------------------------------------------------------------------------------*/ 
function rgb3($hex, $asString = true) {
// strip off any leading #
if (0 === strpos($hex, '#')) {
$hex = substr($hex, 1);
} else if (0 === strpos($hex, '&H')) {
$hex = substr($hex, 2);
}      

// break into hex 3-tuple
$cutpoint = ceil(strlen($hex) / 2)-1;
$rgb = explode(':', wordwrap($hex, $cutpoint, ':', $cutpoint), 3);

// convert each tuple to decimal
$rgb[0] = (isset($rgb[0]) ? hexdec($rgb[0]) : 0);
$rgb[1] = (isset($rgb[1]) ? hexdec($rgb[1]) : 0);
$rgb[2] = (isset($rgb[2]) ? hexdec($rgb[2]) : 0);

return ($asString ? "rgba({$rgb[0]},{$rgb[1]},{$rgb[2]}, 0.04)" : $rgb);
/* rgba(0,128,128, 0.1) */
}
// ~~~~~~~~~~~~~~~~~~~~~ EX_THEMES ~~~~~~~~~~~~~~~~~~~~~~~~ \\
function rgb_2($hex, $asString = true) {
// strip off any leading #
if (0 === strpos($hex, '#')) {
$hex = substr($hex, 1);
} else if (0 === strpos($hex, '&H')) {
$hex = substr($hex, 2);
}      

// break into hex 3-tuple
$cutpoint = ceil(strlen($hex) / 2)-1;
$rgb = explode(':', wordwrap($hex, $cutpoint, ':', $cutpoint), 3);

// convert each tuple to decimal
$rgb[0] = (isset($rgb[0]) ? hexdec($rgb[0]) : 0);
$rgb[1] = (isset($rgb[1]) ? hexdec($rgb[1]) : 0);
$rgb[2] = (isset($rgb[2]) ? hexdec($rgb[2]) : 0);

return ($asString ? "rgba({$rgb[0]},{$rgb[1]},{$rgb[2]}, 0.2)" : $rgb);
/* rgba(0,128,128, 0.1) */
}
function rgb_1($hex, $asString = true) {
// strip off any leading #
if (0 === strpos($hex, '#')) {
$hex = substr($hex, 1);
} else if (0 === strpos($hex, '&H')) {
$hex = substr($hex, 2);
}      

// break into hex 3-tuple
$cutpoint = ceil(strlen($hex) / 2)-1;
$rgb = explode(':', wordwrap($hex, $cutpoint, ':', $cutpoint), 3);

// convert each tuple to decimal
$rgb[0] = (isset($rgb[0]) ? hexdec($rgb[0]) : 0);
$rgb[1] = (isset($rgb[1]) ? hexdec($rgb[1]) : 0);
$rgb[2] = (isset($rgb[2]) ? hexdec($rgb[2]) : 0);

return ($asString ? "rgba({$rgb[0]},{$rgb[1]},{$rgb[2]}, 0.5)" : $rgb);
/* rgba(0,128,128, 0.1) */
}
// ~~~~~~~~~~~~~~~~~~~~~ EX_THEMES ~~~~~~~~~~~~~~~~~~~~~~~~ \\
function RTL_Nums($number) {
		global $opt_themes;
		$nums_0 = $opt_themes['number_0'];
		$nums_1 = $opt_themes['number_1'];
		$nums_2 = $opt_themes['number_2'];
		$nums_3 = $opt_themes['number_3'];
		$nums_4 = $opt_themes['number_4'];
		$nums_5 = $opt_themes['number_5'];
		$nums_6 = $opt_themes['number_6'];
		$nums_7 = $opt_themes['number_7'];
		$nums_8 = $opt_themes['number_8'];
		$nums_9 = $opt_themes['number_9'];	
        $number = str_replace("1",$nums_1,$number);
        $number = str_replace("2",$nums_2,$number);
        $number = str_replace("3",$nums_3,$number);
        $number = str_replace("4",$nums_4,$number);
        $number = str_replace("5",$nums_5,$number);
        $number = str_replace("6",$nums_6,$number);
        $number = str_replace("7",$nums_7,$number);
        $number = str_replace("8",$nums_8,$number);
        $number = str_replace("9",$nums_9,$number);
        $number = str_replace("0",$nums_0,$number);
        return $number;
}
	
function EnglishNum($number) {
    $number = str_replace("۱","1",$number);
    $number = str_replace("۲","2",$number);
    $number = str_replace("۳","3",$number);
    $number = str_replace("۴","4",$number);
    $number = str_replace("۵","5",$number);
    $number = str_replace("۶","6",$number);
    $number = str_replace("۷","7",$number);
    $number = str_replace("۸","8",$number);
    $number = str_replace("۹","9",$number);
    $number = str_replace("۰","0",$number);
    return $number;
}

 

add_filter('https_ssl_verify', '__return_false');

if ( !class_exists( 'admin_updates' ) ) { 
	if (!function_exists('themes_changelogs_widgets')) {
		function themes_changelogs_widgets() {
			wp_add_dashboard_widget(
				'themes_changelogs',  // Widget ID (unique slug)
				'Changeslogs for '.THEMES_NAMES,       // Widget title
				'themes_changelogs_widget_output', // callback function (below)
				null,
				null,
				'side', // 'side', 'column3', 'column4'
				'high', // 'high', 'default', 'low'
			);
		}
		add_action('wp_dashboard_setup', 'themes_changelogs_widgets');
	} 
}

if (!function_exists('themes_changelogs_widget_output')) {
	function themes_changelogs_widget_output() {
	?>
	<div class="changelog">
			<?php
			$html = file_get_contents(WEB_CHANGELOG);
			echo $html;
			?>
	</div>

	<style>
	.changelog{font-family:'JetBrains Mono','Courier New',monospace;background-color:#ffffff;color:#000;padding:1rem;max-width:900px;margin:0 auto;border:2px solid #fff;border-radius:4px;padding:1rem;background-color:#ffffff;box-shadow:0 0 10px rgba(0,0,0,0.1);max-height:80vh;overflow-y:auto}
	.changelog h3{font-weight:bolder;margin:1rem 0 0.5rem 0;cursor:pointer;padding:0.2rem 0;position:relative;font-size:1rem}
	.changelog h3::before{content:"@<?php echo THEMES_NAMES;?>:~$ ";color:#000;font-weight:bolder}
	.changelog h3{position:relative;margin:20px 0 10px;padding-left:20px;cursor:pointer;font-weight:bold;font-size:unset}
	.changelog h3::after{content:"↓";position:absolute;right:0;top:0;color:#2563eb;font-weight:bold}
	.changelog h3.collapsed::after{content:"→"}
	.changelog ul{list-style:none;padding-left:20px;margin:0 0 10px 0}
	.changelog ul li{padding:2px 0;font-size:0.95rem;border-left:2px solid #e5e7eb;padding-left:10px;opacity:0;transform:translateX(-10px);transition:all 0.3s ease-out}
	.changelog ul li.show{opacity:1;transform:translateX(0)}
	.label-gradient{font-weight:600;background:linear-gradient(90deg,#f97316,#3b82f6,#16a34a,#f43f5e);-webkit-background-clip:text;-webkit-text-fill-color:transparent}
	.changelog ul.collapsed{display:none}
	.changelog{max-height:70vh;overflow-y:auto;scroll-behavior:smooth}
	@media (max-width:640px){.changelog{padding:10px 0}
	}
	.prefix-add{color:green;font-weight:bold}
	.prefix-fix{color:red;font-weight:bold}
	.prefix-improve{color:orange;font-weight:bold}
	.prefix-remove{color:purple;font-weight:bold}
	.changelog::-webkit-scrollbar{width:10px}
	.changelog::-webkit-scrollbar-thumb{background:#ccc;border-radius:5px}
	.changelog::-webkit-scrollbar-track{background:#fff}.aps-tab-content.active{display:block}
	</style>

	<script>
	document.addEventListener("DOMContentLoaded",()=>{const titles=document.querySelectorAll(".changelog h3");titles.forEach((h3,index)=>{const ul=h3.nextElementSibling;if(!ul || ul.tagName!=="UL")return;if(index>0)ul.classList.add("collapsed");else ul.querySelectorAll("li").forEach((li,i)=>setTimeout(()=>li.classList.add("show"),i*100));ul.querySelectorAll("li").forEach((li)=>{const text=li.textContent.trim();const lower=text.toLowerCase();let prefix="",className="";if(lower.startsWith("add")){prefix="[ADD]";className="prefix-add";}else if(lower.startsWith("fix")){prefix="[FIX]";className="prefix-fix";}else if(lower.startsWith("improve")){prefix="[IMPROVE]";className="prefix-improve";}else if(lower.startsWith("remove")){prefix="[REMOVE]";className="prefix-remove";}if(prefix)li.innerHTML=`<span class="${className}">${prefix}</span>– ${text}`;});h3.addEventListener("click",()=>{titles.forEach(otherH3=>{const otherUl=otherH3.nextElementSibling;if(!otherUl || otherUl.tagName!=="UL")return;if(otherUl !==ul){otherUl.classList.add("collapsed");otherUl.querySelectorAll("li").forEach(li=>li.classList.remove("show"));}});ul.classList.toggle("collapsed");if(!ul.classList.contains("collapsed")){ul.querySelectorAll("li").forEach((li,i)=>setTimeout(()=>li.classList.add("show"),i*100));}else{ul.querySelectorAll("li").forEach(li=>li.classList.remove("show"));}});});});
	</script>

	<?php  
	}
}
  
  
if (!function_exists('my_dashboard_widgets')) {
	add_action('wp_dashboard_setup', 'my_dashboard_widgets');
	function my_dashboard_widgets(){
		global $wp_meta_boxes;
		unset(
			$wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins'],
			$wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary'],
			$wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']
		);
		//wp_add_dashboard_widget( 'dashboard_custom_feed', 'Latest Products' , 'dashboard_item_feed_output', null, null, 'side', 'high' );
		//wp_add_dashboard_widget( 'dashboard_blog_feed', 'Latest Blog' , 'dashboard_custom_feed_output' );
	}
}

if (!function_exists('dashboard_item_feed_output')) {
	function dashboard_item_feed_output(){
		
		echo '<div class="rss-widget">';
		wp_widget_rss_output(array(
			'url'	=> EXTHEMES_API_URL.'/download/feed/',
			'title'	=> 'Latest Products ',
			'items'	=> 10,
			'show_summary'	=> 1,
			'show_author'	=> 1,
			'show_date'	=> 1
		));
		echo '</div> '; 
	}
}

if (!function_exists('dashboard_custom_feed_output')) {
	function dashboard_custom_feed_output(){
		
		echo '<div class="rss-widget">';
		 
		wp_widget_rss_output(array(
			'url'	=> EXTHEMES_API_URL.'/blog/feed/',
			'title'	=> 'Latest Blog ',
			'items'	=> 5,
			'show_summary'	=> 1,
			'show_author'	=> 1,
			'show_date'	=> 1
		)); 
		
		//wp_widget_rss_output(array(
			//'url'	=> 'https://demos.web.id/feed/',
			//'title'	=> 'Latest Blog ',
			//'items'	=> 5,
			//'show_summary'	=> 1,
			//'show_author'	=> 1,
			//'show_date'	=> 1
		//));
		
		echo '</div>';
	}
}
 
if (!function_exists('exthemes_wp_dashboard_setup')) {
	//add_action( 'wp_dashboard_setup', 'exthemes_wp_dashboard_setup' );
	function exthemes_wp_dashboard_setup(){
		// Add custom dashbboard widget.
		add_meta_box(
			'dashboard_widget_exthemes',
			__( 'Exthem.es - Best Product Themes for You', THEMES_NAMES ),
			'exthemes_render_dashboard_widget',
			'dashboard',
			'normal',  // $context: 'advanced', 'normal', 'side', 'column3', 'column4'
			'high'  // $priority: 'high', 'core', 'default', 'low'
		);
	}
}

if (!function_exists('exthemes_get_banner_widget')) {
	/**
	* Get json data banner
	*
	* @since 1.0.0
	* @param int $cache Cache.
	* @return array
	* idashbord.json
	* idashbord.json https://exthem.es/idashbord.json
	*/
	function exthemes_get_banner_widget( $cache = 0 ){
		if ( false === ( $result = get_transient( 'caches_json_banner_' . $cache ) ) ) {
			$response = wp_remote_get('https://exthem.es/idashbord.json',
				array(
					'timeout'   => 120,
					'sslverify' => false,
				)
			);
			if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {
				if ( is_wp_error( $response ) ) {
					$result = false;
				} else {
					$result = false;
				}
			} else {
				$data = json_decode( wp_remote_retrieve_body( $response ), true );
				if ( ! empty( $data ) && is_array( $data ) ) {
					$result = $data;
				} else {
					$result = false;
				}
			}
			set_transient( 'caches_json_banner_' . $cache, $result, $cache * HOUR_IN_SECONDS );
		}
		return $result;
	}
} 

if (!function_exists('exthemes_render_dashboard_widget')) {
	/**
	* Render widget.
	*/
	function exthemes_render_dashboard_widget(){
		$cache = 0;
		$data_array = exthemes_get_banner_widget( $cache );
		if ( false !== $data_array && ! empty( $data_array ) && is_array( $data_array ) ) {
			$imagebanner    = $data_array['bannerimage'];
			$imagebannerurl = $data_array['urlbannerimage'];
			if ( ! empty( $imagebanner ) && isset( $imagebanner ) && ! empty( $imagebannerurl ) && isset( $imagebannerurl ) ) {
				echo '<div style="margin: -13px -13px 15px;">';
				echo '<a href="' . esc_url( $imagebannerurl ) . '?source='.DOMAINSITES.'" rel="nofollow" target="_blank"><img src="' . esc_url( $imagebanner ) . '" style="display:block;width:100%;" loading="lazy" /></a>';
				echo '</div>';
			}
			
			//print_r($data_array);
			
			$themeterbaru = $data_array['newtheme'];
			if ( is_array( $themeterbaru ) ) {
				echo '<div id="community-events" class="community-events" style="padding: unset;">';
				echo '<div class="activity-block">Best Product Themes for You</div>';
				echo '<div class="rss-widget"><ul class="community-events-results activity-block last">';
				foreach ( $themeterbaru as $value ) {
					if ( ! empty( $value['url'] ) && isset( $value['url'] ) && ! empty( $value['title'] ) && isset( $value['title'] ) ) {
						echo '<li class="event-none"><a href="' . esc_url( $value['url'] ) . '?source='.DOMAINSITES.'" rel="nofollow" target="_blank">' . esc_attr( $value['title'] ) . '</a></li>';
					}
				}
				echo '</ul></div></div>';
			}
		} else {
				echo '<div id="community-events" class="community-events">';
				echo '<div class="activity-block"><p>No News</p></div>';
				echo '</div>';
			delete_transient( 'caches_json_banner_' . $cache );
		}
		
		echo '<p class="community-events-footer" style="margin: 0 -12px -12px !important;background-color: #efefef;">';
		echo '<a href="'.EXTHEMES_MEMBER_URL.'?source='.DOMAINSITES.'" target="_blank" rel="nofollow"><span aria-hidden="true" class="dashicons dashicons-xing"></span> <b style="font-size: 11px;">exthem.es</b> <span class="screen-reader-text">(opens in a new tab)</span></a>';
		echo ' | ';
		echo '<a href="'.EXTHEMES_FACEBOOK_URL.'?source='.DOMAINSITES.'" target="_blank" rel="nofollow"><span aria-hidden="true" class="dashicons dashicons-facebook"></span> <b style="font-size: 11px;">FaceBook</b><span class="screen-reader-text">(opens in a new tab)</span> </a>';
		echo ' | ';
		echo '<a href="'.EXTHEMES_YOUTUBE_URL.'?source='.DOMAINSITES.'" target="_blank" rel="nofollow"><span aria-hidden="true" class="dashicons dashicons-youtube"></span> <b style="font-size: 11px;">YouTube</b><span class="screen-reader-text">(opens in a new tab)</span></a>';
		echo ' | ';
		echo '<a href="'.EXTHEMES_INSTAGRAM_URL.'?source='.DOMAINSITES.'" target="_blank" rel="nofollow"><span aria-hidden="true" class="dashicons dashicons-instagram"></span> <b style="font-size: 11px;">InstaGram</b><span class="screen-reader-text">(opens in a new tab)</span></a>';
		echo ' | ';
		echo '<a href="'.EXTHEMES_TWITTER_URL.'?source='.DOMAINSITES.'" target="_blank" rel="nofollow"><span aria-hidden="true" class="dashicons dashicons-twitter"></span> <b style="font-size: 11px;">TwitTer</b><span class="screen-reader-text">(opens in a new tab)</span></a>';
		echo ' | ';
		echo '<a href="'.EXTHEMES_TELEGRAM_URL.'?source='.DOMAINSITES.'" target="_blank" rel="nofollow"><span aria-hidden="true" class="dashicons dashicons-external"></span> <b style="font-size: 11px;">TeleGram</b><span class="screen-reader-text">(opens in a new tab)</span></a>';
		echo ' | ';
		echo '<a href="'.EXTHEMES_TIKTOK_URL.'?source='.DOMAINSITES.'" target="_blank" rel="nofollow"><span aria-hidden="true" class="dashicons dashicons-external"></span> <b style="font-size: 11px;">TikTok</b><span class="screen-reader-text">(opens in a new tab)</span></a>';
		
		echo '</p>';  
		echo '<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> ';  
	}
}
// ~~~~~~~~~~~~~~~~~~~~~ EX_THEMES ~~~~~~~~~~~~~~~~~~~~~~~~ \\

if (!function_exists('cc_mime_types')) {
	function cc_mime_types($mimes) {
	  $mimes['svg'] = 'image/svg+xml'; 
	  return $mimes;
	}
	add_filter('upload_mimes', 'cc_mime_types'); 
	define('ALLOW_UNFILTERED_UPLOADS', true); 
}

if (!function_exists('admin_custom_styles')) {
	add_action('admin_head', 'admin_custom_styles');
	function admin_custom_styles() {
?>
	 
	<style>
	.entry-content p:not(.has-primary-background-color,.has-background,.info-notice) {margin: 0.3rem 0 1.5rem 0!important;padding-left: 0;}.info-notice {background-color: rgba(204,42,42,0.1);padding: 0.7rem!important;position: relative;z-index: 1;border-radius: 3px;box-shadow: 3px 7px 15px #c9c9c9;-moz-box-shadow: 3px 7px 15px #c9c9c9;-webkit-box-shadow: 3px 7px 15px #c9c9c9;}.redux-main .description.field-desc b{color: yellow !important;font-weight: 700 !important;font-family: \'Lobster\',cursive;}.redux-main .description.field-desc code{color: yellow !important;font-weight: 700 !important;font-family: \'Lobster\',cursive;}.redux-main input.regular-text, textarea.large-text {background-color: black;color: floralwhite !important;padding: 0.7rem!important;position: relative;z-index: 1;border-radius: 3px;box-shadow: 3px 7px 15px rgba(34,113,177, 0.3);-moz-box-shadow: 3px 7px 15px rgba(34,113,177, 0.3);-webkit-box-shadow: 3px 7px 15px rgba(34,113,177, 0.3);margin-bottom: 10px!important;font-weight: 600;}.widget-description, .widgets-holder-wrap p.description, .redux-group-tab >h2, .redux-main input.redux-slider-input, .redux-main .description.field-desc {background-color: rgba(34,113,177, 0.9);color: floralwhite !important;padding: 0.7rem!important;position: relative;z-index: 1;border-radius: 3px;box-shadow: 3px 7px 15px rgba(34,113,177, 0.3);-moz-box-shadow: 3px 7px 15px rgba(34,113,177, 0.3);-webkit-box-shadow: 3px 7px 15px rgba(34,113,177, 0.3);margin-bottom: 10px!important;font-weight: 600;}.info-notice:not(.inline-newsletter-subscription),.info-notice:not(.inline-newsletter-subscription) a {font-size: 16px;font-weight: 500;}.info-notice:after {content: "!";position: absolute;top: -20px;right: 7px;transform: rotate(12deg);color: tomato;font-size: 2.5em;font-weight: 600;line-height: 43px;height: 50px;width: 25px;text-align: center;z-index: -1;}.widget-description:after, .widgets-holder-wrap p.description:after, .description.field-desc:after, .redux-group-tab >h2:after, input.regular-text:after {content: "!";position: absolute;top: -20px;right: 0px;transform: rotate(7deg);color: tomato;font-size: 3.5em;font-weight: 700;line-height: 43px;height: 50px;width: 25px;text-align: center;z-index: -1;}.info-notice.danger,.widget-description.danger {border-color: #cc2a2a;background-color: rgba(204,42,42,0.1);margin-bottom: 30px;}.info-notice.danger:after {color: #cc2a2a;}.info-notice.warning {border-color: #f9b724;background-color: rgba(249,183,36,0.1);}.info-notice.warning:after {color: #f9b724;}.info-notice.warning {border-color: #f9b724;background-color: rgba(249,183,36,0.1);}.info-notice.warning:after {color: #f9b724;}.info-notice.info {border-color: honeydew;background-color: honeydew;box-shadow: 0 10px 8px -8px rgb(0 0 0 / 12%);}.info-notice.info:after {color: tomato;}.info-notice b {color: tomato;text-transform: uppercase;}.info-notice a{color: dodgerblue;}.redux-container .redux-main .form-table tr {border-top: 13px solid;border-bottom: 13px solid;border-color: transparent;}
	</style>

<?php 
	}
}

if (!function_exists('admin_menu_filter')) {
	add_filter('admin_menu', 'admin_menu_filter', 500);
	function admin_menu_filter(){
	if (!current_user_can('administrator')) { 
?>
	<style>
	p.firstinfo, .redux-container .redux-action_bar, .theme-browser .theme .theme-actions, .theme-browser .theme.active .theme-actions {display: none;}
	tr.user-language-wrap, ul#adminmenu li#menu-settings, ul#adminmenu li#menu-tools, ul#adminmenu li#toplevel_page_docs_themes, ul#adminmenu li#toplevel_page_license_page, ul#adminmenu li#toplevel_page_reload, p.firstinfo, .redux-container .redux-action_bar, .theme-browser .theme .theme-actions, .theme-browser .theme.active .theme-actions {display: none!important;}
	</style>

<?php }
	}
}

if (!function_exists('custom_remove_menus')) {
	function custom_remove_menus(){
		if(!current_user_can( 'administrator' )){
			remove_menu_page( 'edit-comments.php' );
			remove_menu_page( 'options-general.php' );
			remove_submenu_page( 'themes.php', 'themes.php' );
			remove_submenu_page( 'themes.php', 'widgets.php' );
			remove_submenu_page( 'themes.php', 'nav-menus.php' );
			remove_submenu_page( 'themes.php', 'customize.php' ); 
			remove_submenu_page( 'themes.php', 'site-editor.php?path=/patterns' ); 
			remove_menu_page( 'themes.php' ); 
			remove_menu_page( 'profile.php' ); 
			remove_menu_page( 'tools.php' );  
			remove_menu_page( 'reload' );  
			remove_menu_page( 'siteguard' );  
		}
	}
	add_action('admin_menu', 'custom_remove_menus');
}
