WordPress.org

Ready to get started?Download WordPress

Forums

WP User Frontend
Edit Post - No content (9 posts)

  1. finnj
    Member
    Posted 1 year ago #

    I have installed WP User fronten according to the installation including adding pages for Dashboard, Edit Post & New post.
    Everything seems to work except when I try to edit a post. I get redirected to the correct page, the heading is there, but no content meaning the only thing present on the page is the heading.

    I tried it both on my home test site and the live site, but same result.

    the page I am redirected to is:
    http://mydomain.dk/?page_id=129%3Fpid%3D13&_wpnonce=af4877e69e

    permalink for the post I am trying to edit: http://mydomain.dk/?p=13

    I have not changed the permaling structure, as I cant use postname in the permalinks due to national characters, so I have a red warning in the top of the admin panel: You need to set your permalink custom structure to at least contain /%postname%/ before WP User Frontend will work properly.

    I hope that this isnt the rootcause of the problem, as I do not want to change permalink structure.

    apart from this, the plugin works as designed :)

    http://wordpress.org/extend/plugins/wp-user-frontend/

  2. gpspake
    Member
    Posted 1 year ago #

    I'm having the same problem. I wonder if it has anything to do with the fact that the post is not yet published (I have it set to go in as pending). The page shows up if I'm logged in as an admin but not a contributor and it isn't really clear how it's supposed to work.

  3. finnj
    Member
    Posted 1 year ago #

    The problems seems to be related to how the link is created:

    http://mydomain.dk/?page_id=129%3Fpid%3D13&_wpnonce=af4877e69e

    If you replace: %3F with &
    an replace: %3D with =

    you get:

    http://mydomain.dk/?page_id=129&pid=13&_wpnonce=af4877e69e

    This link works, and I am able to edit the post, and save it.

    Strange thing is that 3D (or 3d) is the hex value for =, but 3F (or 3f) is the hex value for ?

    It is only the problem with the edit link, the delete link from the dashboard is correctly formatted

    I changed the following in wpuf-dashboard.php (line 159)
    <a href="<?php echo wp_nonce_url( $url . '?pid=' . $post->ID, 'wpuf_edit' ); ?>"><?php _e( 'Edit', 'wpuf' ); ?></a>
    to:
    <a href="<?php echo wp_nonce_url( $url . '&pid=' . $post->ID, 'wpuf_edit' ); ?>"><?php _e( 'Edit', 'wpuf' ); ?></a>

    short, I changed ?pid= to &?pid=

    Now it works :)

    I am aware that the change probably needs to be a bith more sophisticated as url's without pid=99 wont contain ? already and as such the code will work for some of the cases.

    I suggest a change where $url is checked for "?", and if this is the case then &pid=

    I am very new with WordPress and reasonably new with pmp, so there might be a conseqense of my change that i I am unaware of, but it seems to work.

  4. finnj
    Member
    Posted 1 year ago #

    Argh!!!

    Should have been:
    short, I changed ?pid= to &pid=

  5. gpspake
    Member
    Posted 1 year ago #

    Ok, I got it to work.
    You have to create the dashboard page, which will allow users to see their posts. When they click edit it will take them to the edit page where they can edit their post.

  6. finnj
    Member
    Posted 1 year ago #

    I replaced line 159 in wpuf-dashboard.php with the following code, which "should" work regardless of permalink structure:

    if (stripos($url, '?')==0)
    										{
    										  $pid_lead = '?pid=';
    										}
    										else
    										{
    										  $pid_lead = '&pid=';
    										}
                                        ?>
                                        <a href="<?php echo wp_nonce_url( $url . $pid_lead . $post->ID, 'wpuf_edit' ); ?>"><?php _e( 'Edit', 'wpuf' ); ?></a>

    as said before, I am not a genious at this, so it can probably be done smarter, but it works for me.

    Please advice if this will make it into following version

  7. finnj
    Member
    Posted 1 year ago #

    That wasnt readable, sorry:

    if (stripos($url, '?')==0)
      {
    
      $pid_lead = '?pid=';
    
      }
    
      else
      {
      $pid_lead = '&pid=';
      }
      ?>
      <a href="<?php echo wp_nonce_url( $url . $pid_lead . $post->ID, 'wpuf_edit' ); ?>"><?php _e( 'Edit', 'wpuf' ); ?></a>
  8. finnj
    Member
    Posted 1 year ago #

    It is working for me now, but i still would like to get rid of the error message:
    You need to set your permalink custom structure to at least contain /%postname%/ before WP User Frontend will work properly.

    How do I do that ?

  9. professor99
    Member
    Posted 1 year ago #

    The new development version 4.3 I have now released fixes now enables Frontend to work with the default WordPress permalinks and fixes the problems above

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic