当前位置: 首页>>代码示例>>PHP>>正文


PHP FrmAppHelper::kses方法代码示例

本文整理汇总了PHP中FrmAppHelper::kses方法的典型用法代码示例。如果您正苦于以下问题:PHP FrmAppHelper::kses方法的具体用法?PHP FrmAppHelper::kses怎么用?PHP FrmAppHelper::kses使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FrmAppHelper的用法示例。


在下文中一共展示了FrmAppHelper::kses方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: esc_html

?>
;
    -webkit-border-radius:<?php 
echo esc_html($border_radius . $important);
?>
;
    border-radius:<?php 
echo esc_html($border_radius . $important);
?>
;
    font-size:<?php 
echo esc_html($submit_font_size . $important);
?>
;
    font-family:<?php 
echo FrmAppHelper::kses(stripslashes($font) . $important);
?>
;
    font-weight:<?php 
echo esc_html($submit_weight . $important);
?>
;
    color:#<?php 
echo esc_html($submit_text_color . $important);
?>
;
    background:#<?php 
echo esc_html($submit_bg_color . $important);
?>
;
    border-width:<?php 
开发者ID:LeanderWesterhout,项目名称:leander,代码行数:31,代码来源:_single_theme.css.php

示例2: send_email

 public static function send_email($atts)
 {
     $admin_email = get_option('admin_email');
     $defaults = array('to_email' => $admin_email, 'subject' => '', 'message' => '', 'from' => $admin_email, 'from_name' => '', 'cc' => '', 'bcc' => '', 'plain_text' => true, 'reply_to' => $admin_email, 'attachments' => array());
     $atts = wp_parse_args($atts, $defaults);
     // Put To, BCC, CC, Reply To, and From fields in the correct format
     self::format_email_fields($atts, $admin_email);
     $recipient = $atts['to_email'];
     //recipient
     $header = array();
     $header[] = 'From: ' . $atts['from'];
     //Allow for cc and bcc arrays
     $array_fields = array('CC' => $atts['cc'], 'BCC' => $atts['bcc']);
     $cc = array('CC' => array(), 'BCC' => array());
     foreach ($array_fields as $key => $a_field) {
         if (empty($a_field)) {
             continue;
         }
         foreach ((array) $a_field as $email) {
             $cc[$key][] = $email;
         }
         unset($key, $a_field);
     }
     $cc = array_filter($cc);
     // remove cc and bcc if they are empty
     foreach ($cc as $k => $v) {
         $header[] = $k . ': ' . implode(',', $v);
     }
     $content_type = $atts['plain_text'] ? 'text/plain' : 'text/html';
     $charset = get_option('blog_charset');
     $header[] = 'Reply-To: ' . $atts['reply_to'];
     $header[] = 'Content-Type: ' . $content_type . '; charset="' . esc_attr($charset) . '"';
     $atts['subject'] = wp_specialchars_decode(strip_tags(stripslashes($atts['subject'])), ENT_QUOTES);
     $message = do_shortcode($atts['message']);
     if ($atts['plain_text']) {
         //$message    = wordwrap($message, 70, "\r\n"); //in case any lines are longer than 70 chars
         $message = wp_specialchars_decode(strip_tags($message), ENT_QUOTES);
     } else {
         // remove line breaks in HTML emails to prevent conflicts with Mandrill
         add_filter('mandrill_nl2br', 'FrmNotification::remove_mandrill_br');
     }
     $header = apply_filters('frm_email_header', $header, array('to_email' => $atts['to_email'], 'subject' => $atts['subject']));
     if (apply_filters('frm_encode_subject', 1, $atts['subject'])) {
         $atts['subject'] = '=?' . $charset . '?B?' . base64_encode($atts['subject']) . '?=';
     }
     remove_filter('wp_mail_from', 'bp_core_email_from_address_filter');
     remove_filter('wp_mail_from_name', 'bp_core_email_from_name_filter');
     $sent = wp_mail($recipient, $atts['subject'], $message, $header, $atts['attachments']);
     if (!$sent) {
         $header = 'From: ' . $atts['from'] . "\r\n";
         $recipient = implode(',', (array) $recipient);
         $sent = mail($recipient, $atts['subject'], $message, $header);
     }
     // remove the filter now so other emails can still use it
     remove_filter('mandrill_nl2br', 'FrmNotification::remove_mandrill_br');
     do_action('frm_notification', $recipient, $atts['subject'], $message);
     if ($sent) {
         $sent_to = array_merge((array) $atts['to_email'], (array) $atts['cc'], (array) $atts['bcc']);
         $sent_to = array_filter($sent_to);
         if (apply_filters('frm_echo_emails', false)) {
             $temp = str_replace('<', '&lt;', $sent_to);
             echo ' ' . FrmAppHelper::kses(implode(', ', (array) $temp));
         }
         return $sent_to;
     }
 }
开发者ID:EliasGoldberg,项目名称:troop-sim,代码行数:66,代码来源:FrmNotification.php

示例3: activate

 public static function activate()
 {
     FrmAppHelper::permission_check('frm_change_settings');
     check_ajax_referer('frm_ajax', 'nonce');
     if (!isset($_POST['license']) || empty($_POST['license'])) {
         wp_die(__('Oops! You forgot to enter your license number.', 'formidable'));
     }
     $license = stripslashes(sanitize_text_field($_POST['license']));
     $plugin_slug = sanitize_text_field($_POST['plugin']);
     $this_plugin = self::get_addon($plugin_slug);
     $this_plugin->set_license($license);
     $response = array('success' => false, 'message' => '');
     try {
         $license_data = $this_plugin->send_mothership_request('activate_license', $license);
         // $license_data->license will be either "valid" or "invalid"
         $is_valid = 'invalid';
         if (is_array($license_data)) {
             if ($license_data['license'] == 'valid') {
                 $is_valid = $license_data['license'];
                 $response['message'] = __('Your license has been activated. Enjoy!', 'formidable');
                 $response['success'] = true;
             } else {
                 if ($license_data['license'] == 'invalid') {
                     $response['message'] = __('That license key is invalid', 'formidable');
                 }
             }
         } else {
             if ($license_data == 'expired') {
                 $response['message'] = __('That license is expired', 'formidable');
             } else {
                 if ($license_data == 'no_activations_left') {
                     $response['message'] = __('That license has been used on too many sites', 'formidable');
                 } else {
                     if ($license_data == 'invalid_item_id') {
                         $response['message'] = __('Oops! That is the wrong license key for this plugin.', 'formidable');
                     } else {
                         if ($license_data == 'missing') {
                             $response['message'] = __('That license key is invalid', 'formidable');
                         } else {
                             $response['message'] = FrmAppHelper::kses($license_data, array('a'));
                         }
                     }
                 }
             }
         }
         $this_plugin->set_active($is_valid);
     } catch (Exception $e) {
         $response['message'] = $e->getMessage();
     }
     echo json_encode($response);
     wp_die();
 }
开发者ID:hugocica,项目名称:locomotiva-2016,代码行数:52,代码来源:FrmAddon.php

示例4: process_bulk_form_actions

 public static function process_bulk_form_actions($errors)
 {
     if (!$_REQUEST) {
         return $errors;
     }
     $bulkaction = FrmAppHelper::get_param('action', '', 'get', 'sanitize_text_field');
     if ($bulkaction == -1) {
         $bulkaction = FrmAppHelper::get_param('action2', '', 'get', 'sanitize_title');
     }
     if (!empty($bulkaction) && strpos($bulkaction, 'bulk_') === 0) {
         FrmAppHelper::remove_get_action();
         $bulkaction = str_replace('bulk_', '', $bulkaction);
     }
     $ids = FrmAppHelper::get_param('item-action', '');
     if (empty($ids)) {
         $errors[] = __('No forms were specified', 'formidable');
         return $errors;
     }
     $permission_error = FrmAppHelper::permission_nonce_error('', '_wpnonce', 'bulk-toplevel_page_formidable');
     if ($permission_error !== false) {
         $errors[] = $permission_error;
         return $errors;
     }
     if (!is_array($ids)) {
         $ids = explode(',', $ids);
     }
     switch ($bulkaction) {
         case 'delete':
             $message = self::bulk_destroy($ids);
             break;
         case 'trash':
             $message = self::bulk_trash($ids);
             break;
         case 'untrash':
             $message = self::bulk_untrash($ids);
             break;
         case 'create_template':
             $message = self::bulk_create_template($ids);
             break;
     }
     if (isset($message) && !empty($message)) {
         echo '<div id="message" class="updated frm_msg_padding">' . FrmAppHelper::kses($message) . '</div>';
     }
     return $errors;
 }
开发者ID:swc-dng,项目名称:swcsandbox,代码行数:45,代码来源:FrmFormsController.php

示例5: get_form_name

 /**
  * @param string $edit_link
  */
 private function get_form_name($item, $actions, $edit_link, $mode = 'list')
 {
     $form_name = $item->name;
     if (trim($form_name) == '') {
         $form_name = __('(no title)');
     }
     $form_name = FrmAppHelper::kses($form_name);
     if ('excerpt' != $mode) {
         $form_name = FrmAppHelper::truncate($form_name, 50);
     }
     $val = '<strong>';
     if ('trash' == $this->status) {
         $val .= $form_name;
     } else {
         $val .= '<a href="' . esc_url(isset($actions['frm_edit']) ? $edit_link : FrmFormsHelper::get_direct_link($item->form_key, $item)) . '" class="row-title">' . FrmAppHelper::kses($form_name) . '</a> ';
     }
     $this->add_draft_label($item, $val);
     $val .= '</strong>';
     $this->add_form_description($item, $val);
     return $val;
 }
开发者ID:mazykin46,项目名称:portfolio,代码行数:24,代码来源:FrmFormsListHelper.php

示例6: test_kses

 /**
  * @covers FrmAppHelper::kses
  */
 function test_kses()
 {
     $start_value = '<script><script>Hello, <a href="/test">click here</a>';
     $stripped_value = FrmAppHelper::kses($start_value);
     $this->assertEquals($stripped_value, 'Hello, click here');
     $stripped_value = FrmAppHelper::kses($start_value, array('a'));
     $this->assertEquals($stripped_value, 'Hello, <a href="/test">click here</a>');
 }
开发者ID:rbkhrlstn,项目名称:formidable-forms,代码行数:11,代码来源:test_FrmAppHelper.php

示例7: esc_html

?>
;
    -webkit-border-radius:<?php 
echo esc_html($border_radius . $important);
?>
;
    border-radius:<?php 
echo esc_html($border_radius . $important);
?>
;
    font-size:<?php 
echo esc_html($submit_font_size . $important);
?>
;
    font-family:<?php 
echo FrmAppHelper::kses($font . $important);
?>
;
    font-weight:<?php 
echo esc_html($submit_weight . $important);
?>
;
    color:#<?php 
echo esc_html($submit_text_color . $important);
?>
;
    background:#<?php 
echo esc_html($submit_bg_color . $important);
?>
;
    border-width:<?php 
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:31,代码来源:_single_theme.css.php

示例8: activate

 private function activate()
 {
     $creds = $this->get_pro_cred_form_vals();
     $license = $creds['license'];
     $response = array('auth' => false, 'response' => '');
     if (empty($license)) {
         $response['response'] = __('Oops! You forgot to enter your license number.', 'formidable');
         return $response;
     }
     try {
         $license_data = $this->send_mothership_request('activate_license', $license);
         // $license_data->license will be either "valid" or "invalid"
         $is_valid = false;
         $response['response'] = __('That license is invalid', 'formidable');
         if (is_array($license_data)) {
             if ($license_data['license'] == 'valid') {
                 $this->manually_queue_update();
                 $is_valid = $license_data['license'];
                 $response['response'] = __('Enjoy!', 'formidable');
                 $is_valid = true;
                 $response['auth'] = true;
             }
         } else {
             if ($license_data == 'expired') {
                 $response['response'] = __('That license is expired', 'formidable');
             } else {
                 if ($license_data == 'no_activations_left') {
                     $response['response'] = __('That license has been used too many times', 'formidable');
                 } else {
                     $response['response'] = FrmAppHelper::kses($license_data, array('a'));
                 }
             }
         }
         $this->_update_auth($creds, $is_valid);
     } catch (Exception $e) {
         $response['response'] = $e->getMessage();
     }
     return $response;
 }
开发者ID:swc-dng,项目名称:swcsandbox,代码行数:39,代码来源:FrmProEddController.php

示例9: esc_attr

			<tr class="frm_comment_block" id="frmcomment<?php 
    echo esc_attr($comment->id);
    ?>
">
				<th scope="row">
					<p><strong><?php 
    echo FrmAppHelper::kses(FrmProFieldsHelper::get_display_name($meta['user_id'], 'display_name', array('link' => true)));
    ?>
</strong><br/>
					<?php 
    echo FrmAppHelper::kses(FrmAppHelper::get_formatted_time($comment->created_at, $date_format, $time_format));
    ?>
</p>
                </th>
				<td><div class="frm_comment"><?php 
    echo wpautop(FrmAppHelper::kses($meta['comment']));
    ?>
</div></td>
            </tr>
        <?php 
}
?>
        </table>
		<a href="#" class="button-secondary alignright frm_show_comment" data-frmtoggle="#frm_comment_form">+ <?php 
esc_html_e('Add Note/Comment', 'formidable');
?>
</a>
        <div class="clear"></div>

        <form action="<?php 
echo esc_url('?page=formidable-entries&frm_action=show&id=' . absint($entry->form_id) . '#frm_comment_form');
开发者ID:swc-dng,项目名称:swcsandbox,代码行数:31,代码来源:show.php

示例10: maybe_show_upgrade_bar

    private static function maybe_show_upgrade_bar()
    {
        $page = FrmAppHelper::simple_get('page', 'sanitize_title');
        if (strpos($page, 'formidable') !== 0) {
            return;
        }
        if (FrmAppHelper::pro_is_installed()) {
            return;
        }
        $affiliate = FrmAppHelper::get_affiliate();
        if (!empty($affiliate)) {
            $tip = FrmTipsHelper::get_banner_tip();
            ?>
<div class="update-nag frm-update-to-pro">
	<?php 
            echo FrmAppHelper::kses($tip['tip']);
            ?>
	<span><?php 
            echo FrmAppHelper::kses($tip['call']);
            ?>
</span>
	<a href="<?php 
            echo esc_url(FrmAppHelper::make_affiliate_url('https://formidablepro.com?banner=1&tip=' . absint($tip['num'])));
            ?>
" class="button">Upgrade to Pro</a>
</div>
<?php 
        }
    }
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:29,代码来源:FrmAppController.php

示例11: activate

 public static function activate()
 {
     FrmAppHelper::permission_check('frm_change_settings');
     check_ajax_referer('frm_ajax', 'nonce');
     if (!isset($_POST['license']) || empty($_POST['license'])) {
         wp_die(__('Oops! You forgot to enter your license number.', 'formidable'));
     }
     $license = stripslashes(sanitize_text_field($_POST['license']));
     $plugin_slug = sanitize_text_field($_POST['plugin']);
     $this_plugin = self::get_addon($plugin_slug);
     $this_plugin->set_license($license);
     $this_plugin->license = $license;
     $response = $this_plugin->get_license_status();
     $response['message'] = '';
     $response['success'] = false;
     if ($response['error']) {
         $response['message'] = $response['status'];
     } else {
         $messages = $this_plugin->get_messages();
         if (is_string($response['status']) && isset($messages[$response['status']])) {
             $response['message'] = $messages[$response['status']];
         } else {
             $response['message'] = FrmAppHelper::kses($response['status'], array('a'));
         }
         $is_valid = false;
         if ($response['status'] == 'valid') {
             $is_valid = 'valid';
             $response['success'] = true;
         }
         $this_plugin->set_active($is_valid);
     }
     echo json_encode($response);
     wp_die();
 }
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:34,代码来源:FrmAddon.php

示例12: form

    function form($instance)
    {
        $pages = get_posts(array('post_type' => 'page', 'post_status' => 'publish', 'numberposts' => 999, 'order_by' => 'post_title', 'order' => 'ASC'));
        $displays = FrmProDisplay::getAll(array('meta_key' => 'frm_show_count', 'meta_value' => 'dynamic'));
        //Defaults
        $instance = wp_parse_args((array) $instance, array('title' => false, 'display_id' => false, 'post_id' => false, 'title_id' => false, 'cat_list' => false, 'cat_name' => false, 'cat_count' => false, 'cat_id' => false, 'limit' => false));
        if ($instance['display_id']) {
            $selected_display = FrmProDisplay::getOne($instance['display_id']);
            if ($selected_display) {
                $selected_form_id = get_post_meta($selected_display->ID, 'frm_form_id', true);
                $title_opts = FrmField::getAll(array('fi.form_id' => (int) $selected_form_id, 'type not' => FrmField::no_save_fields()), 'field_order');
                $instance['display_id'] = $selected_display->ID;
            }
        }
        ?>
	<p><label for="<?php 
        echo $this->get_field_id('title');
        ?>
"><?php 
        _e('Title', 'formidable');
        ?>
:</label>
	<input type="text" class="widefat" id="<?php 
        echo $this->get_field_id('title');
        ?>
" name="<?php 
        echo $this->get_field_name('title');
        ?>
" value="<?php 
        echo esc_attr(stripslashes($instance['title']));
        ?>
" /></p>

	<p><label for="<?php 
        echo $this->get_field_id('display_id');
        ?>
"><?php 
        _e('Use Settings from View', 'formidable');
        ?>
:</label>
	    <select name="<?php 
        echo $this->get_field_name('display_id');
        ?>
" id="<?php 
        echo $this->get_field_id('display_id');
        ?>
" class="widefat frm_list_items_display_id">
	        <option value=""> </option>
            <?php 
        foreach ($displays as $display) {
            echo '<option value="' . esc_attr($display->ID) . '" ' . selected($instance['display_id'], $display->ID, false) . '>' . FrmAppHelper::kses($display->post_title) . '</option>';
        }
        ?>
        </select>
	</p>
	<p class="description"><?php 
        _e('Views with a "Both (Dynamic)" format will show here.', 'formidable');
        ?>
</p>

	<p><label for="<?php 
        echo $this->get_field_id('post_id');
        ?>
"><?php 
        _e('Page if not specified in View settings', 'formidable');
        ?>
:</label>
        <select name="<?php 
        echo $this->get_field_name('post_id');
        ?>
" id="<?php 
        echo $this->get_field_id('post_id');
        ?>
" class="widefat">
	        <option value=""> </option>
            <?php 
        foreach ($pages as $page) {
            echo '<option value="' . esc_attr($page->ID) . '" ' . selected($instance['post_id'], $page->ID, false) . '>' . $page->post_title . '</option>';
        }
        ?>
        </select>
    </p>

    <p><label for="<?php 
        echo $this->get_field_id('title_id');
        ?>
"><?php 
        _e('Title Field', 'formidable');
        ?>
:</label>
        <select name="<?php 
        echo $this->get_field_name('title_id');
        ?>
" id="<?php 
        echo $this->get_field_id('title_id');
        ?>
" class="widefat frm_list_items_title_id">
	        <option value=""> </option>
            <?php 
        if (isset($title_opts) && $title_opts) {
//.........这里部分代码省略.........
开发者ID:swc-dng,项目名称:swcsandbox,代码行数:101,代码来源:FrmListEntries.php

示例13: foreach

</h2>

	<?php 
foreach ($plugins as $slug => $plugin) {
    $license = get_option('edd_' . $slug . '_license_key');
    $status = get_option('edd_' . $slug . '_license_active');
    $activate = false !== $license && $status == 'valid' ? 'deactivate' : 'activate';
    $icon_class = empty($license) ? 'frm_hidden' : '';
    ?>

		<div class="edd_frm_license_row">
			<label class="frm_left_label" for="edd_<?php 
    echo esc_attr($slug);
    ?>
_license_key"><?php 
    echo FrmAppHelper::kses($plugin->plugin_name);
    ?>
</label>
			<div class="edd_frm_authorized alignleft <?php 
    echo esc_attr($activate == 'activate') ? 'frm_hidden' : '';
    ?>
">
				<span class="edd_frm_license"><?php 
    echo esc_html($license);
    ?>
</span>
				<span class="frm_icon_font frm_action_icon frm_error_icon edd_frm_status_icon frm_inactive_icon"></span>
				<input type="button" class="button-secondary edd_frm_save_license" data-plugin="<?php 
    echo esc_attr($slug);
    ?>
" name="edd_<?php 
开发者ID:swc-dng,项目名称:swcsandbox,代码行数:31,代码来源:settings.php


注:本文中的FrmAppHelper::kses方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。