Skip to content

Instantly share code, notes, and snippets.

View Programmer095's full-sized avatar

Cory Hyland Programmer095

  • Earth
View GitHub Profile
@Programmer095
Programmer095 / att_id.md
Created August 21, 2017 17:50 — forked from m-thomson/att_id.md
Image/attachment lookup in WP All Import.

Sometimes you might need to look up the attachment id for an imported image (or other media library file) to accommodate a third party plugin. You can use this code in the function editor.

/* Returns attachment ID for the given filename, path or URL. Argument can be a
 * URL or local file path because this will only look at the file basename. Ex - These
 * would return the same thing:
 * $id = img_id("myfile.jpg");
 * $id = img_id("http://domain.com/images/myfile.jpg");
 */
function att_id($image_filename) {
@Programmer095
Programmer095 / WooCommerce Variation Threshold.md
Last active April 26, 2018 20:11
Adjust WooCommerce Variation Threshold