This topic is: not resolved

This topic contains 16 replies, has 2 voices, and was last updated by  towhid 3 years, 9 months ago.

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #44175

    Alexandre
    Member
    Post count: 73

    Hi

    I am ok with the WPUF edit links for posts

    but i would like to have normal WP edit links for pages

    How can i do that ?

    Thanks as this is very important

    Alex

    #44192

    towhid
    Participant
    Post count: 4505

    Hello Alex,

    Can you please let me know what do you mean by normal? I am not clear the question.

    Thank you ๐Ÿ™‚

    #44199

    Alexandre
    Member
    Post count: 73

    Hi

    I mean the standard WP edit link without WPUF

    you know when you have a basic wordpress installation, you have an edit link on every page

    this edit link is replaced by WPUF edit link

    #44209

    towhid
    Participant
    Post count: 4505

    Hello Alexandre,

    Please navigate to User Frontend->Settings->General Options->Override the post edit link = No.

    And that will redirect to post or page backend edit page.

    Thank you ๐Ÿ™‚

    #44250

    Alexandre
    Member
    Post count: 73

    Hi Towhid

    Ok tx !

    #44275

    Alexandre
    Member
    Post count: 73

    Hi

    Actually i want to override the post edit link ONLY for posts

    not for pages

    as people only publish posts, not pages

    how can i do that ?

    Tx

    #44361

    towhid
    Participant
    Post count: 4505

    Hello Alexandre,

    Please allow me some time. I will come back to you with a right solution.

    Thanks.

    #44378

    Alexandre
    Member
    Post count: 73

    Hi Towhid

    Ok thank you

    as this is very important for us

    tx

    Alex

    #44689

    Alexandre
    Member
    Post count: 73

    Hi

    We have searched through the files, where we could say :

    IF it is an article >> override the edit link

    IF it is a page >> dont override the edit link

    but we didnt find the right file where to do this

    #44756

    towhid
    Participant
    Post count: 4505

    Hello Alexandre,

    Please open wp-user-frontend/class/login.php and find out below functions. These two functions can help you to get hints to implementation this certain task.

    function is_override_enabled() {
            $override = wpuf_get_option( 'register_link_override', 'wpuf_profile', 'off' );
    
            if ( $override !== 'on' ) {
                return false;
            }
    
            return true;
        }
    function wp_login_page_redirect() {
            global $pagenow;
    
            if ( ! is_admin() && $pagenow == 'wp-login.php' && isset( $_GET['action'] ) && $_GET['action'] == 'register' ) {
    
                if ( wpuf_get_option( 'register_link_override', 'wpuf_profile' ) != 'on' ) {
                    return;
                }
    
                $reg_page = get_permalink( wpuf_get_option( 'reg_override_page', 'wpuf_profile' ) );
                wp_redirect( $reg_page );
                exit;
            }
        }

    Thanks

    #44781

    Alexandre
    Member
    Post count: 73

    Hi

    Looks like you are talking about another probleme, these functions concern the login page

    and we're looking for a fix to the edit link issue

    #44782

    towhid
    Participant
    Post count: 4505

    Hello Alexandre,

    Examine “login.php” page. You will get a clue how a login override. Find out the mapping.

    Thanks

    #44787

    Alexandre
    Member
    Post count: 73

    Hi

    Towhid

    Actually i have no problem with the login override

    I need a solution to the edit link override

    tx

    Alex

    #45136

    Alexandre
    Member
    Post count: 73

    Hi

    Any update ???

    Tx

    #45163

    towhid
    Participant
    Post count: 4505

    Hello Alexandre,

    I am really sorry for my misunderstanding of login functions.
    Here is the solution of edit link override function.

    Step 1: Please open wp-user-frontend/wpuf-functions.php

    Step 2: Find out these lines of code

    $override = wpuf_get_option( 'override_editlink', 'wpuf_general', 'yes' );
        if ( $override == 'yes' ) {
            $url = '';
            if ( wpuf_get_option( 'enable_post_edit', 'wpuf_dashboard', 'yes' ) == 'yes' ) {
                $edit_page = (int) wpuf_get_option( 'edit_page_id', 'wpuf_general' );
                $url = get_permalink( $edit_page );
    
                $url = wp_nonce_url( $url . '?pid=' . $post_id, 'wpuf_edit' );
            }
        }

    Step 3: Replace this lines of code with above and see what happen.

    if (is_single() ){
            $override = wpuf_get_option( 'override_editlink', 'wpuf_general', 'yes' );
            if ( $override == 'yes' ) {
                $url = '';
                if ( wpuf_get_option( 'enable_post_edit', 'wpuf_dashboard', 'yes' ) == 'yes' ) {
                    $url = wp_nonce_url( $url . '?pid=' . $post_id, 'wpuf_edit' );
                    echo $url;
                }
            } 
        }

    Please let me know the result when done.

    Thanks

Viewing 15 posts - 1 through 15 (of 17 total)

The topic ‘Edit link’ is closed to new replies.