Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function set_field_value(){
- echo "<script type='text/javascript'>
- document.getElementById('acf-field_5cd68b4d12a20').value = 'test123456';
- </script>";
- }
- add_action('admin_footer', 'set_field_value');
- function feed_custom_field($html, $id) {
- $src = wp_get_attachment_image_src( $id, $size, false );
- $image_url = $src[0];
- echo "<script type='text/javascript'>
- document.getElementById('acf-field_5cd68b4d12a20').value = $image_url;
- </script>";
- return $src[0].",";
- }
- add_filter( 'image_send_to_editor', 'feed_custom_field', 10, 9 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement