// change post link to display published products only
function wcs_change_admin_product_link() {
global $submenu;
$submenu['edit.php?post_type=product'][5][2] = 'edit.php?post_type=product&post_status=publish';
}
add_action( 'admin_menu', 'wcs_change_admin_product_link' );
admin
remove woo ads
// Fix woo ads: add_filter('woocommerce_allow_marketplace_suggestions', '__return_false');
// Fix Jetpack ads: add_filter( 'jetpack_show_promotions', '__return_false', 20 );
hide admin notices
add_action(
'admin_head',
function() {
remove_action( 'admin_notices', 'update_nag', 3 );
}
);
turn off admin email check
// turn off admin email check
add_filter( 'admin_email_check_interval', '__return_false' );
change recovery mode email address
// change recovery mode email address.
add_filter( 'recovery_mode_email', function( $email_data ) {
$email_data['to'] = 'your_email@yoursite.com';
return $email_data;
});
google analytics
// Include the Google Analytics Tracking Code (ga.js)
// @ https://developers.google.com/analytics/devguides/collection/gajs/
function google_analytics_tracking_code(){
$propertyID = 'UA-XXXXXX-1'; // GA Property ID ADD THIS FOR EVERY SITE
if ($options['ga_enable']) { ?>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '<?php echo $propertyID; ?>']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<?php }
}
// include GA tracking code before the closing head tag
//add_action('wp_head', 'google_analytics_tracking_code');
// OR include GA tracking code before the closing body tag
add_action('wp_footer', 'google_analytics_tracking_code');
change admin email from name
// change email sender name for admin posts
function ec_mail_name( $email ){
return 'form robot fontaholic.biz'; // new email name from sender.
}
add_filter( 'wp_mail_from_name', 'ec_mail_name' );
display published as post list default
// change page link to display published pages only
function wcs_change_admin_page_link() {
global $submenu;
$submenu['edit.php?post_type=page'][5][2] = 'edit.php?post_type=page&post_status=publish';
}
add_action( 'admin_menu', 'wcs_change_admin_page_link' );
// change post link to display published posts only
function wcs_change_admin_post_link() {
global $submenu;
$submenu['edit.php'][5][2] = 'edit.php?post_status=publish';
}
add_action( 'admin_menu', 'wcs_change_admin_post_link' );