This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd d: | |
| cd xampp | |
| cd htdocs | |
| mkdir test_site | |
| cd test_site | |
| git clone git_repo_url.git | |
| wp core download --allow-root | |
| wp core config --dbname="test" --dbuser=wp --dbpass=wp --dbhost="localhost" --allow-root | |
| wp core install --url=test.dev --title="test - A WordPress Site" --admin_user=admin --admin_password=password [email protected] --allow-root |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| wp user list |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // change the number suffix to the one corresponding to your form and field's id! | |
| add_filter( 'gform_field_validation_1_1', 'wp_doin_validate_password_field', 10, 4 ); | |
| /** | |
| * @hook gform_field_validation_4 | |
| * | |
| * This function is assigned to the old password field, and then iterates over all form fields | |
| * if it hits a field with the pass-confirm class assigned it then compares it's value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // make sure to change 5he prefix to the one you are using with your forms | |
| add_action( "gform_pre_submission_4", "wp_doin_edit_pre_submission" ); | |
| /** | |
| * @hook gform_pre_submission_4 | |
| */ | |
| function wp_doin_edit_pre_submission( $form ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // remember, the hook suffix, should contain the form id! | |
| add_filter( "gform_field_validation_3", 'gf_custom_validation', 10, 4 ); | |
| /** | |
| * Custom GF validation function used for pagination and required fields | |
| * | |
| * @return string | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // remember - the suffix of the hook should contain specific form id! | |
| add_action( "gform_pre_submission_3", "wp_doin_pre_submission" ); | |
| function wp_doin_pre_submission($form) { | |
| // get the values entered by the user during the form submission | |
| // note: the input_{number} may be different in your case, make sure to double check the id of your field | |
| // and swap it if needed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // the _3 prefix has to match the id of the form you have created | |
| add_filter( "gform_field_validation_3", "login_validate_field", 10, 4 ); | |
| function login_validate_field($result, $value, $form, $field) { | |
| // make sure this variable is global | |
| // this function is fired via recurrence for each field, s | |
| global $user; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // the _3 prefix has to match the id of the form you have created | |
| add_action( "gform_after_submission_3", "login_form_after_submission", 10, 2 ); | |
| function login_form_after_submission($entry, $form) { | |
| // get the username and pass | |
| $username = $entry[1]; | |
| $pass = $entry[2]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // this can be placed anywhere in the plugin (before storing the form values in the database) | |
| // $form_data could be an array of data which was created by the user | |
| do_action('my_action_after_save', $form_data); | |
| // we're telling wordpress to execute the code added in the second parameter method right where do_action has been specified | |
| add_action('my_action_after_save', 'my_action_after_save_hook', 10); | |
| /** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <h1>Sample WordPress Page</h1> | |
| <div class="entry-content"> | |
| <h2>Heading 2</h2> | |
| <p>Lorem ipsum dolor sit amet, <a href="http://www.example.org">consectetuer adipiscing</a> elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud <strong>exerci tation</strong> ullamcorper | |
| suscipit lobortis nisl ut aliquip ex ea commodo consequat.</p> | |
| <p>Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse <em>molestie consequat</em>, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio <abbr title="dignissim qui blandit">dqb</abbr> praesent luptatum zzril | |
| delenit augue duis dolore te feugait nulla facilisi.</p> |