[tolong] WP Logout

Discussion in 'Desain Web dan Programming' started by pradjadj, 20 Apr 2014.

Thread Status:
Not open for further replies.
  1. pradjadj

    pradjadj Apprentice 1.0

    Messages:
    265
    Likes Received:
    8
    Trophy Points:
    18
    langsung aja deh ya karena ini postingny jam 4.45 pagi ..

    karena otak saya udah mumet jadi minta tolong kesini...

    saya pake WP yg baru versi 4.9
    nah cara biar redirect logout dari halaman wp-admin ke homepage atau ke custom page itu gimana cara editnya ya?

    saya cari di google udah gk bisa caranya .. itu pake WP versi lama semua,, tolong dong~

    makasih
     
  2. el_makong

    el_makong Hosting Guru

    Messages:
    1,105
    Likes Received:
    101
    Trophy Points:
    63
    pake kode php
    Code:
    header('location:index.php');
    bisa gk?
    untuk index.php ato lokasinya d sesuaikan aja..
     
  3. Sony Kusuma

    Sony Kusuma Poster 1.0

    Messages:
    80
    Likes Received:
    8
    Trophy Points:
    8
    OP dari masa depan? WP sekarang baru versi 3.9

    Apakah tutorial ini sudah dicoba?
    http://wpsnippy.com/auto-redirect-users-after-logout/
     
  4. dhyhost

    dhyhost Hosting Guru Web Hosting

    Messages:
    3,950
    Likes Received:
    615
    Trophy Points:
    113
  5. kang28ivan

    kang28ivan Expert 1.0

    Messages:
    766
    Likes Received:
    168
    Trophy Points:
    43
  6. pradjadj

    pradjadj Apprentice 1.0

    Messages:
    265
    Likes Received:
    8
    Trophy Points:
    18
    yup WP (WordPress) kalau gk pakai plugin gimana caranya ya... biar gk banyak2 plugin aja gitu..
     
  7. kang28ivan

    kang28ivan Expert 1.0

    Messages:
    766
    Likes Received:
    168
    Trophy Points:
    43
    Kalau mau tanpa plugin coba pake kode ini, mudah-mudahan berhasil
    Input kode dibawah ke file functions.php setelah kode <?php

    Code:
     
    add_filter('logout_url', 'wh_logout_redirect_url', 10, 2);
    
    function wh_logout_redirect_url( $logouturl ) {
    
    return $logouturl . '&amp;redirect_to=' . urlencode( get_option( 'siteurl' ) );
    
    }
    
    
    add_action( 'init', 'wh_loggedout_redirect' );
    
    function wh_loggedout_redirect() {
    
    if( $_GET['loggedout'] == 'true' ) {
    
    wp_redirect( get_option( 'siteurl' ) );
    exit;
    
    }
    
    
     
  8. pradjadj

    pradjadj Apprentice 1.0

    Messages:
    265
    Likes Received:
    8
    Trophy Points:
    18
    oke Tuan makasih jawabannya .. :D
     
Loading...
Thread Status:
Not open for further replies.

Share This Page

Loading...