It seems the plugin has not been updated for long time. Is it still be maintanced?
]]>Hi. I see the plugin hasn’t been updated in a while, so I hope there still is someone reading this ??
The plugin uses wp_richedit_pre
in classes/fields/class.field.wysiwyg.php
on line 138, which is deprecated and replaced with format_for_editor
.
Would love to see bugfix release for this (maybe there are more issues like this, I only saw this one in the error log) so I don’t have to manually patch this after every website deployment.
Will be ignoring the error for now
Thank you for the plugin and in advance for the update.
]]>I have updated WordPress 6.1 and now no file download works.
Does anyone know how to solve it?
]]>Hello,
Love this plugin. I did notice however, that when I click “Remove” on an attachment, while it does remove it from the meta box on the post, it does not actually detach it from the post.
I know how to go into the Media Library and detach but would prefer my clients didn’t have to figure out how to do that.
I created a custom instance using the provided code in the GitHub. Is there something else I need to add to get the detaching to work?
Thank you!
]]>This probably is beyond the scope of this forum, but I wonder if there is a way to use this code and also provide a metabox for users to put in links to resources stored on other servers–for example, if the files are huge and we don’t want them in the WordPress media library. In other words, could some of this same code be duplicated for an additional section in the post entry screen, where users could type in URL’s and descriptions, and the interface would let them keep adding more the way this attachments interface does?
]]>WordPress 5.5.3 giving a warning, after installing this plugin. wp_richedit_pre is deprecated since version 4.3.0! Use format_for_editor() instead.
]]>Hi
This plugin is exactlty what I was looking for. Nevertheless, I’m afraid the attachments are not displayed
I have make a test in my web, in a post (https://comunicacionparaclubes.atodaplana.es/estamos-haciendo-una-prueba-del-plugin-attachments/), and the attachment does not appear.
Here you can see I have already included the attachment:
https://www.atodaplana.es/atp/attachment.jpg
Thanks in advance
Jose Antonio de Luis
I use Elementor.
Elementor has an image carousel that can be put on a template and then dynamically display “images attached to post”.
The carousel can find the images when I put them into the post content area. The problem is that then they will show up in that section of the design as well which is not what I want as I want to put text there. As here:
https://johnbowley.com/dokkalfar/
This is why I wanted to use your plugin to add the images as attachments and not have to include them in the post content. But Elementor can’t see these attachments. See:
https://johnbowley.com/jazzgame/. The carousel is blank despite 3 images attached via your plugin.
Can you help me fix it?
Thank you,
Violet
]]>Hi there, we have edited the snippet provided by you to integrate the attachments with our theme. we need some help with hiding the DIV if there is no attachment added to the post. At present is shows an empty space. Would you mind helping by providing an additional snippet we can add to our single.php
Our edited snippet below:
<!–Include Attachments to Post–>
<div class=”attachments”>
<?php $attachments = new Attachments( ‘attachments’ ); /* pass the instance name */ ?>
<?php if( $attachments->exist() ) : ?>
<h3>Attachments</h3>
</br>
<?php while( $attachments->get() ) : ?>
<h5>Name: <?php echo $attachments->field( ‘title’ ); ?></h5>
<h5>Size: <?php echo $attachments->filesize(); ?></h5>
<h5>url(); ?>”target=”_blank”>Download File</h5>
<?php endwhile; ?>
<?php endif; ?>
</div>
Found in error_log:
[09-Jan-2020 16:05:09 UTC] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /home/xxxx/public_html/wp-content/plugins/attachments/classes/class.attachments.search.php on line 64
[09-Jan-2020 16:05:10 UTC] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /home/xxxx/public_html/wp-content/plugins/attachments/classes/class.attachments.search.php on line 64
[09-Jan-2020 16:05:10 UTC] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /home/xxxx/public_html/wp-content/plugins/attachments/classes/class.attachments.search.php on line 64
Line 64:
for ( $i = 0; $i < count( $params['fields'] ); $i++ ) {
PHP Version 7.3
WordPress Version 5.2.3
Attachments Version 3.5.9
When I upload image that time blank screen in popup i can’t upload image from media.
]]>I understand that all I am doing is adding file references to the post, that is perfect, I will add them to the output in the theme template file, but the problem is, for a custom post type (DIVI theme “project”), there is no dialog to add the attachments?
]]>Hello all!
I’m an amateur sysad working for a nonprofit, just getting started with PHP. I’m trying to use this plugin but I’m clueless, because the documentation is incomplete and gibberish to me.
Apparently, to install it I must “Implement Attachments in your theme’s functions.php or your own plugin (see Usage)”.
However, the linked page gives no clue on how to “implement” that. It tells you how to disable the default instance or customize it, but not how to tell whether the default instance has been created automatically or, if not, what piece of code you have to add to the file functions.php, nor where.
On the other hand, the instructions on how to modify theme templates, which are the last step, are quite complete, but seem insufficient to do the trick. Now my posts only display this:
stdClass Object
(
[id] => 1308
[fields] => stdClass Object
(
[title] => ke0301.pdf
[caption] =>
)
[post_id] => 125
)
Please give me some hint, and complete the documentation.
]]>The Attachments Plugin dont work with the newest wordpress update. Since the update, in the editor field dont showing up the attachments fields.
]]>hello
i wanna add lightbox effect to this attachment image
can you help for this!
ty
]]>Hi Support,
Is there a way to allow shortcodes in the Caption editors?
Please help!
Thanks,
]]>can you help me? I need the user attachment in my plugin file front-end-pm
I have on Avatar in the plugin front-end-pm. get_avatar But i need the user attachment not the featured image but the post user attachment.
Can you help me with on working code?
The old code is:
$threadOut .= “<tr><td>from_user, ‘user_login’, ‘id’ ).”‘>” .fep_get_userdata( $post->from_user, ‘display_name’, ‘id’ ). “<br/><small>” .fep_format_date($post
]]>I have a problem with filesize.
with this code
while( $attachments->get() ) : ?>
<a class="attachment-url" target="_blank" href="<?php echo $attachments->url(); ?>"><h6><?php echo $attachments->field( 'title' ); ?></h6></a><p class="attachment-caption"><?php echo $attachments->field( 'caption' ); ?></p>
<p class="attachment-size">Dimensione: <?php echo $attachments->filesize(); ?></p>
<?php endwhile; ?>
the result is always “filesize 0”
other fields works perfectly. It’s a server problem?
ty
How do I set a filesize limit to attachments?
I understand that the plugin uses WP Media Library and I can set the upload limit on the server size, but doing so would also set a limit for the entire site. Right now my site has a 12MB limit on uploads. I just want a filesize limit for attachments.
For example, I want to limit attachments to 200KB. Suppose a user wants to attach an 8MB file. She clicks Attach and the Media Library opens. She uploads the file and she is successful. However, because this file is more than 200KB, I don’t want it attached. How do I accomplish this?
]]>Hi, first of all really nice plugin.
I have registered CPT and that works fine, i have only title + attachment available to it.
...........
$args = array(
'labels' => $array,
'public' => true,
'query_var' => true,
'has_archive' => true,
'hierarchical' => true,
'menu_position' => 5,
'supports' => array('title')
);
register_post_type('docs',$args);
Then i made this so i have the attach button in my ADD/edit CPT DOCS screen
function my_attachments( $attachments )
{
$args = array(
'post_type' => array( 'post', 'page', 'dokumenti' ),
);
$attachments->register( 'my_attachments', $args ); // unique instance name
}
add_action( 'attachments_register', 'my_attachments' );
And now i use this to show only attached documents of all posts from that category,
<?php
$args = array(
'post_type' => 'docs',
'posts_per_page' => 5,
);
$loop = new WP_Query( $args );
if ( $loop->have_posts() ) {
while ( $loop->have_posts() ) : $loop->the_post();
?>
<?php
$attachments = new Attachments( 'attachments' );
?>
<?php if( $attachments->exist() ) : ?>
<?php while( $attachments->get() ) : ?>
<?php
$class = f_detectIcon($attachments->subtype());
?>
<li>
s
<a href="<?php echo $attachments->url(); ?>" target="_blank" class="mtli_attachment <?php echo $class; ?>" download >
<?php echo $attachments->field( 'title' ); ?> (<?php echo $attachments->filesize(); ?>)</a>
</li>
<?php endwhile; endif; ?>
<?php
endwhile;
}
wp_reset_query();
?>
And if i echo the_title, it works, so WP loop is ok, but none of atachments are displayed. If i hovever replace ‘post_type’ => ‘docs’ to ‘post_type’ => ‘post’ so i read attachments of default POSTS it works. Why cant i see attachments from my CPT :S
I tried var dump on $attachments, its empty. but when i read default POST in loop its ok, and shows attachments.
Thanks
]]>Hi, is there any way to export / import the attachments linked to posts?
I used the built in option from wp to export all data and import to a new installation, but the attachments were not imported.
Is there a safe way to do this?
Thank you in advance
Hello,
as subject says i would like to show the date of the attachment in line with the title’s attachment.
Is there a way to do this?
Many thanks
V.
I have the following problem which I have explained on the WordPress Stack exchange community. https://wordpress.stackexchange.com/questions/225409/attachments-plugin-cannot-click-media-library-button
A high ranked developer watched my problem and advised me to bring it here. Hopefully there is someone who can help me or the author may has some attention to fix this?
]]>There is a conflict with the Booster for WooCommerce plugin. When activated, the Attachments metabox is not showing at the Woocommerce product edit pages. It is still working with normal pages and the attachments are still displayed at the front end as well.
I’ve also filed the conflict in their support forum. Hope this can be fixed by either one.
]]>After updating WP to 4.5, the attachments metabox doesn’t show anymore. I’m curious to know whether others also encountered this problem. If not, it might be a compatibility issue with the latest update of one of the other plugins.
]]>im try to show my attachments in order by Asc or Desc but i dont figure out the way to do that someone can help me pls… thanks
]]>Does anyone know how I could get the full URL of my image attached with the JSON API ?
So far I’m getting this :
"custom_fields": {
"attachments": [
"{\"attachments\":[{\"id\":\"4\",\"fields\":{\"title\":\"dark_underwater\",\"caption\":\"\"}},{\"id\":\"6\",\"fields\":{\"title\":\"goldenpinedanang0915-0001_14430626235\",\"caption\":\"\"}}]}"
]
}
Thank you very much
]]>Hi guys, you created great plugin!
Please, it’s possible display each attachment on own page (one picture on one page) – not lightbox.
If I click on picture, I go to the page with picture.
Thank you very much in advance,
Jan
]]>I use a Facebook Plugin that publishes a link of a post to my facebook page. I offer a og:image tag in my header for facebook to define the preview image in the facebookpost, this og:image is set by the first attachment thats found for a post. The problem is that wenn I create a new post add the title, text and some attachments, the time I press the publish button in wordpress facebook begins to search for the og:image tag but the attachments are not ready. I think the attachments plugin is called after the facebook plugin has done its work so their is no attachment for the og:image tag as facebook is searching for it.
When I first publish the post without activating the “post to facebook” option it saves the attachments and then when I publish the same post a second time its working because the attachments have already been saved previously. Is there any way of getting away with this timing issue?
hello,
i have theme gantry, that use timber and twig file for frontend
there is a code to past in frontend for retrive value of attach
i test this code but i don’t see nothing
<?php $attachments = new Attachments( 'attachments' ); /* pass the instance name */ ?>
<?php if( $attachments->exist() ) : ?>
<h3>Attachments</h3>
<p>Total Attachments: <?php echo $attachments->total(); ?></p>
<ul>
<?php while( $attachments->get() ) : ?>
<li>
ID: <?php echo $attachments->id(); ?><br />
Type: <?php echo $attachments->type(); ?><br />
Subtype: <?php echo $attachments->subtype(); ?><br />
URL: <?php echo $attachments->url(); ?><br />
Image: <?php echo $attachments->image( 'thumbnail' ); ?><br />
Source: <?php echo $attachments->src( 'full' ); ?><br />
Size: <?php echo $attachments->filesize(); ?><br />
Title Field: <?php echo $attachments->field( 'title' ); ?><br />
Caption Field: <?php echo $attachments->field( 'caption' ); ?>
</li>
<?php endwhile; ?>
</ul>
<?php endif; ?>
thanks a lot
]]>