WordPress.org

Forums

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

  1. Greg Ross
    Member
    Posted 1 year 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 1 year 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 );

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.