WordPress.org

Ready to get started?Download WordPress

Forums

Slidorion
Overwriting send_to_editor causes bad behaviour (3 posts)

  1. cameron1729
    Member
    Posted 1 year ago #

    In slidorion_uploader.js this plugin uses the same name as a function in wp-admin/js/media-upload.js (specifically send_to_editor).

    This causes issues when WordPress calls send_to_editor - this plugin's version is called instead of WordPress's.

    This is particularly an issue when using the "Media Library" tab in the "Add Media" dialogue (the one that you use when creating a post/page/etc). When you press the "Insert into Post" button, nothing visibly happens.

    I made a quick change to the function definition in the plugin - and I doubt this is the 'proper' way to resolve this issue: http://pastebin.com/ngg0b0Dm

    This checks if the current page is the 'new sliderion' page, and if it is, we use the code from the plugin, otherwise we use the code from media-upload.js. This will only work for this specific domain (I was too lazy to make it work in general because it's probably not the right way to resolve the issue anyway).

    This plugin is overriding WordPress's core functionality, so I think this is a pretty serious issue and needs to be resolved properly.

    http://wordpress.org/extend/plugins/slidorion/

  2. IvanRuisoto
    Member
    Posted 1 year ago #

    Hi,

    I have the same problem.

    I have used your code and i modified the condition:

    if ((new RegExp('slidorion_menu_new&edit=3')).test(window.location)) {

    Now the domain is not important. Although it's not the best way to solve this problem I haven't any better.

    bye,

  3. cameron1729
    Member
    Posted 1 year ago #

    Hi, glad my hack helped.

    Looking at your condition, I think you should remove the &edit=3 otherwise you will miss some matches.

    Cheers.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic