This file contains 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 | |
class Model { | |
protected function __construct() { | |
parent::__construct(); | |
} | |
public static function get_instance() { | |
static $Inst = null; |
This file contains 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 | |
class Localize { | |
private $_data = []; | |
private function __construct () {} | |
static public function get_instance() { | |
static $Inst = null; |
This file contains 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 | |
/** | |
* Plugin Name: [ CoursePress 2 ] - Email Notifications on Completion | |
* Plugin URI: https://premium.wpmudev.org/ | |
* Description: Sends an email notification to the Student upon Course Completion | |
* Author: Alessandro Kaounas @ WPMUDEV | |
* Author URI: https://premium.wpmudev.org/ | |
* License: GPLv2 or later | |
*/ |
This file contains 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 | |
// Email macro: {last-post-link} | |
add_filter( 'forminator_replace_variables', function( $content, $content_before_replacement ) { | |
$args = array( 'numberposts' => '1' ); | |
$recent_posts = wp_get_recent_posts( $args ); | |
$post = '<a href="' . get_permalink( $recent_posts[0]['ID'] ) . '">' . get_the_title( $recent_posts[0]['ID'] ) . '</a>'; | |
return str_replace( '{last-post-link}', $post, $content ); |
This file contains 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 | |
// Assuming one phone field in a form | |
add_filter( 'forminator_custom_form_submit_errors', 'check_form_data', 99, 3 ); | |
function check_form_data( $submit_errors, $form_id, $field_data_array ) { | |
$valid = false; | |
foreach( $field_data_array as $val ) { | |
if( $val['name'] == 'phone-1' ) { | |
$phone = $val['value']; |
This file contains 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 | |
$quiz_id = 7; | |
$entry_metas = array( | |
array( | |
'name' => 'text-1', | |
'value' => 'Text Input Value' | |
), | |
array( | |
'name' => 'text-1', | |
'value' => 'Text Input Value' |
This file contains 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 | |
$quiz_id = 7; | |
$entry_meta = array( | |
'name' => 'text-1', | |
'value' => 'Text Input Value' | |
); | |
Forminator_API::add_quiz_entry( $quiz_id, $entry_meta ); |
This file contains 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 | |
$poll_id = 7; | |
$entry_id = 32; | |
$entry_meta = array( | |
'name' => 'text-1', | |
'value' => 'Text Input Value' | |
); | |
Forminator_API::update_poll_entry( $poll_id, $entry_id, $entry_meta ); |
This file contains 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 | |
$poll_id = 7; | |
$entry_metas = array( | |
array( | |
'name' => 'text-1', | |
'value' => 'Text Input Value' | |
), | |
array( | |
'name' => 'email-1', |
This file contains 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 | |
$form_id = 7; | |
$entry_meta= array( | |
array( | |
'name' => 'text-1', | |
'value' => 'Text Input Value' | |
), | |
array( | |
'name' => 'email-1', |
NewerOlder