本文整理汇总了PHP中ninja_forms_return_echo函数的典型用法代码示例。如果您正苦于以下问题:PHP ninja_forms_return_echo函数的具体用法?PHP ninja_forms_return_echo怎么用?PHP ninja_forms_return_echo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ninja_forms_return_echo函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ninja_forms_mp_add_confirmation_error
function ninja_forms_mp_add_confirmation_error($form_id = '')
{
global $ninja_forms_processing;
if ($ninja_forms_processing->get_form_setting('ajax') == 1) {
$ajax = 1;
} else {
$ajax = 0;
}
if ($form_id == '') {
$form_id = $ninja_forms_processing->get_form_ID();
}
if ($ninja_forms_processing->get_form_setting('mp_confirm') == 1 and $ninja_forms_processing->get_action() == 'submit') {
if (!$ninja_forms_processing->get_all_errors() and (!$ninja_forms_processing->get_extra_value('_mp_confirm') or $ninja_forms_processing->get_extra_value('_mp_confirm') != 1)) {
if ($ajax == 1) {
$error_msg = ninja_forms_return_echo('ninja_forms_mp_output_confirm_page', $form_id);
$ninja_forms_processing->add_error('confirm-submit', '');
$ninja_forms_processing->add_error('confirm-submit-msg', $error_msg, 'confirm-submit');
} else {
$ninja_forms_processing->add_error('confirm-submit', '');
}
} else {
if ($ninja_forms_processing->get_all_errors() and $ninja_forms_processing->get_extra_value('_mp_confirm') == 1) {
if ($ajax == 1) {
$ninja_forms_processing->add_error('confirm-submit', '');
} else {
$ninja_forms_processing->add_error('confirm-submit', '');
}
}
}
}
}
示例2: ninja_forms_shortcode
function ninja_forms_shortcode($atts)
{
if (is_admin() && (!defined('DOING_AJAX') || !DOING_AJAX)) {
$return = '[ninja_forms_display_form';
if (is_array($atts)) {
foreach ($atts as $key => $value) {
$return .= ' ' . $key . '=' . $value;
}
}
$return .= ']';
return $return;
} else {
$form = ninja_forms_return_echo('ninja_forms_display_form', $atts['id']);
return $form;
}
}
示例3: ninja_forms_append_to_page
function ninja_forms_append_to_page($content)
{
global $ninja_forms_append_page_form_id;
$form = '';
if (is_array($ninja_forms_append_page_form_id) and !empty($ninja_forms_append_page_form_id)) {
foreach ($ninja_forms_append_page_form_id as $form_id) {
$form .= ninja_forms_return_echo('ninja_forms_display_form', $form_id);
}
} else {
$form = ninja_forms_return_echo('ninja_forms_display_form', $ninja_forms_append_page_form_id);
}
$content .= $form;
//add_filter( 'the_content', 'remove_bad_br_tags', 99 );
//remove_filter( 'the_content', 'wpautop' );
return $content;
}
示例4: ninja_forms_modal_output_modal
function ninja_forms_modal_output_modal()
{
if (!function_exists('ninja_forms_return_echo')) {
return FALSE;
}
global $ninja_forms_modal;
if (is_array($ninja_forms_modal)) {
foreach ($ninja_forms_modal as $form_id) {
$modal = '<div id="ninja-forms-modal-' . esc_attr($form_id) . '" class="nf-modal" style="display: none;">';
$modal .= '<div class="nf-modal-content">';
$modal .= ninja_forms_return_echo('ninja_forms_display_form', esc_attr($form_id));
$modal .= '</div>';
$modal .= '</div>';
echo $modal;
}
}
}
示例5: ninja_forms_lost_password_form
function ninja_forms_lost_password_form()
{
// Grab our plugin settings.
$plugin_settings = get_option('ninja_forms_settings');
if (isset($plugin_settings['feditor'])) {
$feditor_settings = $plugin_settings['feditor'];
} else {
$feditor_settings = '';
}
remove_action('ninja_forms_display_before_fields', 'ninja_forms_display_req_items');
// Return the reset password options.
$form_id = $feditor_settings['_lost_password'];
add_action('ninja_forms_display_after_fields', 'ninja_forms_lost_password_hidden_field');
add_filter('ninja_forms_field', 'ninja_forms_lost_password_filter_desc', 10, 2);
$form = ninja_forms_return_echo('ninja_forms_display_form', $form_id);
$form = apply_filters('ninja_forms_lost_password_form', $form, $form_id);
return $form;
}
示例6: ninja_forms_mp_copy_page
function ninja_forms_mp_copy_page()
{
$form_id = $_REQUEST['form_id'];
$fields = $_REQUEST['field_data'];
$order = 999;
foreach ($fields[0] as $f => $data) {
$data = serialize($data);
$args = array('type' => '_page_divider', 'data' => $data, 'order' => $order, 'fav_id' => 0, 'def_id' => 0);
$new_divider = ninja_forms_insert_field($form_id, $args);
$new_html = ninja_forms_return_echo('ninja_forms_edit_field', $new_divider);
}
unset($fields[0]);
$new_fields = array();
foreach ($fields as $field) {
foreach ($field as $f => $data) {
$field_id = str_replace('ninja_forms_field_', '', $f);
$field_row = ninja_forms_get_field_by_id($field_id);
$field_type = $field_row['type'];
if (isset($field_row['fav_id'])) {
$fav_id = $field_row['fav_id'];
} else {
$fav_id = 0;
}
if (isset($field_row['def_id'])) {
$def_id = $field_row['def_id'];
} else {
$def_id = 0;
}
$data = serialize($data);
$args = array('type' => $field_type, 'data' => $data, 'order' => $order, 'fav_id' => $fav_id, 'def_id' => $def_id);
$new_id = ninja_forms_insert_field($form_id, $args);
$new_fields[] = $new_id;
}
}
foreach ($new_fields as $field_id) {
$new_html .= ninja_forms_return_echo('ninja_forms_edit_field', $field_id);
}
header("Content-type: application/json");
$array = array('new_html' => $new_html);
echo json_encode($array);
die;
}
示例7: ninja_forms_change_cr_field
function ninja_forms_change_cr_field()
{
global $wpdb, $ninja_forms_fields;
$field_id = $_REQUEST['field_id'];
$field_value = $_REQUEST['field_value'];
$x = $_REQUEST['x'];
$y = $_REQUEST['y'];
$field_row = ninja_forms_get_field_by_id($field_value);
$type = $field_row['type'];
$reg_field = $ninja_forms_fields[$type];
$conditional = $reg_field['conditional'];
header("Content-type: application/json");
$new_html = '';
if (isset($conditional['value']) and is_array($conditional['value'])) {
$new_html = ninja_forms_return_echo('ninja_forms_field_conditional_cr_value_output', $field_id, $x, $y, $conditional);
$new_html = utf8_encode($new_html);
$array = array('new_html' => $new_html, 'new_type' => $conditional['value']['type']);
echo json_encode($array);
}
die;
}
示例8: ninja_forms_registration_form
function ninja_forms_registration_form($form_id = '')
{
if (is_user_logged_in()) {
return __('You are already registered', 'ninja-forms-feditor');
} else {
$plugin_settings = get_option('ninja_forms_settings');
if ($form_id == '') {
$form_id = $plugin_settings['feditor']['default_register_form'];
if ($form_id == '_registration_form') {
$form_id = $plugin_settings['feditor']['_registration_form'];
// Add filters to remove form fields if the default editor has been selected.
add_filter('ninja_forms_display_fields_array', 'ninja_forms_feditor_filter_registration_fields', 10, 2);
}
}
// Add registration processing.
add_action('ninja_forms_display_after_fields', 'ninja_forms_registration_hidden_field');
$form = ninja_forms_return_echo('ninja_forms_display_form', $form_id);
$form = apply_filters('ninja_forms_register_form', $form, $form_id);
return $form;
}
}
示例9: ninja_forms_login_form
function ninja_forms_login_form($redirect_url = '')
{
global $ninja_forms_redirect_url;
$ninja_forms_redirect_url = $redirect_url;
// Check to see if the user is logged in. If they are, display a "logout" link rather than the login form.
if (is_user_logged_in()) {
$logout_url = '<a href="' . wp_logout_url() . '" title="' . __('Logout', 'ninja-forms-feditor') . '">' . __('Logout', 'ninja-forms-feditor') . '</a>';
$logout_url = apply_filters('ninja_forms_logout_link', $logout_url);
return $logout_url;
} else {
// Grab our plugin settings.
$plugin_settings = get_option('ninja_forms_settings');
if (isset($plugin_settings['feditor'])) {
$feditor_settings = $plugin_settings['feditor'];
} else {
$feditor_settings = '';
}
remove_action('ninja_forms_display_before_fields', 'ninja_forms_display_req_items');
// Check to see if the "lost password" variable has been set. If it has, show the password recovery information.
if (isset($_REQUEST['ninja_forms_lost_password']) and $_REQUEST['ninja_forms_lost_password'] == 1) {
$form = ninja_forms_lost_password_form();
} else {
// Return our login form.
$form_id = $feditor_settings['_login_form'];
add_action('ninja_forms_display_after_fields', 'ninja_forms_login_hidden_field');
add_action('ninja_forms_display_after_fields', 'ninja_forms_login_forgot_pass');
add_action('ninja_forms_display_after_fields', 'ninja_forms_login_register_link');
if ($redirect_url != '') {
add_action('ninja_forms_display_after_fields', 'ninja_forms_login_redirect_url');
}
$form = ninja_forms_return_echo('ninja_forms_display_form', $form_id);
$form = apply_filters('ninja_forms_login_form', $form, $form_id);
}
return $form;
}
}
示例10: ninja_forms_mp_confirm_page_check_visibility
function ninja_forms_mp_confirm_page_check_visibility($form_id)
{
global $ninja_forms_processing;
if (is_object($ninja_forms_processing)) {
// Hide the form if the confirm-submit error is set.
if ($ninja_forms_processing->get_error('confirm-submit')) {
// Check for the confirm error
// Add a filter to the form display that will hide the form.
add_filter('ninja_forms_display_fields_wrap_visibility', 'ninja_forms_mp_hide_form', 11, 2);
// Add a filter to the breadcrumb display that will hide them.
add_filter('ninja_forms_mp_display_breadcrumbs_visbility', 'ninja_forms_mp_hide_form', 11, 2);
// Add a filter to the page title display that will hide them.
add_filter('ninja_forms_display_mp_page_title', 'ninja_forms_mp_hide_page_titles', 10, 3);
// Display the confirmation page.
$html = ninja_forms_return_echo('ninja_forms_mp_output_confirm_page', $form_id);
echo $html;
// Remove our original form fields from the page
remove_all_actions('ninja_forms_display_before_fields');
remove_all_actions('ninja_forms_display_fields');
remove_all_actions('ninja_forms_display_after_fields');
//$ninja_forms_processing->remove_error( 'confirm-submit' );
}
}
}
示例11: ninja_forms_append_to_page
function ninja_forms_append_to_page($content)
{
global $ninja_forms_append_page_form_id;
if (!is_admin() && is_main_query() && (is_page() or is_single())) {
$form = '';
if (is_array($ninja_forms_append_page_form_id) && !empty($ninja_forms_append_page_form_id)) {
foreach ($ninja_forms_append_page_form_id as $form_id) {
$form .= ninja_forms_return_echo('ninja_forms_display_form', $form_id);
}
} else {
$form = ninja_forms_return_echo('ninja_forms_display_form', $ninja_forms_append_page_form_id);
}
$content .= $form;
}
return $content;
}
示例12: ninja_forms_insert_def
function ninja_forms_insert_def()
{
global $wpdb, $ninja_forms_fields;
// Bail if we aren't in the admin
if (!is_admin()) {
return false;
}
check_ajax_referer('nf_ajax', 'nf_ajax_nonce');
$def_id = absint($_REQUEST['def_id']);
$form_id = absint($_REQUEST['form_id']);
$def_row = ninja_forms_get_def_by_id($def_id);
$data = serialize($def_row['data']);
$type = $def_row['type'];
$type_name = $ninja_forms_fields[$type]['name'];
if ($form_id != 0 and $form_id != '') {
$args = array('type' => $type, 'data' => $data, 'def_id' => $def_id);
$new_id = ninja_forms_insert_field($form_id, $args);
$new_html = ninja_forms_return_echo('ninja_forms_edit_field', $new_id);
header("Content-type: application/json");
$array = array('new_id' => $new_id, 'new_type' => $type_name, 'new_html' => $new_html);
echo json_encode($array);
}
die;
}
示例13: ninja_forms_shortcode
function ninja_forms_shortcode($atts)
{
$form = ninja_forms_return_echo('ninja_forms_display_form', $atts['id']);
return $form;
}
示例14: output
function output($options)
{
global $dslc_active;
$dslc_is_admin = $dslc_active && is_user_logged_in() && current_user_can(DS_LIVE_COMPOSER_CAPABILITY) ? true : false;
$this->module_start($options);
if (!isset($options['ninjaform_title']) || $options['ninjaform_title'] == 'not_set') {
if ($dslc_is_admin) {
?>
<div class="dslc-notification dslc-red"><?php
_e('Click the cog icon on the right of this box to choose which form to show.', 'dslc_string');
?>
<span class="dslca-module-edit-hook dslc-icon dslc-icon-cog"></span></span></div><?php
}
} else {
if (function_exists('ninja_forms_display_form')) {
$form = '';
$form_id = lbmn_get_ninjaform_id_by_title($options['ninjaform_title']);
$form .= ninja_forms_return_echo('ninja_forms_display_form', $form_id);
if ($form == '' && $dslc_is_admin) {
// Form title changed or other problem
?>
<div class="dslc-notification dslc-red"><?php
echo __('There is no form with title: ', 'dslc_string') . '<strong>"' . $options['ninjaform_title'] . '"</strong>. ' . __('Select a new form title if you rename it.', 'dslc_string');
?>
<span class="dslca-module-edit-hook dslc-icon dslc-icon-cog"></span></span></div><?php
} else {
// All fine do form output
echo $form;
}
//ninja_forms_display_form( lbmn_get_ninjaform_id_by_title( $options['ninjaform_title'] ) );
}
}
$this->module_end($options);
}
示例15: ninja_forms_reset_password_form
function ninja_forms_reset_password_form()
{
if (is_user_logged_in()) {
// If our user is logged in, show a logout link.
$logout_url = '<a href="' . wp_logout_url() . '" title="' . __('Logout', 'ninja-forms-feditor') . '">' . __('Logout', 'ninja-forms-feditor') . '</a>';
$logout_url = apply_filters('ninja_forms_logout_link', $logout_url);
return $logout_url;
} else {
// Our user isn't logged in, so test to see if they've got a valid key/login pair.
// Grab out plugin settings.
$plugin_settings = get_option('ninja_forms_settings');
if (isset($plugin_settings['feditor'])) {
$feditor_settings = $plugin_settings['feditor'];
} else {
$feditor_settings = '';
}
$reset = false;
// Make sure that we have an action set and that it is 'rp'
if (isset($_REQUEST['ninja_forms_action']) and $_REQUEST['ninja_forms_action'] == 'rp') {
if (isset($_REQUEST['ninja_forms_key'])) {
$key = $_REQUEST['ninja_forms_key'];
} else {
$key = '';
}
if (isset($_REQUEST['ninja_forms_login'])) {
$login = $_REQUEST['ninja_forms_login'];
} else {
$login = '';
}
if ($key != '' and $login != '') {
$rp_keys = get_option('ninja_forms_rp_keys');
if (is_array($rp_keys) and !empty($rp_keys)) {
for ($x = 0; $x < count($rp_keys); $x++) {
if ($rp_keys[$x]['key'] == $key and $rp_keys[$x]['login'] == $login) {
$reset = true;
break;
}
}
}
}
}
if ($reset) {
// Our user has a valid key/login pair
if (isset($feditor_settings['_reset_password'])) {
$form_id = $feditor_settings['_reset_password'];
// Add reset password processing.
add_action('ninja_forms_display_after_fields', 'ninja_forms_reset_password_hidden_field');
remove_action('ninja_forms_display_before_fields', 'ninja_forms_display_req_items');
$form = ninja_forms_return_echo('ninja_forms_display_form', $form_id);
return $form;
} else {
// The plugin hasn't been properly activated. Return false.
return false;
}
} else {
if (isset($_REQUEST['resetpassword']) and $_REQUEST['resetpassword'] != '') {
// We're on the page after the user has reset their password already.
$form = ninja_forms_login_form();
return '<div class="ninja-forms-response-msg ninja-forms-success-msg">' . $_REQUEST['resetpassword'] . '</div>' . $form;
} else {
// The user doesn't have a valide key/login pair. Show the lost password form.
if (isset($_REQUEST['ninja_forms_action']) and isset($_REQUEST['ninja_forms_key']) and isset($_REQUEST['ninja_forms_login'])) {
add_action('ninja_forms_display_before_form_wrap', 'ninja_forms_reset_password_key_error');
}
$form = ninja_forms_lost_password_form();
return $form;
}
}
}
}