WordPress.org

Ready to get started?Download WordPress

Forums

Custom Windows Pinned Tiles
Hosting provider with remote wrappers disabled fails (2 posts)

  1. Greg Ross
    Member
    Posted 5 months ago #

    My hosting provider disabled remote wrappers for file_get_contents so GD can't load the image through a URL.

    My quick and dirty solution is to use file:// and then have the plugin strip it off before passing an absolute path to the appropriate file.

    In custom-windows-pinned-tiles.php, replace line 258:

    $img = wp_get_image_editor( $input['imgurl'] );

    with:

    $file_url = str_replace( 'file://', '', $input['imgurl'] );
    $img = wp_get_image_editor( $file_url );

    And then manually input a file path in the image selection box in the settings.

    https://wordpress.org/plugins/custom-windows-pinned-tiles/

  2. Greg Ross
    Member
    Posted 5 months ago #

    Here's a better bit of replacement code, doesn't require any special knowledge or action on the users behalf:

    $upload_dir = wp_upload_dir();
    $image_path = str_replace( $upload_dir['baseurl'], $upload_dir['basedir'], $input['imgurl'] );
    
    $img = wp_get_image_editor( $image_path );

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.