Go Back   Bill McIntosh's Business Inner Circle > Free Members Only Online Marketing Forums > Website Design / Website Development

Website Design / Website Development Website Design & Website Development Forums

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-14-2010, 07:38 PM
Junior Member
 
Join Date: Jan 2010
Posts: 8
Rep Power: 0
xarzu is on a distinguished road
Default Writing My First Wordpress Plugin

I want to write a WordPress Plugin.

I have read some of the documentation about how 'hooks" work but I do not know which hooks to take advantage of.

I want to write a plugin that launches a separate page when a new user wants to add a new comment.

In other words, I want the ability to insist that the user add more than just a username and email. I want to require that more information be inputted.

Maybe such a plug-in already exists or perhaps something simular. Does this sound familiar?

The Plugin I want to make is a page that comes up after a new user clicks on the “Submit Content” button when posting a reply to a blog. What sort of Filters or Hooks to I need to use?

I have been told that I wouldn't necessarily need another page. I could just more options in the regular comments area if I just want to the user to input more information. If so, could I include a couple of buttons that would launch the "about us" page in a separate browser?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-15-2010, 08:18 PM
Administrator

 
Join Date: Jan 2009
Location: California
Posts: 100
Rep Power: 10
louiseg has a spectacular aura aboutlouiseg has a spectacular aura about
Default Re: Writing My First Wordpress Plugin

This is a great question. It's something I can't answer without more investigation. Let me see if Scott can help you out on this one.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-15-2010, 09:17 PM
Senior Member

 
Join Date: Jun 2009
Posts: 104
Rep Power: 10
greg is on a distinguished road
Default Re: Writing My First Wordpress Plugin

You could do this by hooking into the comment form and adding additional fields to the form using:

add_action('comment_form', 'my_function_name');

Replace my_function_name with the name of your function that will output the html for your additional fields.

Then you would need to add another hook to capture the values that were entered in your new fileds using:

add_action('comment_post', 'my_function_name_2');

In my_function_name_2 function you would grab the $_POST data for your fields. If you want to store them in the database you'll need to either create a table in the plugin install or store the data as usermeta data.

To make the fields required you'd need to use javascript to validate them when the form is submitted.

You could also use javascript to open a new window when the form is submitted and just have another form in the new window for your custom fields but the user could just close the window and not fill in your fields.

Hope this helps
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 03:40 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Copyright 2008 Bill McIntosh All Rights ReservedAd Management plugin by RedTyger
no new posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53