Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/ninja-fo.../includes/Actions
File: SuccessMessage.php
<?php if ( ! defined( 'ABSPATH' ) ) exit;
[0] Fix | Delete
[1] Fix | Delete
/**
[2] Fix | Delete
* Class NF_Action_SuccessMessage
[3] Fix | Delete
*/
[4] Fix | Delete
final class NF_Actions_SuccessMessage extends NF_Abstracts_Action
[5] Fix | Delete
{
[6] Fix | Delete
/**
[7] Fix | Delete
* @var string
[8] Fix | Delete
*/
[9] Fix | Delete
protected $_name = 'successmessage';
[10] Fix | Delete
[11] Fix | Delete
/**
[12] Fix | Delete
* @var array
[13] Fix | Delete
*/
[14] Fix | Delete
protected $_tags = array();
[15] Fix | Delete
[16] Fix | Delete
/**
[17] Fix | Delete
* @var string
[18] Fix | Delete
*/
[19] Fix | Delete
protected $_timing = 'late';
[20] Fix | Delete
[21] Fix | Delete
/**
[22] Fix | Delete
* @var int
[23] Fix | Delete
*/
[24] Fix | Delete
protected $_priority = 10;
[25] Fix | Delete
[26] Fix | Delete
/**
[27] Fix | Delete
* Constructor
[28] Fix | Delete
*/
[29] Fix | Delete
public function __construct()
[30] Fix | Delete
{
[31] Fix | Delete
parent::__construct();
[32] Fix | Delete
[33] Fix | Delete
$this->_nicename = esc_html__( 'Success Message', 'ninja-forms' );
[34] Fix | Delete
[35] Fix | Delete
$settings = Ninja_Forms::config( 'ActionSuccessMessageSettings' );
[36] Fix | Delete
[37] Fix | Delete
$this->_settings = array_merge( $this->_settings, $settings );
[38] Fix | Delete
[39] Fix | Delete
add_action( 'nf_before_import_form', array( $this, 'import_form_action_success_message' ), 11 );
[40] Fix | Delete
}
[41] Fix | Delete
[42] Fix | Delete
/*
[43] Fix | Delete
* PUBLIC METHODS
[44] Fix | Delete
*/
[45] Fix | Delete
[46] Fix | Delete
public function save( $action_settings )
[47] Fix | Delete
{
[48] Fix | Delete
[49] Fix | Delete
}
[50] Fix | Delete
[51] Fix | Delete
public function process( $action_settings, $form_id, $data )
[52] Fix | Delete
{
[53] Fix | Delete
if( isset( $action_settings[ 'success_msg' ] ) ) {
[54] Fix | Delete
[55] Fix | Delete
if( ! isset( $data[ 'actions' ] ) || ! isset( $data[ 'actions' ][ 'success_message' ] ) ) {
[56] Fix | Delete
$data[ 'actions' ][ 'success_message' ] = '';
[57] Fix | Delete
}
[58] Fix | Delete
[59] Fix | Delete
ob_start();
[60] Fix | Delete
do_shortcode( $action_settings['success_msg'] );
[61] Fix | Delete
$ob = ob_get_clean();
[62] Fix | Delete
[63] Fix | Delete
if( $ob ) {
[64] Fix | Delete
$data[ 'debug' ][ 'console' ][] = sprintf( esc_html__( 'Shortcodes should return and not echo, see: %s', 'ninja-forms' ), 'https://codex.wordpress.org/Shortcode_API#Output' );
[65] Fix | Delete
$data['actions']['success_message'] .= $action_settings['success_msg'];
[66] Fix | Delete
} else {
[67] Fix | Delete
$message = do_shortcode( $action_settings['success_msg'] );
[68] Fix | Delete
$data['actions']['success_message'] .= wpautop( $message );
[69] Fix | Delete
}
[70] Fix | Delete
}
[71] Fix | Delete
[72] Fix | Delete
return $data;
[73] Fix | Delete
}
[74] Fix | Delete
[75] Fix | Delete
public function import_form_action_success_message( $import )
[76] Fix | Delete
{
[77] Fix | Delete
if( ! isset( $import[ 'actions' ] ) ) return $import;
[78] Fix | Delete
[79] Fix | Delete
foreach( $import[ 'actions' ] as &$action ){
[80] Fix | Delete
[81] Fix | Delete
if( 'success_message' == $action[ 'type' ] ){
[82] Fix | Delete
[83] Fix | Delete
$action[ 'type' ] = 'successmessage';
[84] Fix | Delete
}
[85] Fix | Delete
}
[86] Fix | Delete
[87] Fix | Delete
return $import;
[88] Fix | Delete
}
[89] Fix | Delete
}
[90] Fix | Delete
[91] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function