Add media window

This topic is: resolved

 

Thank you for contacting me. Please note that I live in the GMT+3 time zone - responses might be delayed by this.

Tagged: 

This topic has 9 replies, 2 voices, and was last updated 6 months, 1 week ago by Szabi – CodeRevolution.

Viewing 9 reply threads
  • Author
    Posts
    • #10596


      examadmin
      Participant
      Post count: 6

      I’m working now with Aiomatic media extension and find some issues.

      1. As I see the Aiomatic AI Generated Images and Aiomatic Royalty Free Images tab is hidden on frontend. When I open the add media or load a picture button, I can reach this only on backend. Is it possible to show this tabs also in frontend or to have switch for it in settings?

      2. If I open the add media and window is open to choose a media: I did not choose just close the window. And if I open again even from different button the Aiomatic AI Generated Images and Aiomatic Royalty Free Images tab is there but it is not possible to open them. After refreshing the page it works again one time.

       

    • #10597


      Szabi – CodeRevolution
      Keymaster
      Post count: 4621

      Hello,

      First of all, thank you for your purchase.

      Can you send me, please, temporary admin login credentials to your WordPress install, so I can check this issue out? Send it, please, to my email address: kisded@yahoo.com

      Regards, Szabi – CodeRevolution.

    • #10713


      examadmin
      Participant
      Post count: 6

      <div>I’m trying to use your great additional tabs of media library in frontend in our wplms-front-end plugin. I have found the right place in this plugin source, a js file where is handled the media library upload calling. I have checked that in your media-ai-script.js file are the functions for the tabs. Would you give me a hint how to use them to call the media lib upload window using this functions? Where can I find such call in your source as an example?</div>
      <div>Thanks in advance,</div>
      <div>P.</div>

    • #10716


      Szabi – CodeRevolution
      Keymaster
      Post count: 4621

      Hello,

      I am not sure if I understand your question correctly, as the media upload window cannot be called from the function, but instead, it is integrated in the upload window, to provide it a new tab for AI content.

      Please explain in detail.

      Regards.

    • #10717


      examadmin
      Participant
      Post count: 6

      As I see in your media-ai-script.js you have defined the necessary functions for extra 2 tabs in media window. I would like to use those extra 2 tabs (The AI image generation and royalty free pictures) in front-end when somebody open the media window. I have found in my side (wplms-front-end plugin) the place where the media window is handled. I need some hint how to build your extra features to standard media selection window. On the back end, if I open select the featured image button the window has 4 tabs. I would like to know in which file of your code can I find how you implement the functions and class defined in media-ai-script.js to be able to provide the 4 tab function is media window in back end.

    • #10718


      Szabi – CodeRevolution
      Keymaster
      Post count: 4621

      Well, this depends on how you are opening the media window on the front end, if you are using a custom plugin for this. This sounds complicated to achieve.

    • #10719


      examadmin
      Participant
      Post count: 6

      Yeee, that is why I’m traying to understand how did you implement this into your code. For example in single post creator in back-end for featured image or somewhere else where you handle a button of Select media and you open the 4 tab media window. 🙂 The opening on my side is not very complex:
      <div>
      <div>var t;</div>
      <div>jQuery(“.upload_image_button”).on(“click”, function(e) {</div>
      <div>var i = jQuery(this);</div>
      <div>t ? t.open() : ((t = wp.media.frames.media_uploader = wp.media({</div>
      <div>title: i.data(“uploader-title”),</div>
      <div>library: {</div>
      <div>type: “image”,</div>
      <div>query: !1</div>
      <div>},</div>
      <div>button: {</div>
      <div>text: i.data(“uploader-button-text”)</div>
      <div>},</div>
      <div>multiple: i.data(“uploader-allow-multiple”)</div>
      <div>})).on(“select”, function() {</div>
      <div>vare = t.state().get(“selection”),</div>
      <div>a = i.data(“input-name”);</div>
      <div>e.map(function(e) {</div>
      <div>e = e.toJSON(), console.log(e);</div>
      <div>vart = “”;</div>
      <div>e.sizes && (t = void0 !== e.sizes.thumbnail?e.sizes.thumbnail.url:void0 !== e.sizes.medium?e.sizes.medium.url:e.sizes.full.url), i.html(‘<input id=”‘ + a + ‘” class=”post_field” data-type=”featured_image” data-id=”‘ + a + ‘” name=”‘ + a + ‘” type=”hidden” value=”‘ + e.id + ‘” />’)</div>
      <div>})</div>
      <div>}), t.open())</div>
      <div>});</div>
      </div>

    • #10721


      Szabi – CodeRevolution
      Keymaster
      Post count: 4621

      Try adding this PHP code to your site, to add the script also to the front end scripts:

      add_action('wp_enqueue_scripts', 'aiomatic_admin_do_post');
      How to add code to your WP site: https://woorkup.com/add-php-to-wordpress/
    • #10725


      examadmin
      Participant
      Post count: 6

      Thank you! You are great! This is so simple solution!

      This did the trick!

      P.

    • #10728


      Szabi – CodeRevolution
      Keymaster
      Post count: 4621

      I am glad to help.

Viewing 9 reply threads

The topic ‘Add media window’ is closed to new replies.