Title: UI Question
Last modified: August 31, 2016

---

# UI Question

 *  Resolved [Nina15](https://wordpress.org/support/users/nina15/)
 * (@nina15)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/ui-question/)
 * I wonder if there is a filter to add/move the button to the media row. This is
   a consideration purely based on end user experience especially from FE.
 * As it is the button not only can get “lost” amongst other buttons added by other
   plugins, there is also already a built-in TinyMCE plugin that adds a button similar
   to that of z-url (see [https://www.tinymce.com/docs/demo/full-featured/](https://www.tinymce.com/docs/demo/full-featured/)).
 * In addition end-users often don’t realize whether they are in html or WYSWIYG
   mode.
 * In short, my question is whether it is possible to use a filter (something like
   add_filter(‘media_buttons_context’ …) without changing the integrity of the plugin
   which already works well.
 * Thank you in advance for sharing any suggestions you may have.
 * [https://wordpress.org/plugins/z-url-preview/](https://wordpress.org/plugins/z-url-preview/)

Viewing 6 replies - 16 through 21 (of 21 total)

[←](https://wordpress.org/support/topic/ui-question/?output_format=md) [1](https://wordpress.org/support/topic/ui-question/?output_format=md)
2

 *  Thread Starter [Nina15](https://wordpress.org/support/users/nina15/)
 * (@nina15)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/ui-question/page/2/#post-6954755)
 * It works well for making the media button globally available and restricting 
   it to post/page. But on further testing and spending days trying to figure out
   a way to apply the media button to a specific custom post type (and the frontend
   post and editing plugins are commonly custom post types anyway) I declare total
   defeat! This may have something to do with “typenow” as you mentioned above. 
   Any pointers on how to include a specific post type while excluding post and 
   other post types is greatly appreciated.
 *  Plugin Author [StuartMillington](https://wordpress.org/support/users/stuartmillington/)
 * (@stuartmillington)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/ui-question/page/2/#post-6954756)
 * If it works on those forms in mode 4 – without the “typenow” checks, then it’s
   definitely something to do with that.
 * A quick and dirty, on a dev box/site, test would be to find (in index.php):
 *     ```
       } else {
       	echo '<a href="#" id="insert-zurlpreview-media" class="button"><img src="' . plugins_url( '/button.png', __FILE__ ) . '" width="22" height="22"> Add Preview </a>';
       }
       ```
   
 * and change it to:
 *     ```
       } else {
       	echo '<a href="#" id="insert-zurlpreview-media" class="button"><img src="' . plugins_url( '/button.png', __FILE__ ) . '" width="22" height="22"> Add Preview (' . htmlspecialchars($typenow) . ')</a>';
       }
       ```
   
 * To see what, if anything “typenow” is set to.
 * If it’s blank then it’s a matter of finding something else to filter against…
   may be “pagenow”.
 *  Thread Starter [Nina15](https://wordpress.org/support/users/nina15/)
 * (@nina15)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/ui-question/page/2/#post-6954757)
 * Thanks for the troubleshooting tip. Replaced as suggested and set option 4 (media
   button row) gives empty i.e. the button shows as “Add Preview ()” in the cpt 
   form and sure enough shows “Add Preview (post)” in new post editor from the backend.
 * This may be fine for the intended scenario of using the plugin from the backend.
   Not sure if I am at odds here or there may be a genuine need by others to be 
   able to display the button on a frontend form. This is your call to make.
 * Your tip above gave me the idea of using the related action hooks with a helper
   script, injecting the media button into the form while selecting one of the TinyMCE
   options (row 1,2 or 3). Just need to find out why enqueue action is not firing
   when the action is copied to the script – perhaps a matter of adjusting the priority.
   This is a work-around but somehow manageable.
 *  Plugin Author [StuartMillington](https://wordpress.org/support/users/stuartmillington/)
 * (@stuartmillington)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/ui-question/page/2/#post-6954758)
 * If there is a use case for front-end forms I’ll add it – if I can figure it out.
   I just don’t use them.
 * I don’t, currently, have a dev environment (long story). Do you have a front-
   end plugin that you could suggest that would have a zero/minimal impact on my
   live site so I could try your use case?
 *  Thread Starter [Nina15](https://wordpress.org/support/users/nina15/)
 * (@nina15)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/ui-question/page/2/#post-6954759)
 * I use BuddyForms by Themekraft which is a commercial product and fairly sophisticated.
   Cannot speak of other frontend plugins available freely (like WP User Frontend
   and a few other) but only assume they are custom post types as well. Perhaps 
   this thread will generate more comments from others on the subject.
 *  Plugin Author [StuartMillington](https://wordpress.org/support/users/stuartmillington/)
 * (@stuartmillington)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/ui-question/page/2/#post-6954763)
 * Thanks, I’ll have a look at some and see if I can find one to play with.

Viewing 6 replies - 16 through 21 (of 21 total)

[←](https://wordpress.org/support/topic/ui-question/?output_format=md) [1](https://wordpress.org/support/topic/ui-question/?output_format=md)
2

 The topic ‘UI Question’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/z-url-preview.svg)
 * [Z-URL Preview](https://wordpress.org/plugins/z-url-preview/)
 * [Support Threads](https://wordpress.org/support/plugin/z-url-preview/)
 * [Active Topics](https://wordpress.org/support/plugin/z-url-preview/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/z-url-preview/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/z-url-preview/reviews/)

 * 21 replies
 * 2 participants
 * Last reply from: [StuartMillington](https://wordpress.org/support/users/stuartmillington/)
 * Last activity: [10 years, 7 months ago](https://wordpress.org/support/topic/ui-question/page/2/#post-6954763)
 * Status: resolved