WordPress.org

Ready to get started?Download WordPress

Forums

Code for uploaded Images (2 posts)

  1. Mark (podz)
    Support Maven
    Posted 9 years ago #

    Is there a better way of handling the code that is generated when an image is uploaded ?
    In the (dim and distant) past, you could click and have the code transferred to the post area - that seems more elegant than what we have maybe, but then we have pages now don't we ....

  2. tis
    Member
    Posted 9 years ago #

    I've hacked my installation to give a slightly greater level of support. I'm sure someone can come up with a better way to do it:

    In upload.php I inserted

    $poc = urlencode( $piece_of_code );

    directly before

    $piece_of_code = htmlspecialchars( $piece_of_code );

    and inserted

    <a target="_blank" href="post.php?action=exact&content=<?php echo $poc; ?>"><?php _e('Create a new post with this image'); ?></a>

    directly before

    <strong><?php _e('Image Details') ?></strong>:

    (both insertions are near the end of the file)

    then in post.php I inserted

    case 'exact':
    $content = stripslashes($content);
    # Intentional fall through

    directly before

    default:<br />
    $title = __('Create New Post');<br />
    require_once ('./admin-header.php');

    This adds a link to the upload-completed page which creates a new post with the img link already inserted into the body.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.