WordPress.org

Ready to get started?Download WordPress

Forums

EP Image Base64 Encode
Encoding images in a variable (2 posts)

  1. Mike
    Member
    Posted 5 months ago #

    Great plugin!
    I am trying to modify it to encode ing urls in a variable not just in $content via apply filters.

    Thanks
    Mike

    http://wordpress.org/plugins/ep-image-base64-encode/

  2. Mike
    Member
    Posted 5 months ago #

    OK, I succeeded.

    Now I need help getting it to display in a Crayon Syntax Highlighter.. Base64 encoded content seems to kill it. I posted a topic in the plugin's support forum.

    FWIW, to get the plugin to work with a variable, I pulled away the class and modified the parse function as follows:

    $my_content = preg_replace_callback(
    			'|<img(.*)src=["\'](.*?)["\'](.*)/>|i',
    			create_function(
    				'$matches',
    				'return "<img$matches[1]src=\'".(my_fetchurl($matches[2]))."\'$matches[3]/>";'
    			),
    			$my_content
    		);

    Thanks
    Mike

Reply

You must log in to post.

About this Plugin

About this Topic