WordPress.org

Ready to get started?Download WordPress

Forums

Advanced Custom Fields
Z-index Bug on Edit Attachment Modal View (1 post)

  1. cagnazzo
    Member
    Posted 2 months ago #

    Steps to reproduce:

    1. Create a Wysywig field, set it to show on Attachments.
    2. Create an Image field, set that to show on a Post or Page.
    3. Navigate to post/page, add an image to the image field.
    4. Edit the image by hovering over the image, clicking the pencil icon.
    5. Now, try to add a link in the Wysywig field created above.

    The 'Insert/Edit Link' Modal will be hidden due to having a lower z-index value then the 'Edit Media' modal. My fix is below:

    add_action('admin_head', 'fix_tinymce_on_attachments');
    
    function fix_tinymce_on_attachments() {
      echo '<style>
        .wp-admin #wp-link-backdrop {
          z-index:160001;
        }
        .wp-admin #wp-link-wrap.wp-core-ui {
          z-index:160002;
        }
      </style>';
    }

    https://wordpress.org/plugins/advanced-custom-fields/

Reply

You must log in to post.

About this Plugin

About this Topic