• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP stripslashes_deep函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中stripslashes_deep函数的典型用法代码示例。如果您正苦于以下问题:PHP stripslashes_deep函数的具体用法?PHP stripslashes_deep怎么用?PHP stripslashes_deep使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: cf7bs_number_shortcode_handler

function cf7bs_number_shortcode_handler($tag)
{
    $tag = new WPCF7_Shortcode($tag);
    if (empty($tag->name)) {
        return '';
    }
    $mode = $status = 'default';
    $validation_error = wpcf7_get_validation_error($tag->name);
    $class = wpcf7_form_controls_class($tag->type);
    $class .= ' wpcf7-validates-as-number';
    if ($validation_error) {
        $class .= ' wpcf7-not-valid';
        $status = 'error';
    }
    if ($tag->is_required()) {
        $mode = 'required';
    }
    $value = (string) reset($tag->values);
    $placeholder = '';
    if ($tag->has_option('placeholder') || $tag->has_option('watermark')) {
        $placeholder = $value;
        $value = '';
    }
    if (wpcf7_is_posted() && isset($_POST[$tag->name])) {
        $value = stripslashes_deep($_POST[$tag->name]);
    } elseif (isset($_GET) && array_key_exists($tag->name, $_GET)) {
        $value = stripslashes_deep(rawurldecode($_GET[$tag->name]));
    }
    $field = new CF7BS_Form_Field(array('name' => $tag->name, 'id' => $tag->get_option('id', 'id', true), 'class' => $tag->get_class_option($class), 'type' => wpcf7_support_html5() ? $tag->basetype : 'text', 'value' => $value, 'placeholder' => $placeholder, 'label' => $tag->content, 'options' => array('min' => $tag->get_option('min', 'signed_int', true), 'max' => $tag->get_option('max', 'signed_int', true), 'step' => $tag->get_option('step', 'int', true)), 'help_text' => $validation_error, 'size' => cf7bs_get_form_property('size'), 'grid_columns' => cf7bs_get_form_property('grid_columns'), 'form_layout' => cf7bs_get_form_property('layout'), 'form_label_width' => cf7bs_get_form_property('label_width'), 'form_breakpoint' => cf7bs_get_form_property('breakpoint'), 'mode' => $mode, 'status' => $status, 'readonly' => $tag->has_option('readonly') ? true : false, 'tabindex' => $tag->get_option('tabindex', 'int', true), 'wrapper_class' => $tag->name));
    $html = $field->display(false);
    return $html;
}
开发者ID:kevinreilly,项目名称:envirotronics-wp,代码行数:32,代码来源:number.php


示例2: pop_handle_save

 function pop_handle_save()
 {
     if (!isset($_POST[$this->id . '_options'])) {
         return;
     }
     if (!current_user_can($this->capability)) {
         return;
     }
     $options = explode(',', stripslashes($_POST['page_' . $this->id]));
     if ($options) {
         $existing_options = $this->get_options();
         foreach ($options as $option) {
             $option = trim($option);
             $value = null;
             if (isset($_POST[$option])) {
                 $value = $_POST[$option];
             }
             if (!is_array($value)) {
                 $value = trim($value);
             }
             $value = stripslashes_deep($value);
             $existing_options[$option] = $value;
         }
         update_option($this->options_varname, $existing_options);
     }
     do_action('pop_handle_save', $this);
     //------------------------------
     $goback = add_query_arg('updated', 'true', wp_get_referer());
     if (isset($_REQUEST['tabs_selected_tab']) && $_REQUEST['tabs_selected_tab'] != '') {
         $goback = add_query_arg('tabs_selected_tab', $_REQUEST['tabs_selected_tab'], $goback);
     }
     wp_redirect($goback);
 }
开发者ID:ashray-velapanur,项目名称:grind-members,代码行数:33,代码来源:class.PluginOptionsPanel.php


示例3: cf7bs_file_shortcode_handler

function cf7bs_file_shortcode_handler($tag)
{
    $tag = new WPCF7_Shortcode($tag);
    if (empty($tag->name)) {
        return '';
    }
    $mode = $status = 'default';
    $validation_error = wpcf7_get_validation_error($tag->name);
    $class = wpcf7_form_controls_class($tag->type);
    if ($validation_error) {
        $class .= ' wpcf7-not-valid';
        $status = 'error';
    }
    // size is not used since Bootstrap input fields always scale 100%
    //$atts['size'] = $tag->get_size_option( '40' );
    if ($tag->is_required()) {
        $mode = 'required';
    }
    $value = (string) reset($tag->values);
    $placeholder = '';
    if ($tag->has_option('placeholder') || $tag->has_option('watermark')) {
        $placeholder = $value;
        $value = '';
    } elseif (empty($value)) {
        $value = $tag->get_default_option();
    }
    if (wpcf7_is_posted() && isset($_POST[$tag->name])) {
        $value = stripslashes_deep($_POST[$tag->name]);
    }
    $field = new CF7BS_Form_Field(cf7bs_apply_field_args_filter(array('name' => $tag->name, 'id' => $tag->get_option('id', 'id', true), 'class' => $tag->get_class_option($class), 'type' => 'file', 'value' => '1', 'label' => $tag->content, 'help_text' => $validation_error, 'size' => cf7bs_get_form_property('size'), 'grid_columns' => cf7bs_get_form_property('grid_columns'), 'form_layout' => cf7bs_get_form_property('layout'), 'form_label_width' => cf7bs_get_form_property('label_width'), 'form_breakpoint' => cf7bs_get_form_property('breakpoint'), 'mode' => $mode, 'status' => $status, 'tabindex' => $tag->get_option('tabindex', 'int', true), 'wrapper_class' => $tag->name), $tag->basetype, $tag->name));
    $html = $field->display(false);
    return $html;
}
开发者ID:joostthehost,项目名称:bootstrap-for-contact-form-7,代码行数:33,代码来源:file.php


示例4: do_

 protected function do_($action, $data, $content = '')
 {
     extract($data);
     // Get widget type and number
     $id_base = explode('-', $widget_id);
     $widget_nr = array_pop($id_base);
     $id_base = implode('-', $id_base);
     // Get widget instance
     $widget_key = 'widget_' . $id_base;
     $widgets = get_option($widget_key);
     $instance =& $widgets[$widget_nr];
     // Get widget class
     foreach ($GLOBALS['wp_widget_factory']->widgets as $widget_obj) {
         if ($widget_obj->id_base == $id_base) {
             break;
         }
     }
     // Get response
     if ('get' == $action) {
         ob_start();
         $widget_obj->form($instance);
         return ob_get_clean();
     }
     if ('save' == $action) {
         $new_instance = stripslashes_deep(reset($_POST['widget-' . $id_base]));
         $instance = $widget_obj->update($new_instance, $instance);
         update_option($widget_key, $widgets);
     }
 }
开发者ID:sweethomes,项目名称:wp-front-end-editor,代码行数:29,代码来源:widget.php


示例5: __construct

 /**
  * Constructor for the modal class.
  *
  * @param string $handle A slug-like definition of the modal.
  * @param array $fields An array containing a default set of fields that belong to the modal.
  * @param array $data An array containing the data for the fields that belong to the modal.
  * @param array $config Optional configuration array.
  * @since 0.1.0
  */
 function __construct($handle, $fields = array(), $data = array(), $config = array())
 {
     $this->_data = stripslashes_deep($data);
     $this->_config = wp_parse_args($config, array('title' => __('Edit', 'ev_framework'), 'title_controls' => '', 'button' => __('OK', 'ev_framework'), 'button_nonce' => wp_create_nonce("ev_modal_{$handle}"), 'footer_content' => ''));
     $title = isset($this->_config['title']) ? $this->_config['title'] : '';
     parent::__construct($handle, $title, $fields);
 }
开发者ID:Justevolve,项目名称:evolve-framework,代码行数:16,代码来源:ev_modal.php


示例6: parse_gateway_notification

 /**
  * parse_gateway_notification method, receives data from the payment gateway
  * @access private
  */
 function parse_gateway_notification()
 {
     /// PayPal first expects the IPN variables to be returned to it within 30 seconds, so we do this first.
     if ('sandbox' == get_option('paypal_certified_server_type')) {
         $paypal_url = "https://www.sandbox.paypal.com/webscr";
     } else {
         $API_Endpoint = "https://api-3t.paypal.com/nvp";
         $paypal_url = "https://www.paypal.com/cgi-bin/webscr";
     }
     $received_values = array();
     $received_values['cmd'] = '_notify-validate';
     $received_values += stripslashes_deep($_POST);
     $options = array('timeout' => 20, 'body' => $received_values, 'httpversion' => '1.1', 'user-agent' => 'WP e-Commerce/' . WPSC_PRESENTABLE_VERSION);
     $response = wp_remote_post($paypal_url, $options);
     do_action('wpsc_paypal_express_ipn', $received_values, $this);
     if ('VERIFIED' == $response['body']) {
         $this->paypal_ipn_values = $received_values;
         $this->session_id = $received_values['invoice'];
         if (strtolower($received_values['payment_status']) == 'completed') {
             $this->set_purchase_processed_by_sessionid(3);
             transaction_results($this->session_id, false);
         } elseif (strtolower($received_values['payment_status']) == 'denied') {
             $this->set_purchase_processed_by_sessionid(6);
         }
     } else {
         exit("IPN Request Failure");
     }
 }
开发者ID:dreamteam111,项目名称:dreamteam,代码行数:32,代码来源:paypal-express.merchant.php


示例7: _handleSubmittedData

 protected function _handleSubmittedData()
 {
     if (!$this->_verifyFormSubmit()) {
         return;
     }
     $_aDefaultOptions = $this->oProp->getDefaultOptions($this->oForm->aFields);
     $_aOptions = $this->oUtil->addAndApplyFilter($this, "validation_saved_options_{$this->oProp->sClassName}", $this->oUtil->uniteArrays($this->oProp->aOptions, $_aDefaultOptions), $this);
     $_aInput = $this->oUtil->getElementAsArray($_POST, $this->oProp->sOptionKey, array());
     $_aInput = stripslashes_deep($_aInput);
     $_aInputRaw = $_aInput;
     $_sTabSlug = $this->oUtil->getElement($_POST, 'tab_slug', '');
     $_sPageSlug = $this->oUtil->getElement($_POST, 'page_slug', '');
     $_aInput = $this->oUtil->uniteArrays($_aInput, $this->oUtil->castArrayContents($_aInput, $this->_removePageElements($_aDefaultOptions, $_sPageSlug, $_sTabSlug)));
     $_aSubmit = $this->oUtil->getElementAsArray($_POST, '__submit', array());
     $_sSubmitSectionID = $this->_getPressedSubmitButtonData($_aSubmit, 'section_id');
     $_sPressedFieldID = $this->_getPressedSubmitButtonData($_aSubmit, 'field_id');
     $_sPressedInputID = $this->_getPressedSubmitButtonData($_aSubmit, 'input_id');
     $this->_doActions_submit($_aInput, $_aOptions, $_sPageSlug, $_sTabSlug, $_sSubmitSectionID, $_sPressedFieldID, $_sPressedInputID);
     $_aStatus = array('settings-updated' => true);
     $_aInput = $this->_validateSubmittedData($_aInput, $_aInputRaw, $_aOptions, $_aStatus);
     $_bUpdated = false;
     if (!$this->oProp->_bDisableSavingOptions) {
         $_bUpdated = $this->oProp->updateOption($_aInput);
     }
     $this->_doActions_submit_after($_aInput, $_aOptions, $_sPageSlug, $_sTabSlug, $_sSubmitSectionID, $_sPressedFieldID, $_bUpdated);
     exit(wp_redirect($this->_getSettingUpdateURL($_aStatus, $_sPageSlug, $_sTabSlug)));
 }
开发者ID:benallfree,项目名称:wp-lesser,代码行数:27,代码来源:AdminPageFramework_Form_Model_Validation.php


示例8: ssbl_settings

function ssbl_settings()
{
    // check if user has the rights to manage options
    if (!current_user_can('manage_options')) {
        wp_die(__('You do not have sufficient permissions to access this page.'));
    }
    // if a post has been made
    if (isset($_POST['ssblData'])) {
        // get posted data
        $ssblPost = $_POST['ssblData'];
        parse_str($ssblPost, $ssblPost);
        // if the nonce doesn't check out...
        if (!isset($ssblPost['ssbl_save_nonce']) || !wp_verify_nonce($ssblPost['ssbl_save_nonce'], 'ssbl_save_settings')) {
            die('There was no nonce provided, or the one provided did not verify.');
        }
        // prepare array to save
        $arrOptions = array('pages' => isset($ssblPost['pages']) ? stripslashes_deep($ssblPost['pages']) : null, 'posts' => isset($ssblPost['posts']) ? stripslashes_deep($ssblPost['posts']) : null, 'share_text' => isset($ssblPost['share_text']) ? stripslashes_deep($ssblPost['share_text']) : null, 'image_set' => isset($ssblPost['image_set']) ? stripslashes_deep($ssblPost['image_set']) : null, 'selected_buttons' => isset($ssblPost['selected_buttons']) ? stripslashes_deep($ssblPost['selected_buttons']) : null);
        // save the settings
        ssbl_update_options($arrOptions);
        return true;
    }
    // include required admin view
    include_once SSBL_ROOT . '/system/views/ssbl_admin_panel.php';
    // get ssbl settings
    $ssbl_settings = get_ssbl_settings();
    // --------- ADMIN PANEL ------------ //
    ssbl_admin_panel($ssbl_settings);
}
开发者ID:rickfindlater,项目名称:svh,代码行数:28,代码来源:ssbl_admin_save.php


示例9: jiathis_options

function jiathis_options()
{
    $updated = false;
    if ($_POST['jiathis_code'] != '') {
        $jiathis_share_code = stripslashes_deep($_POST['jiathis_code']);
        update_option('jiathis_code', $jiathis_share_code);
        $share_pos = explode('|', $_POST['share_pos']);
        $inpage = empty($_POST['inpage']) ? 'no' : $_POST['inpage'];
        update_option('jiathis_pos', $share_pos[0]);
        update_option('jiathis_dir', $share_pos[1]);
        update_option('jiathis_feed', $inpage);
        $updated = true;
    }
    $jiathis_code = get_option('jiathis_code');
    echo '<div class="wrap">';
    echo '<form name="jiathis_form" method="post" action="">';
    echo '<p style="font-weight:bold;">jiaThis分享代码(请从<a href="http://www.jiathis.com/" target="_blank">JiaThis官网</a>获取):</p>';
    echo '<p style="line-height:25px;"><span style="color:#000">JiaThis分享按钮主要分为:侧栏式、按钮式、工具式和图标式。默认嵌入的是"大图标"代码,显示在文章内容页的下面。<a href="http://www.jiathis.com/getcode/" target="_blank"><u>如果您想更换按钮风格,请点击这里到JiaThis官网获取新代码</u></a>。如果您需要对网站的分享数据进行追踪与分析,只需要到JiaThis<a href="http://www.jiathis.com/register" target="_blank"><u>免费注册</u></a>并重新获取代码嵌入这里即可。</span></p>';
    if ($updated) {
        echo '<div class="updated settings-error" id="setting-error-settings_updated"><p><strong>JiaThis分享代码已经成功保存。</strong></p></div>';
    }
    echo '<p><textarea style="height:250px;width:700px" name="jiathis_code">' . $jiathis_code . '</textarea></p>';
    echo '<input type="checkbox" name="inpage" value="yes" ' . (get_option('jiathis_feed') == 'yes' ? 'checked="checked"' : '') . '/>&nbsp;&nbsp;只在文章详细页面显示<br><br>';
    echo '文章头部 :&nbsp;&nbsp;&nbsp;';
    echo '<input type="radio" name="share_pos" value="up|left" ' . (get_option('jiathis_dir') == 'left' && get_option('jiathis_pos') == 'up' ? 'checked="checked"' : '') . ' /> 居左&nbsp;&nbsp;';
    echo '<input type="radio" name="share_pos" value="up|right" ' . (get_option('jiathis_dir') == 'right' && get_option('jiathis_pos') == 'up' ? 'checked="checked"' : '') . ' /> 居右&nbsp;';
    echo '<br /><br />';
    echo '文章尾部 :&nbsp;&nbsp;&nbsp;';
    echo '<input type="radio" name="share_pos" value="down|left" ' . (get_option('jiathis_dir') == 'left' && get_option('jiathis_pos') == 'down' ? 'checked="checked"' : '') . ' /> 居左&nbsp;&nbsp;';
    echo '<input type="radio" name="share_pos" value="down|right" ' . (get_option('jiathis_dir') == 'right' && get_option('jiathis_pos') == 'down' ? 'checked="checked"' : '') . ' /> 居右&nbsp;';
    echo '<p class="submit"><input type="submit" value="确认提交"/>';
    echo '<input type="button" value="返回" onclick="window.location.href=\'plugins.php\';" /></p>';
    echo '</form>';
    echo '</div>';
}
开发者ID:songsanren,项目名称:My-blog,代码行数:35,代码来源:jiathis-share.php


示例10: do_execute

 public function do_execute()
 {
     $variables = array();
     // Handle updating of theme options.
     if (isset($_POST[Ai1ec_View_Theme_Options::SUBMIT_ID])) {
         $_POST = stripslashes_deep($_POST);
         $lessphp = $this->_registry->get('less.lessphp');
         $variables = $lessphp->get_saved_variables();
         foreach ($variables as $variable_name => $variable_params) {
             if (isset($_POST[$variable_name])) {
                 // Avoid problems for those who are foolish enough to leave php.ini
                 // settings at their defaults, which has magic quotes enabled.
                 if (get_magic_quotes_gpc()) {
                     $_POST[$variable_name] = stripslashes($_POST[$variable_name]);
                 }
                 if (Ai1ec_Less_Variable_Font::CUSTOM_FONT === $_POST[$variable_name]) {
                     $_POST[$variable_name] = $_POST[$variable_name . Ai1ec_Less_Variable_Font::CUSTOM_FONT_ID_SUFFIX];
                 }
                 // update the original array
                 $variables[$variable_name]['value'] = $_POST[$variable_name];
             }
         }
         $_POST = add_magic_quotes($_POST);
     } elseif (isset($_POST[Ai1ec_View_Theme_Options::RESET_ID])) {
         $option = $this->_registry->get('model.option');
         $option->delete('ai1ec_less_variables');
         $option->delete('ai1ec_render_css');
         do_action('ai1ec_reset_less_variables');
     }
     $css = $this->_registry->get('css.frontend');
     $css->update_variables_and_compile_css($variables, isset($_POST[Ai1ec_View_Theme_Options::RESET_ID]));
     return array('url' => ai1ec_admin_url('edit.php?post_type=ai1ec_event&page=all-in-one-event-calendar-edit-css'), 'query_args' => array());
 }
开发者ID:sedici,项目名称:wpmu-istec,代码行数:33,代码来源:save-theme-options.php


示例11: init

 function init()
 {
     if (current_user_can('administrator')) {
         $this->post = stripslashes_deep($_POST);
         $this->register_ajax('red_log_show');
         $this->register_ajax('red_log_hide');
         $this->register_ajax('red_log_delete');
         $this->register_ajax('red_module_edit');
         $this->register_ajax('red_module_load');
         $this->register_ajax('red_module_save');
         $this->register_ajax('red_module_reset');
         $this->register_ajax('red_module_delete');
         $this->register_ajax('red_group_edit');
         $this->register_ajax('red_group_load');
         $this->register_ajax('red_group_save');
         $this->register_ajax('red_group_toggle');
         $this->register_ajax('red_group_delete');
         $this->register_ajax('red_group_reset');
         $this->register_ajax('red_group_move');
         $this->register_ajax('red_group_saveorder');
         $this->register_ajax('red_redirect_edit');
         $this->register_ajax('red_redirect_load');
         $this->register_ajax('red_redirect_save');
         $this->register_ajax('red_redirect_toggle');
         $this->register_ajax('red_redirect_delete');
         $this->register_ajax('red_redirect_reset');
         $this->register_ajax('red_redirect_move');
         $this->register_ajax('red_redirect_saveorder');
         $this->register_ajax('red_redirect_add');
     }
 }
开发者ID:sashadt,项目名称:wp-deploy-test,代码行数:31,代码来源:ajax.php


示例12: renderFields

 /**
  * Build edit form fields.
  *
  * @since 4.4
  */
 public function renderFields()
 {
     if (!vc_verify_admin_nonce() || !current_user_can('edit_posts') && !current_user_can('edit_pages')) {
         wp_send_json(array('success' => false));
     }
     function array_htmlspecialchars_decode(&$input)
     {
         if (is_array($input)) {
             foreach ($input as $key => $value) {
                 if (is_array($value)) {
                     $input[$key] = array_htmlspecialchars_decode($value);
                 } else {
                     $input[$key] = htmlspecialchars_decode($value);
                 }
             }
             return $input;
         }
         return htmlspecialchars_decode($input);
     }
     $params = array_map('array_htmlspecialchars_decode', (array) stripslashes_deep(vc_post_param('params')));
     $tag = stripslashes(vc_post_param('tag'));
     require_once vc_path_dir('EDITORS_DIR', 'class-vc-edit-form-fields.php');
     $fields = new Vc_Edit_Form_Fields($tag, $params);
     $fields->render();
     die;
 }
开发者ID:tyburrowbridge,项目名称:tmb,代码行数:31,代码来源:class-vc-shortcode-edit-form.php


示例13: geodir_register_post_types

/**
 * Register the post types.
 *
 * @since 1.0.0
 *
 * @global array $wp_post_types List of post types.
 */
function geodir_register_post_types()
{
    global $wp_post_types;
    $post_types = array();
    $post_types = get_option('geodir_post_types');
    // Register each post type if array of data is returned
    if (is_array($post_types)) {
        foreach ($post_types as $post_type => $args) {
            if ($post_type == 'gd_place' && get_option('geodir_disable_place_tax')) {
                continue;
            }
            if (!empty($args['rewrite']['slug'])) {
                $args['rewrite']['slug'] = _x($args['rewrite']['slug'], 'URL slug', GEODIRECTORY_TEXTDOMAIN);
            }
            $args = stripslashes_deep($args);
            if (!empty($args['labels'])) {
                foreach ($args['labels'] as $key => $val) {
                    $args['labels'][$key] = __($val, GEODIRECTORY_TEXTDOMAIN);
                    // allow translation
                }
            }
            /**
             * Filter post type args.
             *
             * @since 1.0.0
             * @param string $args Post type args.
             * @param string $post_type The post type.
             */
            $args = apply_filters('geodir_post_type_args', $args, $post_type);
            $post_type = register_post_type($post_type, $args);
        }
    }
}
开发者ID:jefferose,项目名称:geodirectory,代码行数:40,代码来源:custom_taxonomy_hooks_actions.php


示例14: options

 /**
  * Show opt out options page
  * 
  */
 public function options()
 {
     global $wpdb;
     $errors = array();
     $success = false;
     $opt_out_level = get_option("bbpp_thankmelater_opt_out_level", "disabled");
     $opt_out_form_type = get_option("bbpp_thankmelater_opt_out_form_type", "out");
     $opt_out_form_out_text = get_option("bbpp_thankmelater_opt_out_form_out_text", "1");
     $opt_out_form_out_text_custom = get_option("bbpp_thankmelater_opt_out_form_out_text_custom", "");
     $opt_out_form_in_text = get_option("bbpp_thankmelater_opt_out_form_in_text", "1");
     $opt_out_form_in_text_custom = get_option("bbpp_thankmelater_opt_out_form_in_text_custom", "");
     if ($_POST) {
         check_admin_referer("bbpp_thankmelater_opt_out_options");
         $data = stripslashes_deep($_POST);
         $opt_out_level = isset($data["bbpp_thankmelater_opt_out_level"]) ? $data["bbpp_thankmelater_opt_out_level"] : NULL;
         $opt_out_form_type = isset($data["bbpp_thankmelater_opt_out_form_type"]) ? $data["bbpp_thankmelater_opt_out_form_type"] : NULL;
         $opt_out_form_out_text = isset($data["bbpp_thankmelater_opt_out_form_out_text"]) ? $data["bbpp_thankmelater_opt_out_form_out_text"] : NULL;
         $opt_out_form_out_text_custom = isset($data["bbpp_thankmelater_opt_out_form_out_text_custom"]) ? $data["bbpp_thankmelater_opt_out_form_out_text_custom"] : NULL;
         $opt_out_form_in_text = isset($data["bbpp_thankmelater_opt_out_form_in_text"]) ? $data["bbpp_thankmelater_opt_out_form_in_text"] : NULL;
         $opt_out_form_in_text_custom = isset($data["bbpp_thankmelater_opt_out_form_in_text_custom"]) ? $data["bbpp_thankmelater_opt_out_form_in_text_custom"] : NULL;
         $error = new WP_Error();
         if (!in_array($opt_out_level, array("disabled", "email", "form"))) {
             $error->add("opt_out_level", __("You must select an option.", "bbpp-thankmelater"));
         }
         if ($opt_out_level == "form") {
             if (!in_array($opt_out_form_type, array("out", "in"))) {
                 $error->add("opt_out_form_type", __("You must select an option.", "bbpp-thankmelater"));
             }
             if ($opt_out_form_type == "out") {
                 if (!in_array($opt_out_form_out_text, array("1", "custom"))) {
                     $error->add("opt_out_form_out_text", __("You must select an option.", "bbpp-thankmelater"));
                 }
                 if ($opt_out_form_out_text == "custom" && empty($opt_out_form_out_text_custom)) {
                     $error->add("opt_out_form_out_text", __("This must not be blank.", "bbpp-thankmelater"));
                 }
             } elseif ($opt_out_form_type == "in") {
                 if (!in_array($opt_out_form_in_text, array("1", "custom"))) {
                     $error->add("opt_out_form_in_text", __("You must select an option.", "bbpp-thankmelater"));
                 }
                 if ($opt_out_form_in_text == "custom" && empty($opt_out_form_in_text_custom)) {
                     $error->add("opt_out_form_in_text", __("This must not be blank.", "bbpp-thankmelater"));
                 }
             }
         }
         if ($error->get_error_codes()) {
             $errors[] = $error;
         } else {
             update_option("bbpp_thankmelater_opt_out_level", $opt_out_level);
             update_option("bbpp_thankmelater_opt_out_form_type", $opt_out_form_type);
             update_option("bbpp_thankmelater_opt_out_form_out_text", $opt_out_form_out_text);
             update_option("bbpp_thankmelater_opt_out_form_out_text_custom", $opt_out_form_out_text_custom);
             update_option("bbpp_thankmelater_opt_out_form_in_text", $opt_out_form_in_text);
             update_option("bbpp_thankmelater_opt_out_form_in_text_custom", $opt_out_form_in_text_custom);
             $success = true;
         }
     }
     // get a list of the most recent opt outs
     $opt_out_results = $wpdb->get_results("\r\n\t\t\tSELECT `email`, `date_gmt`\r\n\t\t\tFROM `{$wpdb->prefix}bbpp_thankmelater_opt_outs`\r\n\t\t\tORDER BY `date_gmt` DESC\r\n\t\t\tLIMIT 100\r\n\t\t");
     require_once BBPP_THANKMELATER_PLUGIN_PATH . "admin/opt-out/options.php";
 }
开发者ID:NYC2015,项目名称:team-12,代码行数:64,代码来源:AdminScreenOptOut.php


示例15: _init

 /**
  * 启动
  *
  * @author         mrmsl <[email protected]>
  * @date           2012-12-25 10:05:23
  * @lastmodify     2013-01-21 15:25:25 by mrmsl
  *
  * @return void 无返回值
  */
 private function _init()
 {
     set_error_handler('error_handler');
     set_exception_handler('exception_handler');
     register_shutdown_function('fatal_error');
     //spl_autoload_register('autoload');
     ob_get_level() != 0 && ob_end_clean();
     if (IS_LOCAL && APP_DEBUG) {
         //本地开发环境
         error_reporting(E_ALL | E_STRICT);
         //错误报告
         ini_set('display_errors', 1);
         //显示错误
     } else {
         ini_set('display_errors', 0);
     }
     if (get_magic_quotes_gpc()) {
         !empty($_GET) && ($_GET = stripslashes_deep($_GET));
         !empty($_POST) && ($_POST = stripslashes_deep($_POST));
         !empty($_COOKIE) && ($_COOKIE = stripslashes_deep($_COOKIE));
     }
     date_default_timezone_set(sys_config('sys_timezone_default_timezone', '', DEFAULT_TIMEZONE));
     //设置系统时区
     define('APP_NOW_TIME', time());
     //当前时间戳
     $this->_initLangTheme();
     //语言包及皮肤
     $this->_initSession();
     //session
     C(include INCLUDE_PATH . 'config.inc.php');
     //配置
 }
开发者ID:yunsite,项目名称:yablog,代码行数:41,代码来源:Bootstrap.class.php


示例16: ___wp_sharks_core_rv_filter_transient_update_plugins

/**
 * Filter `update_plugins` transient data.
 *
 * @note This is what makes updates of the framework possible.
 *
 * @since 160501 Rewrite before launch.
 *
 * @param \StdClass|mixed $report Report details.
 *
 * @return \StdClass|mixed Report details.
 */
function ___wp_sharks_core_rv_filter_transient_update_plugins($report)
{
    $_r = stripslashes_deep($_REQUEST);
    if (empty($_r['action']) || $_r['action'] !== 'upgrade-plugin') {
        return $report;
        // Nothing to do here.
    } elseif (empty($_r['___action_via']) || $_r['___action_via'] !== 'wp-sharks-core-rv') {
        return $report;
        // Not applicable.
    } elseif (empty($_r['plugin']) || $_r['plugin'] !== 'wp-sharks-core/plugin.php') {
        return $report;
        // Not applicable.
    }
    if (!is_object($report)) {
        $report = (object) [];
        // New object class.
    }
    if (!isset($report->response) || !is_array($report->response)) {
        $report->response = [];
        // Force an array value.
    }
    $report->response['wp-sharks-core/plugin.php'] = (object) ['id' => -1, 'new_version' => 'latest', 'slug' => 'wp-sharks-core', 'plugin' => 'wp-sharks-core/plugin.php', 'url' => ___wp_sharks_core_rv_product_url(), 'package' => ___wp_sharks_core_rv_latest_zip_url(), 'tested' => ___wp_sharks_core_rv_get_wp_version()];
    return $report;
    // With update properties.
}
开发者ID:websharks,项目名称:wp-sharks-core-rv,代码行数:36,代码来源:filters.php


示例17: layotter_make_search_dump

function layotter_make_search_dump($data, $raw_post)
{
    $post_id = $raw_post['ID'];
    // don't change anything if not editing a Layotter-enabled post
    if (!Layotter::is_enabled_for_post($post_id) or !isset($raw_post['layotter_json'])) {
        return $data;
    }
    // copy JSON from POST and strip slashes that were added by Wordpress
    $json = $raw_post['layotter_json'];
    $unslashed_json = stripslashes_deep($json);
    // turn JSON into post content HTML
    $layotter_post = new Layotter_Post($unslashed_json);
    $content = $layotter_post->get_frontend_view();
    // save JSON to a custom field (oddly enough, Wordpress breaks JSON if it's stripslashed)
    update_post_meta($post_id, 'layotter_json', $json);
    // insert spaces to prevent <p>foo</p><p>bar</p> becoming "foobar" instead of "foo bar"
    // then strip all tags except <img>
    // then remove excess whitespace
    $spaced_content = str_replace('<', ' <', $content);
    $clean_content = strip_tags($spaced_content, '<img>');
    $normalized_content = trim($clean_content);
    if (function_exists('mb_ereg_replace')) {
        $normalized_content = mb_ereg_replace('/\\s+/', ' ', $normalized_content);
    }
    // wrap search dump with a [layotter] shortcode and return modified post data to be saved to the database
    // add the post ID because otherwise the shortcode handler would have no reliable way to get the post ID through
    // which the JSON data will be fetched
    $shortcoded_content = '[layotter post="' . $post_id . '"]' . $normalized_content . '[/layotter]';
    $data['post_content'] = $shortcoded_content;
    return $data;
}
开发者ID:hingst,项目名称:layotter,代码行数:31,代码来源:revisions.php


示例18: edit

 public function edit()
 {
     /* 语言项的路径 */
     $lang_file = isset($_POST['file_path']) ? trim($_POST['file_path']) : '';
     /* 替换前的语言项 */
     $src_items = !empty($_POST['item']) ? stripslashes_deep($_POST['item']) : '';
     /* 修改过后的语言项 */
     $dst_items = array();
     $_POST['item_id'] = stripslashes_deep($_POST['item_id']);
     for ($i = 0; $i < count($_POST['item_id']); $i++) {
         /* 语言项内容如果为空,不修改 */
         if (trim($_POST['item_content'][$i]) == '') {
             unset($src_items[$i]);
         } else {
             $_POST['item_content'][$i] = str_replace('\\\\n', '\\n', $_POST['item_content'][$i]);
             $dst_items[$i] = $_POST['item_id'][$i] . ' = ' . '"' . $_POST['item_content'][$i] . '";';
         }
     }
     /* 调用函数编辑语言项 */
     $result = $this->set_language_items($lang_file, $src_items, $dst_items);
     if ($result === false) {
         /* 修改失败提示信息 */
         $link[] = array('text' => L('back_list'), 'href' => 'javascript:history.back(-1)');
         $this->message(L('edit_languages_false'), NULL, $link);
     } else {
         /* 记录管理员操作 */
         // admin_log('', 'edit', 'languages');
         /* 清除缓存 */
         clear_cache_files();
         /* 成功提示信息 */
         $this->message(L('edit_languages_success'), url('editlanguages/index'));
     }
 }
开发者ID:noikiy,项目名称:shop-3,代码行数:33,代码来源:LanguagesController.class.php


示例19: __construct

 function __construct($options = null)
 {
     if ($options == null) {
         if (isset($_POST['options'])) {
             $this->data = stripslashes_deep($_POST['options']);
         }
     } else {
         $this->data = $options;
     }
     if (isset($_REQUEST['act'])) {
         $this->action = $_REQUEST['act'];
     }
     if (isset($_REQUEST['btn'])) {
         $this->button_data = $_REQUEST['btn'];
     }
     // Fields analysis
     if (isset($_REQUEST['fields'])) {
         $fields = $_REQUEST['fields'];
         if (is_array($fields)) {
             foreach ($fields as $name => $type) {
                 if ($type == 'datetime') {
                     // Ex. The user insert 01/07/2012 14:30 and it set the time zone to +2. We cannot use the
                     // mktime, since it uses the time zone of the machine. We create the time as if we are on
                     // GMT 0 and then we subtract the GMT offset (the example date and time on GMT+2 happens
                     // "before").
                     $time = gmmktime($_REQUEST[$name . '_hour'], 0, 0, $_REQUEST[$name . '_month'], $_REQUEST[$name . '_day'], $_REQUEST[$name . '_year']);
                     $time -= get_option('gmt_offset') * 3600;
                     $this->data[$name] = $time;
                 }
             }
         }
     }
 }
开发者ID:lenguyenitc,项目名称:donations,代码行数:33,代码来源:controls.php


示例20: get_data_by

 static function get_data_by($field, $value)
 {
     if ('id' == $field) {
         if (!is_numeric($value)) {
             return false;
         }
         $value = intval($value);
         if ($value < 1) {
             return false;
         }
     } else {
         $value = trim($value);
     }
     if (!$value) {
         return false;
     }
     switch ($field) {
         case 'id':
             $custom_field_id = $value;
             $db_field = 'id';
             break;
         default:
             return false;
     }
     if (false !== $custom_field_id) {
         if ($custom_field = wp_cache_get($custom_field_id, 'yop_poll_custom_field')) {
             return $custom_field;
         }
     }
     if (!($custom_field = $GLOBALS['wpdb']->get_row($GLOBALS['wpdb']->prepare("SELECT\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t*\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t FROM\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{$GLOBALS['wpdb']->yop_poll_custom_fields}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t WHERE\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{$db_field} = %s", $value)))) {
         return false;
     }
     wp_cache_add($custom_field->ID, $custom_field, 'yop_poll_custom_field');
     return stripslashes_deep($custom_field);
 }
开发者ID:jesusmarket,项目名称:jesusmarket,代码行数:35,代码来源:custom_field_model.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP stripslashes_r函数代码示例发布时间:2022-05-23
下一篇:
PHP stripslashes_array函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap