WordPress.org

Ready to get started?Download WordPress

Forums

Instagrate to WordPress
[resolved] A small issue with file naming and a feature request (2 posts)

  1. sleepybrett
    Member
    Posted 1 year ago #

    I ran into a few issues with the way you name your cached image names I have a small patch that I made to resolve them and a suggestion on how better to name the file.

    First the patch. I found that if the image caption had multiple periods in a row or the '+' symbol that the wordpress media library would be unable to resolve the file, the file is clearly there wordpress just refuses to see it. (As an aside, I'm a bit of a wordpress newbie and haven't mastered the frameword yes, so there are probably multiple ways to resolve this) To resolve this I made the following patch to instagrate-pro.php around line 2615:

    $file_name = ($post_name == '') ? $file : $post_name;
    		$file_name = sanitize_file_name($file_name);
    		$file_name = remove_accents($file_name);
    		$file_name = substr($file_name, 0, 100);
    
    		/* WORKAROUND PATCH, NOTE FOR FUTURE MERGES .. */
    		$file_name = preg_replace('/\.+/','.',$file_name);
    		$file_name = preg_replace('/\+/','',$file_name);
                    /* END PATCH */
    
    		$file_name = $file_name .'.'. $info['extension'];

    That said wouldn't it be better to use the instagram post id as the filename, it's (assumably) guaranteed unique and you could cut out your uniqueness checking.

    The feature request seems simple enough (and it might be something I just go ahead and patch in). I'd like to dump the raw instagram feed block for the 'gram' into the post and then use javascript to manipulate it. So something like %%original_json_object%%?

    http://wordpress.org/extend/plugins/instagrate-to-wordpress/

  2. polevaultweb
    Member
    Plugin Author

    Posted 1 year ago #

    Closing this issue as not related to the free plugin

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic