Skip to content

Instantly share code, notes, and snippets.

@Markmcl
Markmcl / test.php
Created July 24, 2018 12:48
test source-url-to-image-captions
<?php
add_filter("attachment_fields_to_edit", "add_image_source_url", 10, 2);
function add_image_source_url($form_fields, $post) {
$form_fields["source_url"] = array(
"label" => __("Source URL"),
"input" => "text",
"value" => get_post_meta($post->ID, "source_url", true),
"helps" => __("Add the URL where the original image was posted"),
);