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> |
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 | |
require_once(__DIR__ . '/class-like-saveit-db-installer.php'); | |
class Like_Saveit_Db extends Like_Saveit_DB_Installer { | |
/** | |
* Members Table Name | |
*/ | |
protected static $m_tbl_name = 'tbl_Member_Master'; |
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 | |
require_once(__DIR__ . '/includes/class-like-saveit-db.php'); | |
require_once(__DIR__ . '/includes/class-session-db.php'); | |
/** | |
* Plugin Name. | |
* | |
* @package Plugin_Name | |
* @author Your Name <[email protected]> | |
* @license GPL-2.0+ | |
* @link http://example.com |
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 | |
/** | |
* Simple Class which overwrites the session storage | |
*/ | |
class Like_Saveit_Session_Handler { | |
/** | |
* Store the db | |
* @var object |
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
<script> | |
function trigger_view(id) { | |
jQuery.post( | |
<?php echo json_encode( 'some_url' ) ?>, | |
{ | |
// a post id, fetched before | |
"cp_post_id": id, | |
// wordpress nonce for safety reason | |
"nonce": '<?php echo wp_create_nonce( 'view' ); ?>' | |
} |