// 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 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
/* custom css for admin */ add_action(‘admin_head’, ‘my_custom_fonts’); function my_custom_fonts() { echo ‘ ‘; }Continue reading
/* 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
function callAPI($method, $url, $apiKey, $data = false) { switch ($method) { case ‘GET’: if ($data) { $url = sprintf(“%s?%s”, $url, http_build_query($data)); //transform url to : url?key=value } break; } $curl = curl_init($url); $headers = [ ‘Accept: application/json’, ‘Api-Access-Token: ‘ .…Continue reading
function ideapro_remove_wpadmin_menus() { global $current_user; $users = array(3,4,5); $role = $current_user->roles[0]; if($current_user->ID == 1) { } elseif($role == “editor” || $role == “subscriber” || $role == “author”) { remove_menu_page(‘themes.php’); remove_menu_page(‘plugins.php’); remove_menu_page(‘edit.php?post_type=page’); remove_menu_page(‘edit.php?post_type=popup’); remove_menu_page(‘edit.php?post_type=project’); remove_menu_page(‘index.php’); remove_menu_page(‘users.php’); remove_menu_page(‘tools.php’); remove_menu_page(‘upload.php’); remove_menu_page(‘edit.php’); remove_menu_page(‘edit-comments.php’); remove_menu_page(‘options-general.php’);…Continue reading
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
function my_gallery_default_type_set_link( $settings ) { $settings[‘galleryDefaults’][‘link’] = ‘file’; return $settings; } add_filter( ‘media_view_settings’, ‘my_gallery_default_type_set_link’);Continue reading