Marcel
Forum Replies Created
-
Forum: Plugins
In reply to: [SMK Sidebar Generator] I can not enter sidebarsHey,
it’s a fatal error caused by the plugin here:
Cannot use string offset as an array in /var/www/virtual/developer/htdocs/wp-content/plugins/smk-sidebar-generator/render.php on line 436
This caused a warning in earlier php version, but in newer ones it now causes a fatal error. Maybe this helps someone smarter than me to fix this. ??
Cheers!
As I said, Gravity is a great plugin, but it can be a real pain in the… ??
You’re right. It’s only used to create new posts, not to edit existing posts. I also had problems with advanced custom fields and Gravity as it, as you said, does it’s own kind of upload thing.
But maybe this can help: https://www.gravityhelp.com/documentation/gravity-forms/extending-gravity-forms/hooks/filters/gform_post_data/
The post_data is an array that contains the same info as wp_insert_post()?! The filter is executed right before the post gets saved. Maybe this contains all the necessary info?
If this won’t do it either, let people know, that they need to use the Advanced file uploader. ??
All right!
The CPT plugin for Gravity adds a new value to the $form array.
$form -> fields -> 0 -> saveAsCPTsaveAsCPT returns the post type slug, so it’s perfect for us. ??
If that value doesn’t exist Gravity always saves the entry as a regular post. So, if you’re using one of Gravity’s filters/hooks you can access $form, check for that field and if it exsits use its value, if not, just save it as a post.
I’ll send you an example dump of $form right away!
I see. Well, when using the default Gravity fields to create a new entry, it’s always a post. Except, when using this plugin: https://www.ads-software.com/plugins/gravity-forms-custom-post-types/
It allows mapping a form to a custom post type. Let me see, if there is anything available when calling the form, that could tell us which post type it is set to.
We’re so close to having a winner! ??
Uploads and featured thumb now all get stored in the appropriate folders! Great job. It’s only ignoring the post_type setting. Right now, it always puts it into a “page” folder.
Other than that it works like a charm.
Just gave it a try and ran into a small bug:
As soon as I activate the new version, I get an error that the upload folder is not writable. Deactivating the plugin removes the error. Folder chmods are all set correctly.
It works! Puts the images right into the id folder.
This is what you get now:
/uploads/gravity_forms/[form-string]/2015/03/2015/02/page/[id]/file.jpgIt still keeps two “month” and “year” folders, but other than that it looks great.
But here is a small bonus challenge. ??
Using the file upload field works great. In Gravity forms you can also use fields to create a new post entry. One of these fields is used for uploading the featured image. Gravity seems to use another function for uploading, as it puts the image into the default WP uploads folder and not into its own Gravity uploads folder.
When using this field to upload the featured image, the custom structure is ignored completely and instead just uploaded into the current month-folder.
Let me see, if I can find out what they’re doing differently. ??
Hey,
awesome plugin! I just tried the dev version with Gravity and thought I let you know what happens. Custom upload dir is set to “/%year%/%monthnum%/%post_type%/%post_id%”
WP version is 4.1.1Unfortunately instead of placing the images inside the folder with the post id, it puts the uploaded images into the parent folder (here the post type), creates an empty id-folder and adds the post id to the filename. ??
The way you want it:
/uploads/gravity_forms/[form-string]/2015/03/page/[id]/file.jpgWhat you get:
/uploads/gravity_forms/[form-string]/2015/03/2015/02/page/[id]file.jpg/[id]Let me know, if I can help you debug it!
cheers,
Marcel
Forum: Plugins
In reply to: [Diamond MultiSite Widgets] Bloglist shortcode URLs don't lead to blogsHey,
same problem here. Maybe this post is useful for you:
https://www.ads-software.com/support/topic/permalink-not-pointing-to-users-sublogAs we are basically just pulling posts from one other blog in our multi site, I was able to hard code the blog’s ID into diamond’s function.