PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Different Post title and permalink

  1. Anonymous
    Unregistered

    We are always pushing the limit of WordPress and Gravity Forms but again we have hit a wall.

    This time we are trying to build a post but we want the title of the post to be populated from the "Post Title" field and the permalink to be built from "Post Title" + another field.

    we had the post template as {Post Title:2}-{Other:10} this gave us a nice permalink of:
    http://website.com/post-title-other-field.
    BUT the post title was "Post Title Other Field" <--- not what we want.

    Now for the question.
    How does Gravity Forms build the permalink?

    Does it:
    A) Just set the title and let WordPress auto generate?
    B) Or is there a function that actually builds the permalink?

    If it is A does anyone know of a function that will help us set the permalink of the post being generated?

    Posted 14 years ago on Wednesday December 14, 2011 | Permalink
  2. It's A:
    A) Just set the title and let WordPress auto generate?

    WordPress handles the permalink. However, you can generate a sanitized permalink with the sanitize_title WordPress function, then update the post to save that new permalink using the wp_update_post function hooked to gform_after_submission.

    Posted 14 years ago on Thursday December 15, 2011 | Permalink
  3. sascha
    Member

    Just what I was looking for!

    Posted 13 years ago on Saturday January 14, 2012 | Permalink