regmanabq
Forum Replies Created
-
Forum: Plugins
In reply to: [Media Library Assistant] not saving caption / description data on uploadhey David, I was poking around a bit and ran across this.. just wanted to run it by you and see if that was right?? div id=”ttle”??
line 80 in media-library-assistant/js/mla-inline-edit-upload-scripts.js
te += '<div id="ttle'+id+'"><a id="_'+id+'" class="ntdelbutton"
Forum: Plugins
In reply to: [Media Library Assistant] not saving caption / description data on uploadok, and for reference for anyone finding this and wanting to do the same.. adding custom boxes to the edit media and upload media was fairly easy as well. Now I seem to get this field anywhere I’d like. woot!!!
/** * Add image credit fields metabox to the media details */ function rr_add_attachment_credit_author_field( $form_fields, $post ) { $field_value = get_post_meta( $post->ID, 'rr_credit_author', true ); $form_fields[ 'rr_credit_author' ] = array( 'value' => $field_value ? $field_value : '', 'label' => __( 'Credit Author' ), 'helps' => __( 'Who is the author we should credit?' ) ); return $form_fields; } add_filter( 'attachment_fields_to_edit', 'rr_add_attachment_credit_author_field', 10, 2 ); function rr_save_attachment_credit_author( $attachment_id ) { if ( isset( $_REQUEST['attachments'][$attachment_id]['rr_credit_author'] ) ) { $creditauthor = $_REQUEST['attachments'][$attachment_id]['rr_credit_author']; update_post_meta( $attachment_id, 'rr_credit_author', $creditauthor ); } } add_action( 'edit_attachment', 'rr_save_attachment_credit_author' ); /* ---------------------------------------------------------------------------- Functions for adding custom fields to attachments */
Forum: Plugins
In reply to: [Media Library Assistant] not saving caption / description data on uploadJust thought I’d kick over and give an update! I have successfully managed to get MLA to display a list of all the images on a page in the order they appear!! LOL.. and in the end it really wasn’t that hard.. now to figure out the template and such to get it to display the way I want.
Here’s the code for reference, anyone feel free to use or modify it as you wish.. maybe it could be a new fun option in the plug in too?
/* ---------------------------------------------------------------------------- Functions for getting all the images on a page and displaying an image credit list */ //gets the ids of all images included in the post/page function rr_get_images_on_page_ids ( $content ) { global $post; $image_list = array(); //if there is a featured image, let's grab it and add it to the list first $featured_image_id = get_post_thumbnail_id(); if ( $featured_image_id ) { $image_list[] = $featured_image_id ; }//end if featured image /* Check the content for <code>id="wp-image-%d"</code>. **second line modified to suit custom theme code** and put matches into array (&image_ids sorted by order they appear*/ //preg_match( '/id=[\'"]a-([\d]*)[\'"]/i', $content, $image_ids, PREG_PATTERN_ORDER );//for regular WP preg_match_all( '/id=[\'"]attachment_([\d]*)[\'"]/i', $content, $image_ids, PREG_PATTERN_ORDER );//for newspaper theme //Merge the two arrays and turn it into a comma delimited list $image_list = array_merge ( $image_list , $image_ids[1] ) ; $commalist.= implode( ',' , $image_list ); return $commalist; }//end rr_get_images_on_page_ids function rr_mla_gallery_query_arguments ( $all_query_parameters ) { global $post; //if we have a post_parent set to creditlist set up query to include images on page and sort by order they appear if ($all_query_parameters[ 'post_parent' ] = "creditlist" ) { $content = $post->post_content; $all_query_parameters[ 'include' ] = rr_get_images_on_page_ids ( $content ); $all_query_parameters[ 'orderby' ] = "post__in"; }//end if credit list return $all_query_parameters; }// END mla_gallery_query_arguments add_filter( 'mla_gallery_query_arguments' , 'rr_mla_gallery_query_arguments', 10, 2 );
would also be interested in anyone’s feedback on improving the code… it is v .01 and all!
Forum: Plugins
In reply to: [Media Library Assistant] not saving caption / description data on uploadDavid, so I checked the new dev version and featured image upload is back to normal!! I get the boxes as expected and they both seem to be working great!
I also noticed the other thread about the cat and tags being broken in media manager on 4.0.. wanted to report that both are working for me in 4.0. (albeit mines a fresh install with few plugins)
Now on to figuring out this template thing!
Forum: Plugins
In reply to: [Media Library Assistant] not saving caption / description data on uploadThanks David!! after toying with the plug in I’m starting to get it.. the templates and styles and such.. WOW… I’m starting to see the power of it all and starting to get my head around it all…
2- awesome!! I’ll download the dev version in the morning.. it’s been a long day on four hours sleep and I’m in no frame of mind to be testing anything accurately at this point! ?? but I’ll test in the morning and let you know how it goes.
3- again, awesome! I’ve done some poking around already this week in seeing how to add fields to the attachment details. I think I can figure it out, but yes, it might be a good option to have in the plug in as well. a simple “add your fields to the attachment details” similar to the “allow mapping on upload”?? I can see potential conflict perhaps with other plugins.. but something to think about! I”m sure I can figure out how to add custom fields to the screen regardless.
I’ve looked into ACF but right now it’s a bit over kill for what i need to do. who knows, in the future i might need it, but right now i’m trying to limit the number of different plugins and bloat.. I”m trying to stay lean and mean, lol.. that’s one reason I was originally attracted to this plug in, it seemed to do all I needed in one plugin instead of five… (and one that seems well coded and definitely well supported!)
Time for sleep, I’ll do that testing tomorrow and I’m sure I’ll have more questions!! (although I’m starting to answer the ones I do have now that i’m really grasping how you’ve done things and playing around with templates and such! this really is a very powerful plugin!)
Forum: Plugins
In reply to: [Media Library Assistant] not saving caption / description data on uploadDavid, thanks so much for the help. Yes, it seems you’ve grasped the details and parameters of my project! I”m going to go through and try this and see what happens today.
As I go through I’ll ask some questions to clarify some things.. let’s start with these?
1- the fields do indeed seem to be updating great! Problem fixed in dev version it seems!
2- I did notice a difference with the att cat and att tags fields handling between the add media screen (uploading a file to attach to a post) and the set featured image (clicking set featured image in the sidebar of a post and then uploading)… on the previous we get a nice toggle which opens a box showing all the cats and we can check box the ones we want, just like categories for a post. (awesome!)… and the tags field works just like a post tag field..
However, when uploading a featured image (on a post), one only gets a text field for each.. there is no list, no check boxes and no suggestions of most often used tags.. it seems that any att tags entered at this point will save to the database and show up in the library, but any category info is lost. In the media library though, both fields act like their post counterparts with check boxes and such…
my question then becomes.. is this expected behavior?? It seems WP handles featured images differently so I was unsure if this might be a bug, or just part of WP… I would expect the fields to act the same no matter the location: library, post add media or post set featured image.
3- Custom Fields – I’m a bit confused here, so bear with me.. I wasn’t able to see the field anywhere, but I think I confused myself.. Now I’ve got the field showing up in the library and the assistant and quick edit…
My only issue now is that I don’t see that field when uploading..
I have created the custom field inside the “custom field” tab of the plug in…
here is an example: field Title: rr_credit_author, data source: credit, existing text: replace, format: native, mla column: true, quick edit: true, bulk edit: true, option: text, delete null value: false
So, I guess my question becomes this: If I add the field in the plug in, is it a full fledged custom field that I can then add to the upload media screens??… and/or is there a way to automatically map/fill in that field on upload so it shows up in the edit screen without having to add it??
right now the behavior is this.. I hope this makes sense… you upload an image and are presented with all the fields we’ve been talking about.. title -> att tags…. then you must go into the library edit or the assistant edit and add the field from the drop down presented showing all the available fields… or.. you can go into the quick edit screen and it shows up there right off… once you add it or add data to it via the quick edit, it seems to show in all edit screens.
Sweet!!! Ok, half way there!
looking at the codex it seems I can indeed add custom fields to the upload screens.. but again, I guess my question is ‘is this a real custom field’ according to WP if it’s created in the plug in so I can add it in the upload screens? …. I saw a meta box example php in the folder, but honestly, i was very tired and didn’t really grasp it right off.. is this where an example might be found?? LOL..
I hope that makes sense.. I’ll poke around your meta box example in the meantime, just thought I’d ask as I go through putting this all together and had your ear.. forgive me if it’s too much, not expecting you to teach me WP!!! and I do appreciate your help.. I’m just coming over from Drupal and wow, WP can get me confused at times, but I’m starting to get the hang of it the more I poke around.
ok, off to try getting some galleries to display.. more to come, I’m sure!
Forum: Plugins
In reply to: [Media Library Assistant] not saving caption / description data on uploadNo kidding browser specific errors can be a pain.. never even occurred to me I had the 4.0 version loaded into chrome and 3.9 in FF.. but yes, last night i was seeing the error in both versions on both browsers.
Ok, well, i reinstalled java, checked all my settings, gave java an “allow” exemption for my domain just to be sure.. reloaded everything and VOILA!!! all seems to be working now.
my javascript console does show an error: Denying load of chrome-extension://ncmajlpbfckecekfamgfkmckbpihjfdn/jquery.min.map. Resources must be listed in the web_accessible_resources manifest key in order to be loaded by pages outside the extension. post.php?post=90&action=edit:1
but I get that error with or without MLA being active.. and it seems on most every page as well.. so nothing to do with MLA.
so.. looks like yes, it was just a cache thing and the new updated dev version is working right!!!
Awesome!!!! Thanks David!!! and I was glad to help, just sad I didn’t realize I was using chrome sooner!
Now.. any ideas on how I can make it work the way I was hoping?? ??
Forum: Plugins
In reply to: [Media Library Assistant] not saving caption / description data on uploaddouble checked with another image.. yes, seems firefox likes and saves changes as they happen, with tab or clicking between fields.
but this time Chrome only gets a spinner on the title field and no saved… no spinner on any other field.
Forum: Plugins
In reply to: [Media Library Assistant] not saving caption / description data on uploadseems chrome and firefox both like the title field changes.. but chrome doesn’t see the other field changes.
EDIT.. Never mind… chrome does not like the title field either.. all we get is a spinner and no save.
Forum: Plugins
In reply to: [Media Library Assistant] not saving caption / description data on uploadok, so… uploaded new image (went to post, hit add media, upload image)
Then I went into the caption field and typed “test caption” and tabbed to the alt text… and I DID see the spinner for a second, but no “saved”
went to library and could see the image, hit edit image and no caption
went back to insert media screen, entered alt text and tabbed to description.. no spinner
enter description and tab out.. no spinner
and back to library… no new data
back to insert media.. enter a test att category by clicking with mouse
back to library and test cat saved.. same with test att tag..usually I don’t tab, and with all my previous tests it was by clicking into the field with a mouse.. ( I should learn to tab more! LOL_)
Tried another image…..
add media.. upload file… it shows up in library… modify the title and I get spinner with “saved” and then it goes away.. tab to caption.. add caption text.. spinner shows but NO saved… enter alt text.. no spinner.. enter description.. no spinner… and no data saved to library other than the changed title..
same result with test image 3… spinner shows on title change with saved… tab to caption and just spinner.. no spinner and no saved on other fields.
OH… just thought, i’m using Chrome, let me try Firefox…
OK.. on firefox we get expected results…
On each field I get spinner AND saved when tabbing… I also get spinner and saved when clicking with the mouse!!!
and all fields saved to library via firefox v 31.
chrome version is Version 37.0.2062.103
Forum: Plugins
In reply to: [Media Library Assistant] not saving caption / description data on uploadOK, so just tested the dev version on the 4.0 install and it’s still not working..
here’s what I did: Downloaded https://downloads.www.ads-software.com/plugin/media-library-assistant.zip (dev version listed in development page)
Removed old version (deactivate, uninstall, delete all files)
Install new version via plug in page “add new” uploaded it, installed activated
went to post, “add media”, uploaded test image, title already inserted (file name), added caption, alt text, description, att category, att tag
Saved post
went to library, edit test imageResult: title saved fine but no data in caption, alt text or description, att category and att tag saved fine.
Forum: Plugins
In reply to: [Media Library Assistant] not saving caption / description data on uploadDavid, glad to help and glad you could recreate it. Figured it was an update thing and glad you could fix it… thought maybe I was going crazy there for a bit! LOL
Maybe you could also help to point me in the right direction for what I want to mainly use the plug in for.. being new to WP I’m a bit confused about how it handles images and what I thought would be a simple thing seems to be more complicated than I imagined.. It seems like your plug in might do this, but so far I’ve been kind of lost. Can you point me in the right direction??
What I want to do is provide image credits, to credit the photographers and link back to them. I have found some plug ins that modify the caption with custom fields, but it wasn’t really what I was hoping for. What I would like is more like a widget, or even to append the content at the bottom with a list of the images on a page/post with their info.
IE:
IMAGE CREDITS
- Title of Featured Image – Caption – copyright by Author (link to them) Licensed: License type (maybe link to license) via Supplier (link to supplier)
- Title of Image 1 – Caption – copyright by Author (link to them) Licensed: License type (maybe link to license) via Supplier (link to supplier)
- Title of Image 2 – Caption – copyright by Author (link to them) Licensed: License type (maybe link to license) via Supplier (link to supplier)
I can add the fields ok, credit_author, credit_author_link, credit_license_type, credit_license_link, credit_supplier, credit_supplier_link..
But so far I’ve been unable to figure out how to get that data in / back out. (hopefully for many images it can be mapped on upload, but I’d also like to have fields to add the data if it’s not)
when I upload / edit an image, I can see the fields you’ve added (metadata, featured in, inserted in, gallery in, MLA gallery in… but I don’t see my custom fields. I’d like to be able to insert / edit that data upon upload and edit and then grab the fields for all the images featured in and inserted in that page or post and display them in a widget with the MLA gallery or use a filter to display them in a block at the end of the content.
The whole “attach” thing has me a bit confused, I’ll admit, I can get a gallery of all attached images to show, but it seems there’s no real easy way to just find all the images on a post unless they are “attached”. Since the plug in tracks the pages each image is inserted / featured in, it seems it’s possible..
I just have not been able to figure out how to add the boxes to edit the fields and then how to get the gallery to display them in a list.
Any advice would be much appreciated!!!