HEX
Server: nginx/1.24.0
System: Linux nowruzgan 6.8.0-57-generic #59-Ubuntu SMP PREEMPT_DYNAMIC Sat Mar 15 17:40:59 UTC 2025 x86_64
User: babak (1000)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/www/chaharrah.tv/root/wp-content/themes/chaharrah/_includes/theme-hacks.php
<?php
if ( !current_user_can( 'edit_users' ) ) {
  add_action( 'init', create_function( '$a', "remove_action( 'init', 'wp_version_check' );" ), 2 );
  add_filter( 'pre_option_update_core', create_function( '$a', "return null;" ) );
}
//hook the administrative header output
add_action('admin_head', 'my_custom_logo');

function my_custom_logo() {
   echo '
      <style type="text/css">
        
      </style>
   ';
}

add_filter('admin_menu_editor_is_pro', 'ame_is_pro');
function ame_is_pro() {
  return true;
}
 
 function example_remove_dashboard_widgets() {
	// Globalize the metaboxes array, this holds all the widgets for wp-admin
 	global $wp_meta_boxes;

	// Remove the incomming links widget
	unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);	
	unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);	

	// Remove right now
	unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
	unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
	unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
}

// Hoook into the 'wp_dashboard_setup' action to register our function
add_action('wp_dashboard_setup', 'example_remove_dashboard_widgets' );
 
 
function hide_admin_menu()
{
	return; //------------------------------------
	global $current_user;
	get_currentuserinfo();
 
	if($current_user->user_login != 'designer' and $current_user->user_login != 'admin')
	{
		echo '<style type="text/css">#toplevel_page_edit-post_type-acf{display:none;}
		
		</style>';
	}
	if($current_user->user_login != 'designer' and $current_user->user_login != 'admin' and $current_user->user_login != 'babak')
	{
		echo '
		
		
		 #wp-admin-bar-wp-logo { display:none!important; }
		 .cf7com-links{ display:none!important; }
		 #acf-col-right{display:none!important; }
		 #acf-col-left{margin-right: 0px!important; }
		li#toplevel_page_wp-jalali-wp-jalali{display:none!important;}
		#welcome-panel{display:none!important;}
		#dashboard_quick_press{display:none!important;}
		.column-viewscolumn{display:none!important;}
		#members-donate{display:none!important;}
		#members-about{display:none!important;}
		#members-support{display:none!important;}
		.inn{display:none!important;}
		#menu-comments{display:none!important;}
		#mohtava-adder{display:none!important;}
		#options-adder{display:none!important;}
		#toplevel_page_wpcf7,#menu-settings,#menu-tools,#menu-users,#menu-plugins,#contextual-help-link-wrap{display:none!important;}
		
		</style>';
	}
}
 
add_action('admin_head', 'hide_admin_menu');


add_filter( 'admin_footer_text', 'my_admin_footer_text' );
function my_admin_footer_text( $default_text ) {
     return '<span id="footer-thankyou">طراحی توسط <a href="http://www.shomalgan.com">شمالگان</a><span>';
}
// hook the translation filters
add_filter(  'gettext',  'change_post_to_article'  );
add_filter(  'ngettext',  'change_post_to_article'  );

function change_post_to_article( $translated ) {
     $translated = str_ireplace(  'نوشته‌ها',  'محتوا',  $translated );  // ireplace is PHP5 only
     return $translated;
}

add_action("login_head", "my_login_head");
function my_login_head() {
	echo "
	<style>
	body.login #login h1 a {
		background: url('".get_bloginfo('template_url')."/images/png.png') no-repeat scroll center top transparent;
		height: 68px;
		width: 320px;
	}
	</style>
	";
}







 ?>