Forums

[resolved] wp-admin doesn't work inside frames anymore (6 posts)

  1. Exxodos
    Member
    Posted 8 months ago #

    Greetings,

    I updated WP a few days ago, and got a "little" problem since then:

    I use GroupOffice with a wordpress bridge, so wp-admin is included in the GroupOffice interface.

    Worked fine until the update. Since then, everytime I try to access wp-admin via GO, I get a white screen in Mozilla and a notification in Opera, that this page can't be shown in a frame.

    Kinda sucks.

    Since this "feature" shown up after the last update, I'm quite sure that it can be undone, without downgrading WP.

    Anyone has any clue?

  2. danuniversal
    Member
    Posted 4 months ago #

    Hargopal solved this issue 5 years ago here:
    http://wordpress.org/support/topic/no-login-in-ie-in-frame

    You have to edit the file wp-login.php putting in a p3p license. 5 years ago it was in line 9, now in WordPress 3.3.1 it is in line 43.

    I had the same problem as you, I tried this solution with WordPress 3.3.1 recently, and it worked, I could access to the login page, and admin panel, using frameset.

    Here is the solution:

    Your original code should be something like this:

    function login_header($title = 'Log In', $message = '', $wp_error = '') {
    	global $error, $is_iphone, $interim_login, $current_site;
    
    	// Don't index any of these forms
    	add_action( 'login_head', 'wp_no_robots' );

    You will have to include the following code there:

    header( "P3P: CP=CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE");

    It should be right before the part that says "//Don't index any of these forms" -the line 43-. So your final code will be something like this:

    function login_header($title = 'Log In', $message = '', $wp_error = '') {
    	global $error, $is_iphone, $interim_login, $current_site;
    header( "P3P: CP=CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE");
    	// Don't index any of these forms
    	add_action( 'login_head', 'wp_no_robots' );

    I hope it work. I have not found any problem yet. If you find any problem, please tell us.

  3. jstolpe
    Member
    Posted 4 months ago #

    I tried pasting this code into my wp blog but the wp-admin is still not showing up in iframe in any browser. It just comes up as a white screen. I am trying to embed my whole wp site in a facebook iframe for a facebook app and all pages load fine in the iframe except the wp-admin pages are blank when I go to them in the facebook app. any ideas here?

  4. Exxodos
    Member
    Posted 4 months ago #

    Ok, I found a solution for my problem.
    You have to do it after each upgrade again - but it works for me:

    1) open wp-includes/default-filters.php
    2) find "frame"
    3) you'll get two lines:

    add_action( 'login_init', 'send_frame_options_header', 10, 0 );
    add_action( 'admin_init', 'send_frame_options_header', 10, 0 );

    4) comment those lines out, upload the file again and it will work, after the cache has been refreshed.

  5. jstolpe
    Member
    Posted 4 months ago #

    you are awesome! ive been looking for so long for a solution and this works!! thanks!

  6. Exxodos
    Member
    Posted 4 months ago #

    I'm sorry that I forgot to post my solution here. Actually, I found it several days after I made this post... :-/

    So I hope that this solution will help more users with the same problem!

Reply

You must log in to post.

About this Topic