P2 theme eats post titles when inline editing

  • In the Auttomattic P2 theme.
    http://wordpress.org/extend/themes/p2

    When editing a regular post inline (on the live page), the post title gets replaced by a truncated version of the opening sentence of the post.

    I plan on downloading the theme source and taking a look, but curious if issue has been experienced by others.

    Originally wondered if it was a feature and not a bug, but now seems like a bug.

    The blog I need help with is: (visible only to logged in users)

  • Digging into this a bit…

    /inc/ajax.php inside function save_post, line 125


    if ( ! empty( $new_post_title ) )
    $post_title = $new_post_title;
    else
    $post_title = p2_title_from_content( $new_post_content );

    When the ajax loads the editing window, there is no field for post title shown, so it likely empties it and therefor runs the title from content function.

    So I’m guessing somewhere in /js/p2.js around line 625


    var titleDiv = document.createElement('div');

    if (post.type == 'post' || post.type == 'page') {
    var titleInput = titleDiv.appendChild(
    document.createElement('input'));
    titleInput.type = 'text';
    titleInput.className = 'title';
    defaultText(titleInput, p2txt.title);
    titleInput.value = post.title;
    postContent.append(titleDiv);
    }

    Maybe it’s not getting the post.type call back?
    I”m running on .com so can’t see in tables what kind of post it’s assigned.

  • You might be able to tell if you run firebug (in Firefox) or one of the other extensions available for other browsers that lets you inspect different elements of a page. Does viewing the page source (right-click the page & select “view page source” or similar) not display the element you’re interested in?

    I am unacquainted with the way P2 functions, so it could be that this is normal & expected behavior — though I agree that it’s not ideal!

  • Yeah, it’s not in the page source so I figured the function isn’t being called.

  • @oiler
    I suggest that you contact Staff. Here’s the link http://en.support.wordpress.com/contact/ After you type “P2” into the searchbox at the bottom of the page there will be a section that says “Have you found the answer to your question?” You can choose either “Yes I found the answer to my question.” or “No I didn’t find the answer to my question and I would like to contact support for help.” The no option will reveal the contact form.

  • The topic ‘P2 theme eats post titles when inline editing’ is closed to new replies.