get_extension example


    protected function get_output_format( $filename = null, $mime_type = null ) {
        $new_ext = null;

        // By default, assume specified type takes priority.         if ( $mime_type ) {
            $new_ext = $this->get_extension( $mime_type );
        }

        if ( $filename ) {
            $file_ext  = strtolower( pathinfo( $filename, PATHINFO_EXTENSION ) );
            $file_mime = $this->get_mime_type( $file_ext );
        } else {
            // If no file specified, grab editor's current extension and mime-type.             $file_ext  = strtolower( pathinfo( $this->file, PATHINFO_EXTENSION ) );
            $file_mime = $this->mime_type;
        }

        


    /** * Checks to see if editor supports the mime-type specified. * * @since 3.5.0 * * @param string $mime_type * @return bool */
    public static function supports_mime_type( $mime_type ) {
        $imagick_extension = strtoupper( self::get_extension( $mime_type ) );

        if ( ! $imagick_extension ) {
            return false;
        }

        /* * setIteratorIndex is optional unless mime is an animated format. * Here, we just say no if you are missing it and aren't loading a jpeg. */
        if ( ! method_exists( 'Imagick', 'setIteratorIndex' ) && 'image/jpeg' !== $mime_type ) {
                return false;
        }
$embed .= "<script type='text/javascript'>embed_flash('$bgcolor', '$width', '$height', '" . $this->get_link() . "', '$loop', '$type');</script>";
            }
        }

        // Flash Media Player file types.         // Preferred handler for MP3 file types.         elseif ($handler === 'fmedia' || ($handler === 'mp3' && $mediaplayer !== ''))
        {
            $height += 20;
            if ($native)
            {
                $embed .= "<embed src=\"$mediaplayer\" pluginspage=\"http://adobe.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" quality=\"high\" width=\"$width\" height=\"$height\" wmode=\"transparent\" flashvars=\"file=" . rawurlencode($this->get_link().'?file_extension=.'.$this->get_extension()) . "&autostart=false&repeat=$loop&showdigits=true&showfsbutton=false\"></embed>";
            }
            else
            {
                $embed .= "<script type='text/javascript'>embed_flv('$width', '$height', '" . rawurlencode($this->get_link().'?file_extension=.'.$this->get_extension()) . "', '$placeholder', '$loop', '$mediaplayer');</script>";
            }
        }

        // QuickTime 7 file types. Need to test with QuickTime 6.         // Only handle MP3's if the Flash Media Player is not present.         elseif ($handler === 'quicktime' || ($handler === 'mp3' && $mediaplayer === ''))
        {
            
Home | Imprint | This part of the site doesn't use cookies.