Support » Plugins » Hacks » Making the Add Media Link URL into a checkbox

  • Hello,

    Hopefully I’ve started this question in the right forums 🙂

    I’m currently having some difficulties accomplishing this: http://d.pr/JpH1 (image)

    I’ve been able to remove the ‘Attachment Post URL’ button using

    function medium_attachment_fields_to_edit($form_fields) {
      $form_fields['url']['html'] = preg_replace("/<button type='button' class='button urlpost' title='(.)*'>(.*)<\/button>/", "", $form_fields['url']['html']);
      return $form_fields;
    }
    add_filter('attachment_fields_to_edit', 'medium_attachment_fields_to_edit', 0, 2);

    but I’m somehow unable to make the remaining buttons into a checkbox. Checked being the ‘File URL’, unchecked being ‘None’. (or changing things into a ‘Yes/No’ set of radio buttons if this would be easier to accomplish)

    I’ve read about all articles about this matter of course (especially this one), but they about all seem to be about adding new settings, instead of altering existing ones.

  • The topic ‘Making the Add Media Link URL into a checkbox’ is closed to new replies.