Require User Login for Archive Pages
add_action( ‘template_redirect’, function () { if ( is_archive() && ! is_user_logged_in() ) { auth_redirect(); } } );Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
add_action( ‘template_redirect’, function () { if ( is_archive() && ! is_user_logged_in() ) { auth_redirect(); } } );Continue reading
// Redirects User to Login if not logged in (Source: https://docs.gravityforms.com/gform_require_login_pre_download/#h-4-require-login-and-redirect-to-login-page-if-the-form-requires-login) // After login, downloads file. Doesn’t move user to diff page add_filter( ‘gform_require_login_pre_download’, function ( $require_login, $form_id ) { if ( is_user_logged_in() ) { return false; } $form =…Continue reading
add_filter( ‘admin_footer_text’, ‘afm_update_admin_footer_text’ ); // Footer Left text (Originally ‘Thank you for creating with WordPress’) function afm_update_admin_footer_text( $text ) { return sprintf( ‘Thank you for using the COAST Client Portal.’, esc_url( ‘https://nowcoast.com/’ ) ); } //Footer Right text (Originally displays…Continue reading
// Update Image src and alt text to match site add_action(‘admin_bar_menu’, ‘afm_replace_admin_bar_wp_logo’, 11); function afm_replace_admin_bar_wp_logo($wp_admin_bar) { $wp_admin_bar->remove_menu( ‘about’ ); $wp_admin_bar->remove_menu( ‘contribute’ ); $wp_admin_bar->remove_menu( ‘wporg’ ); $wp_admin_bar->remove_menu( ‘documentation’ ); $wp_admin_bar->remove_menu( ‘learn’ ); $wp_admin_bar->remove_menu( ‘support-forums’ ); $wp_admin_bar->remove_menu( ‘feedback’ ); $wp_admin_bar->remove_menu( ‘wp-logo’ );…Continue reading
// Remove Color Scheme Picker add_action( ‘admin_head-profile.php’, ‘afm_remove_color_scheme’ ); function afm_remove_color_scheme( ) { $user = wp_get_current_user(); $allowed_roles = array( ‘administrator’, ‘editor’ ); if ( ! array_intersect( $allowed_roles, $user->roles ) ) { remove_action( ‘admin_color_scheme_picker’, ‘admin_color_scheme_picker’ ); } } // Remove application…Continue reading
add_action( ‘admin_menu’, ‘afm_remove_admin_menu_items’); function afm_remove_admin_menu_items() { $user = wp_get_current_user(); $allowed_roles = array( ‘administrator’, ‘editor’ ); if ( ! array_intersect( $allowed_roles, $user->roles ) ) { remove_menu_page( ‘index.php’ ); //’Dashboard’ remove_menu_page( ‘profile.php’ );//Users > Profile } }Continue reading
add_action(‘wp_dashboard_setup’, ‘wpdocs_remove_dashboard_widgets’); /** * Remove all dashboard widgets */ function wpdocs_remove_dashboard_widgets() { $user = wp_get_current_user(); $allowed_roles = array( ‘administrator’, ‘editor’ ); if ( ! array_intersect( $allowed_roles, $user->roles ) ) { remove_meta_box( ‘dashboard_right_now’, ‘dashboard’, ‘normal’ ); // Right Now remove_meta_box( ‘dashboard_recent_comments’,…Continue reading
add_filter( ‘login_head’, function () { // Update the line below with the URL to your own logo. // Adjust the Width & Height accordingly. $custom_logo = ‘https://cportal.nowcoast.com/wp-content/uploads/2026/03/COA-cPortal-WPAdmin.svg’; $logo_width = 84; $logo_height = 84; printf( ‘ ‘, $custom_logo, $logo_width, $logo_height );…Continue reading
// === Solverius Admin Columns (Menu Order + Thumbnail) === // 1. Kolonları ekle function solverius_add_columns($columns) { $new = []; foreach ($columns as $key => $value) { if ($key === ‘cb’) { $new[$key] = $value; $new[‘thumbnail’] = ‘Görsel’; } else…Continue reading
if (!defined(‘ABSPATH’)) exit; add_action(‘wp’, function () { if (is_admin()) { return; } $set = function ($key, $value) { $_GET[$key] = $value; }; $unset = function ($key) { unset($_GET[$key]); }; /* * rd_url_after_sitebase = everything after the site base (path only)…Continue reading