Beecee – Remove fields from wp-admin for none admin

// Remove User Enrolled in Groupe function remove_website_row_enrolled_in_group_css() { if ( ! current_user_can( ‘administrator’ ) ) { echo ‘tr.user-rich-editing-wrap{ display: none; }’; echo ‘tr.user-admin-color-wrap{ display: none; }’; echo ‘tr.user-comment-shortcuts-wrap{ display: none; }’; echo ‘tr.user-admin-bar-front-wrap{ display: none; }’; echo ‘tr.user-language-wrap{ display:…Continue reading

Beecee – Get User First Name

/** Beecee Function to get User First Name */ function get_current_userfirstname() { $current_user = wp_get_current_user(); return $current_user->user_firstname; } add_shortcode(‘current_userFirstname’, ‘get_current_userfirstname’);Continue reading

Disable Posts Post Type

// Remove side menu add_action( ‘admin_menu’, function () { remove_menu_page( ‘edit.php’ ); } ); // Remove +New post in top Admin Menu Bar add_action( ‘admin_bar_menu’, function ( $wp_admin_bar ) { $wp_admin_bar->remove_node( ‘new-post’ ); }, 999 ); // Remove Quick Draft…Continue reading

Allow SVG Files Upload (copy)

/** * Allow SVG uploads for administrator users. * * @param array $upload_mimes Allowed mime types. * * @return mixed */ add_filter( ‘upload_mimes’, function ( $upload_mimes ) { // By default, only administrator users are allowed to add SVGs. //…Continue reading

Remove items from admin top menu

/* remove items from top admin menu bar */ function remove_from_admin_bar($wp_admin_bar) { /* * Placing items in here will remove them from admin bar * when viewing the front end of the site */ if ( ! is_admin() ) {…Continue reading

Exclude all matching URLs from Sitemap

add_filter( ‘aioseo_sitemap_posts’, ‘aioseo_sitemap_posts’ ); function aioseo_sitemap_posts( $entries ) { foreach ( $entries as $key => $entry ) { $postId = url_to_postid( $entry[‘loc’] ); if ( $postId && ( strpos($entry[‘loc’], ‘/member/’) ) ) { unset( $entries[ $key ] ); } }…Continue reading

Remove Query Strings From Static Files (exclude login)

function wpcode_snippet_remove_query_strings_split_login( $src ) { $output = preg_split( “/(&ver|?ver)/”, $src ); return $output ? $output[0] : ”; } add_action( ‘init’, function () { if ( ! is_admin() && ! is_login() ) { add_filter( ‘script_loader_src’, ‘wpcode_snippet_remove_query_strings_split_login’, 15 ); add_filter( ‘style_loader_src’, ‘wpcode_snippet_remove_query_strings_split_login’,…Continue reading