Forums

not sure how to: custom for for new posts (5 posts)

  1. Calcvictim
    Member
    Posted 1 year ago #

    On my site the posts are formatted a certain way using html tags, and video links are also formatted a certain way.

    When an author posts I would like to have a form that takes their input and then formats it, the formatted output would be inserted into the regular new post window.

    I am not sure how to go about it, whether to use javascript forms or php forms and how to integrate it into wordpress itself. I would like to have a button somewhere that would initiate the form.

    Any help is appreciated.

  2. bcworkz
    Member
    Posted 1 year ago #

    I don't know the details, but I can give you a general direction that should work well.

    You want to modify the Posts admin menu so if the user is an author, the new post menu item links to your form page instead of post-new.php.

    Your form does what it does.

    Your form will create a new post when the author clicks insert. You will now have a post ID. Then your form will directly call post-new.php?post=ID&action=edit to open the regular editor with your formatted content.

    Good luck!

  3. Calcvictim
    Member
    Posted 1 year ago #

    bcworkz, thanks fro the reply but I am not sure if that is what I need. Let me try to describe better.

    Let's say I want to include in a post 2 videos that play inline and a description for each video so that the description lines up with the video playing. In order for this to happen I use html tags to play the video inline and adjust div properties. Right now I have quicktags added to assist posters with this so they do not have to memorize any html code, what they do is open the tags, paste the video address and close the tags, they do the same thing with a different tag that I created for comments.

    What I would like to do is have a form popup with the following parameters
    Video 1:
    Comment 1:
    Video 2:
    Comment 2:

    The poster would fill in each parameter and after they press "submit" the fields would get the tags added and inserted into the standard new posts form.

    I think I can do this with custom post types but I haven't tried yet and it's a little daunting, I am a wp beginner.

  4. bcworkz
    Member
    Posted 1 year ago #

    The biggest advantage of custom post types in your case is you can create a template to control how your content is displayed and how your post type will be well integrated into the system. You will probably find that controlling the input the way you want with the standard input form will still be difficult.

    You may still be better served with a 'pre-edit' form that does the formatting you want. If you design it well, you may not need to send it to the main edit form, rather directly publish the new custom post.

    There's a lot of elements to pull together, you need to start with something basic, and then embellish it as each element is successfully integrated. I would start by making a separate php page to handle the input and formatting it, then publishing it as a post. Don't worry about integrating it into the admin screens yet, this can be done later. Just launch the page for now from your browser's address or shortcuts bar.

  5. Calcvictim
    Member
    Posted 11 months ago #

    Ok, so I created the php code to do my processing, and I have a html form for my parameters.

    1) I am not sure if I need the html form at all
    2)How do I integrate this together with wordpress, if I create the custom post where would my php code be inserted?

    [Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

Topic Closed

This topic has been closed to new replies.

About this Topic