WordPress Built In Dialog Box For My Plugin

This can be done using a front-end developer’s skills. What i achieved through the customization is as follows. Through the following code: <?php add_thickbox(); ?> <div id=”my-content-id” style=”display:none;”> <link rel=”stylesheet” href=”https://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css”> <script src=”https://code.jquery.com/jquery-1.10.2.js”></script> <script src=”https://code.jquery.com/ui/1.11.4/jquery-ui.js”></script> <script> $(function() { $( “#tabs” ).tabs(); }); </script> <div id=”tabs” style=””> <ul> <li><a href=”#tabs-1″>Insert Edit/link</a></li> <li><a href=”#tabs-2″>My Second Tab</a></li> </ul> … Read more

How to export a list of all media urls? [closed]

You can get what you want via: function get_the_file_urls( ) { $query_media_urls = array( ‘post_type’ => ‘attachment’, ‘post_status’ => ‘inherit’, ‘posts_per_page’ => – 1, ); $query_urls = new WP_Query( $query_media_urls ); foreach ( $query_urls->posts as $url ) { echo ‘<ul>’ . ‘<li>’ . wp_get_attachment_url( $url->ID ) . ‘</li>’ . ‘</ul>’; } } This could either … Read more

Rename media files generated during upload

Using my own code from here, i updated the logic to add the name of the image size instead of the suffix, try adding this to your functions.php file: add_filter(“wp_image_editors”, “my_wp_image_editors”); function my_wp_image_editors($editors) { array_unshift($editors, “WP_Image_Editor_Custom”); return $editors; } // Include the existing classes first in order to extend them. require_once ABSPATH . WPINC . … Read more

How to bulk Edit Dates in Media Library?

You can use a plugin called Media Library Assistant. After you install it go to your Media > Assitant (wp-admin/upload.php?page=mla-menu). Select all the images or the ones you want to edit. Click on Bulk Actions. Click on Edit and then Apply. Then you will see Uploaded on and use the date you wish.

Thumbnails generated from PDF in the “Media” section – how to show them in theme template?

To get the attachment’s icon, you can use wp_get_attachment_image(). For example, let’s say I’ve uploaded a Word doc and it’s got the ID 1234: // Parameter 3 – ‘true’ – tells WP to treat this as an icon. $img_tag = wp_get_attachment_image( 1234, ‘thumbnail’, true ); // $img_tag contains: // <img width=”48″ height=”64″ // src=”http://example.com/wp-includes/images/media/document.png” // … Read more

How can I receive the image id using the media box?

You can also add in a filter that can add the ID as a html5 data attribute to the returned HTML fragment from send_to_editor. public function image_to_editor($html, $id, $caption, $title, $align, $url, $size, $alt){ $dom = new DOMDocument(); @$dom->loadHTML($html); $x = new DOMXPath($dom); foreach($x->query(“//img”) as $node){ $node->setAttribute(“data-id”, $id); } if($dom->getElementsByTagName(“a”)->length == 0){ $newHtml = $dom->saveXML($dom->getElementsByTagName(‘img’)->item(0)); … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)