WordPress.org

Ready to get started?Download WordPress

Ideas

'Insert into Post' button filter

  1. mslocum
    Member

    12345

    http://core.trac.wordpress.org/browser/tags/3.3.1/wp-admin/includes/media.php
    Five places media.php creates a button called 'Insert into Post'. This is often times inaccurate and confusing. The media manger iframe can be used in many places other that posts. It can be used on custom types as well as widget settings and plugin settings.

    A plugin should have the ability to change the text of the button using a filter.

    Posted: 2 years ago #
  2. Maor Chasen
    Member

    Totally agree on this one. Also there should be support for CPTs.

    Posted: 2 years ago #
  3. webaware
    Member

    12345

    Agree, it would be good to filter this button label. I currently do this with a gettext filter, but it's not the ideal way.

    add_filter('gettext', array($this, 'filterGettextMediaPopup'));
    
    ...
    
    /**
    * replace "Insert into Post" label on media popup submit button
    * @param string $text
    * @return string
    */
    public function filterGettextMediaPopup($text) {
        if ($text == 'Insert into Post' && self::isOurMediaUpload()) {
            $text = 'Select';
        }
    
        return $text;
    }
    
    /**
    * check to see if this is our media upload form
    * @return bool
    */
    protected static function isOurMediaUpload() {
        $wpwines = isset($_GET['wpwines']) ? (string) $_GET['wpwines'] : '';
        return ($wpwines == 'product' || $wpwines == 'award');
    }
    Posted: 1 year ago #
  4. I agree on this one as well, it is very confusing. Media manger should not be used in posts.

    Posted: 1 year ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.

  • Rating

    12345
    3 Votes
  • Status

    This idea has been implemented