WordPress.org

Ready to get started?Download WordPress

Forums

Making the Add Media Link URL into a checkbox (1 post)

  1. Cor van Noorloos
    Member
    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 2 years ago by Cor van Noorloos
  • This topic is not resolved
  • WordPress version: 3.4-alpha-19904

Tags