WordPress Quick Guide: Add a Custom PHP Function by Elias Ericson

WordPress Quick Guide: Add a Custom PHP Function by Elias Ericson

Author:Elias Ericson [Ericson, Elias]
Language: eng
Format: azw3
Publisher: UNKNOWN
Published: 2017-06-20T04:00:00+00:00


Enter the WordPress project you just installed.

Locate the file “functions.php”. It is within the folder wp-content->themes->twentyseventeen.

Open and edit “functions.php”.

This is a file that contains many functions for the theme. You can add your own functions here at the end of the file.

We are going to add this function to the file. The function is called “save_form”. It inserts data entries into our database by taking the values from the “contact form 7” fields we have and inserting them into a mysql-table. Our fields on the website are “your-name” and “your-email” these fields are stored into the mysql-table “email_list” which has the fields “title”, “name”, “email”, “date”. The extra field “title” will store the name of the contact form. In our case “Register”. The “date” field stores the specific date that it was stored. Keep in mind, we have not yet created our mysql-table.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.