Need help with my first plugin (3 posts)

  1. amitstreak
    Posted 4 years ago #


    I'm taking my first steps in writing plugins and I want to write one (as a first step of my project) that does the following:

    1. A visitor goes to a page named "input" and the only 2 elements displayed in that page (other than the theme's) are a text field called "Address" and a "Submit" button.

    2. The visitor enters their address and hits the button. As a result the address is saved in a global variable and added to the WordPress DB.

    3. The visitor goes to another page called "output" and the only element displayed there is a non editable text field.
    The address is extracted from the DB and displayed in that field.


    For step 1:
    a. I guess I need an action function here. And I know the page ID. But which hook do I use?
    b. How do I display the text field and button? Do I need to give the field an ID?
    c. How do I set their location in the page?

    step 2:
    a. Do I need a filter or an action function here? Which hook?
    b. What is the best way to insert the data into the DB? use wpdb class?

    step 3:
    I guess when the first two steps are clear this one will be as well.


  2. Tim Moore
    Posted 4 years ago #

  3. amitstreak
    Posted 4 years ago #

    Hi Tim.

    I already went through these guides several times and really wrecked my brain trying to find the answers before I posted my questions here but with no luck.

    I would really appreciate a more specific guidance.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.