WordPress.org

Support

Support » Plugins and Hacks » Hacks » Need help with my first plugin

Need help with my first plugin

  • Hi.

    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.

    Questions:

    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.

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Need help with my first plugin’ is closed to new replies.
Skip to toolbar