• Resolved kirkpatrick

    (@kirkpatrick)


    FEE 1.5.1 plus WP2.9 (but not 2.8.6) changes the value of $post in a curious way: Put this in a tiny plugin:

    function test_wp_head() {
    	global $post;
    	print_r($post);
    }
    add_action('wp_head', 'test_wp_head');

    Activate it and FEE. This prints $post at the top of the page, and shows that with FEE active, $post is just the post id (an integer), not the post array. With FEE not active, the correct full post structure is printed at the top of the page.

    Interestingly, at the action ‘get_sidebar’, the value is correct.

    This came to my attention because it prevents flexipages from displaying trees (because now $post doesn’t contain parent info, etc). The bug seems to be solely an effect of the interaction between WP2.9 and FEE — specifically, it is not due in any way to flexipages. (My workaround in flexipages was to use get_sidebar.)

Viewing 3 replies - 1 through 3 (of 3 total)
  • I’ve tested this with and without the FEE plugin activated in WP 2.9 and didn’t notice any problem.

    So I think it’s actually a compatibility issue between Flexipages and FEE.

    Try that code with Flexipages off, but with FEE on.

    Thread Starter kirkpatrick

    (@kirkpatrick)

    No, Flexipages is irrelevant.

    I tested thus: Fresh 2.9 install. Got FEE via Add New. Copied test.php into plugins, activated it. Results:

    With FEE active, on an actual page (eg, About in the default install), a 2 appears at the top — the page ID.

    With FEE inactive, the top of the page has “stdClass Object ( [ID] => 2 [post_author] => 1…” printed — the usual $page object.

    What is confusing, and what I didn’t note until I tried this fresh install test, is that it fails on standard pages, but not on posts, archives, or the front page.

    I doubt it’s a template problem; the templates of the theme I originally discovered this on are pretty non-standard, but still they behave the same way regarding pages vs other posts.

    Note — All this with Flexipages absent.

    I doubt I can be of much further help — it took me most of a full day to isolate the problem to FEE and the $page variable. FEE is too complex for me to debug, given I haven’t a clue how this is happening. So I’ll leave it to you, with my best wishes for quick work.

    Happy holidays — and thanks for this very useful plugin. It’s essential for my page-oriented CMS group-user sites.

    I was able to reproduce the bug you mentioned with the default theme, on a static page. It wasn’t too hard to fix. Thanks for reporting.

    You can try out the Development Version (1.6a4).

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Front-end Editor]FEE – WP 2.9 bug: $post wrong in wp_head’ is closed to new replies.