• add_filter( 'attachment_fields_to_edit', 'qrcode_attachment', 10, 2);
    function qrcode_attachment($form_fields, $post){
    
        $link = urlencode( $post->guid );
    
        $qr_img = "https://chart.googleapis.com/chart?cht=qr&chs=300x300&chld=H|4&chl=" . $link;
        $qr_img_l = "https://chart.googleapis.com/chart?cht=qr&chs=540x540&chld=H|4&chl=" . $link;
    
        $form_fields['qrcode'] = array(
            'label' => __('QR kód pro odkaz', 'domain'),
            'input' => 'html',
            'html' => "<a href='" . $qr_img_l ."' target='_blank'><img src='" . $qr_img . "' Title='" . __('Kliknutím otevřete velký QR kód', 'domain') . "'></a>",
            'value' => 1,
            'helps' => __('Kliknutím otevřete velký QR kód', 'domain')
        );
        return $form_fields;
    }

    https://wordpress.org/plugins/dynamic-qr-code-generator/

The topic ‘Extension for media attachment’ is closed to new replies.