WordPress.org

Ready to get started?Download WordPress

Forums

How to change current Post Category to an other using a simple link? (1 post)

  1. arielcruzf
    Member
    Posted 1 year ago #

    Hi, hopefully some one can hel me, I'm not good on coding :(. I being trying to find the way to create a Link in the post that, by clicking it will change the post current category to an other and then redirect to the single page of the post.

    I found this function that Delete Post by click and returns to the same page, so I thing the code has to be something similar then this.

    thanks ;)

    //delete POST Link
    
    function wp_delete_post_link($link = 'Delete This', $before = '', $after = '')
    {
    global $post;
    if ( $post->post_type == 'page' ) {
    if ( !current_user_can( 'edit_page', $post->ID ) )
    return;
    } else {
    if ( !current_user_can( 'edit_post', $post->ID ) )
    return;
    }
    $link = "<a>ID, 'delete-post_' . $post->ID) . "'>".$link."</a>";
    echo $before . $link . $after;
    }

    [Please post code & markup between backticks or use the code button. Your posted code has now been permanently damaged by the forum's parser.]

Topic Closed

This topic has been closed to new replies.

About this Topic