• Resolved aliferis

    (@aliferis)


    Hi there

    I have installed your plugin and am using this template code in another plugin that creates front end post editing / deleting

    duplicate_post_clone_post_link(‘Clone’);

    However, it seems to only work in the front end when the user logged in Admin – not for an Author (although I have specified Author can clone in the permissions of your plugin options)

    When an Author is logged in an clones a post in their front end post list it reloads but does nothing and the post is not created in the CMS either

    Can you offer any advice ?

    thanks

    Joe

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Enrico Battocchi

    (@lopo)

    Hi,
    which other plugin are you using for frontend editing? Probably there is some conflict.

    Thread Starter aliferis

    (@aliferis)

    Hi

    Its called User Frontend Pro – I inserted your template tag into their code like so:

    <?php
    if ( wpuf_get_option( ‘enable_post_edit’, ‘wpuf_dashboard’, ‘yes’ ) == ‘yes’ ) {
    $disable_pending_edit = wpuf_get_option( ‘disable_pending_edit’, ‘wpuf_dashboard’, ‘on’ );
    $edit_page = (int) wpuf_get_option( ‘edit_page_id’, ‘wpuf_general’ );
    $url = add_query_arg( array(‘pid’ => $post->ID), get_permalink( $edit_page ) );

    if ( $post->post_status == ‘pending’ && $disable_pending_edit == ‘on’ ) {
    // don’t show the edit link
    } else {
    ?>
    “><?php _e( ‘Edit’, ‘wpuf’ ); ?>
    <?php
    }
    }
    ?>
    <?php duplicate_post_clone_post_link(‘Clone’,’ | ‘,’ |’,$post->ID); ?>
    <?php
    if ( wpuf_get_option( ‘enable_post_del’, ‘wpuf_dashboard’, ‘yes’ ) == ‘yes’ ) {
    $del_url = add_query_arg( array(‘action’ => ‘del’, ‘pid’ => $post->ID) );
    ?>
    ” onclick=”return confirm(‘Are you sure to delete?’);”><span style=”color: red;”><?php _e( ‘Delete’, ‘wpuf’ ); ?></span>
    <?php } ?>
    </td>
    </tr>
    <?php
    }

    wp_reset_postdata();
    ?>

    Plugin Author Enrico Battocchi

    (@lopo)

    Hi,
    can you use the “code” button to post your code? It’s quite difficult to read without indenting and with other modifications by the forum.

    Thread Starter aliferis

    (@aliferis)

    sorry

                            <?php
                            if ( wpuf_get_option( 'enable_post_edit', 'wpuf_dashboard', 'yes' ) == 'yes' ) {
                                $disable_pending_edit = wpuf_get_option( 'disable_pending_edit', 'wpuf_dashboard', 'on' );
                                $edit_page = (int) wpuf_get_option( 'edit_page_id', 'wpuf_general' );
                                $url = add_query_arg( array('pid' => $post->ID), get_permalink( $edit_page ) );
    
                                if ( $post->post_status == 'pending' && $disable_pending_edit == 'on' ) {
                                    // don't show the edit link
                                } else {
                                    ?>
                                    <a href="<?php echo wp_nonce_url( $url, 'wpuf_edit' ); ?>"><?php _e( 'Edit', 'wpuf' ); ?></a>
                                    <?php
                                }
                            }
                            ?>
    <?php duplicate_post_clone_post_link('Clone',' | ',' |',$post->ID); ?>
                            <?php
                            if ( wpuf_get_option( 'enable_post_del', 'wpuf_dashboard', 'yes' ) == 'yes' ) {
                                $del_url = add_query_arg( array('action' => 'del', 'pid' => $post->ID) );
                                ?>
                                <a href="<?php echo wp_nonce_url( $del_url, 'wpuf_del' ) ?>" onclick="return confirm('Are you sure to delete?');"><span style="color: red;"><?php _e( 'Delete', 'wpuf' ); ?></span></a>
                            <?php } ?>
                        </td>
                    </tr>
                    <?php
                }
    
                wp_reset_postdata();
                ?>
    Plugin Author Enrico Battocchi

    (@lopo)

    Hi,
    sorry for the delay.
    I tried to install User Frontend (the free version from ww.wp.xz.cn plugin repository, not the Pro paid version) and edited the dashboard template as above, but couldn’t reproduce the bug: even with an user with role Author I’m redirected to the edit screen.

    Can you copy the URL of the link (should be something like: right click on the link and “Copy URL”) as an Author and paste it here? Maybe it could give a clue about what’s wrong…

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Cloning in front end’ is closed to new replies.