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


PHP wp_print_scripts函数代码示例

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


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

示例1: iva_post_fslider

function iva_post_fslider($atts, $content = null)
{
    extract(shortcode_atts(array('id' => '1', 'width' => '300', 'height' => '150', 'effect' => 'fade', 'speed' => '500', 'limits' => '', 'navigation' => 'true', 'cat' => ''), $atts));
    wp_print_scripts('jquery_flex');
    wp_enqueue_style('flexslider-style');
    $pausetime = '';
    $id = rand(20, 200);
    post_postflex_scripts($height, $speed, $width, $id, $effect, $pausetime, $navigation);
    $out = '<div class="flexslider' . $id . ' flexslider">';
    $out .= '<ul class="slides">';
    global $post;
    $pid = $post->ID;
    $attachments = get_children("post_parent={$post->ID}&post_type=attachment&post_mime_type=image&numberposts={$limits}&orderby=menu_order ASC, ID ASC");
    $img_alt_title = get_the_title();
    $width = (int) $width;
    $height = (int) $height;
    foreach ($attachments as $id => $attachment) {
        $full_attachment = wp_get_attachment_image_src($attachment->ID, 'full');
        $out .= '<li>';
        $out .= atp_resize('', $full_attachment[0], $width, $height, '', $img_alt_title);
        $out .= '</li>';
    }
    $out .= '</ul></div>';
    return $out;
    wp_reset_query();
}
开发者ID:pryspry,项目名称:MusicPlay,代码行数:26,代码来源:flexslider.php

示例2: cue_ajax_parse_shortcode

/**
 * Parse the Cue shortcode for display within a TinyMCE view.
 *
 * @since 1.3.0
 */
function cue_ajax_parse_shortcode()
{
    global $wp_scripts;
    if (empty($_POST['shortcode'])) {
        wp_send_json_error();
    }
    $shortcode = do_shortcode(wp_unslash($_POST['shortcode']));
    if (empty($shortcode)) {
        wp_send_json_error(array('type' => 'no-items', 'message' => __('No items found.')));
    }
    $head = '';
    $styles = wpview_media_sandbox_styles();
    foreach ($styles as $style) {
        $head .= '<link type="text/css" rel="stylesheet" href="' . $style . '">';
    }
    $head .= '<link rel="stylesheet" href="' . CUE_URL . 'assets/css/cue.min.css' . '">';
    $head .= '<style type="text/css">.cue-tracks { max-height: none;}</style>';
    if (!empty($wp_scripts)) {
        $wp_scripts->done = array();
    }
    ob_start();
    echo $shortcode;
    wp_print_scripts('cue');
    wp_send_json_success(array('head' => $head, 'body' => ob_get_clean()));
}
开发者ID:jondcampbell,项目名称:cue,代码行数:30,代码来源:ajax.php

示例3: getScriptsStyles

    function getScriptsStyles()
    {
        ?>
        <link rel='stylesheet' href='<?php 
        $urlblog = get_bloginfo('wpurl');
        echo $urlblog;
        ?>
/wp-admin/load-styles.php?c=1&amp;dir=ltr&amp;load=widgets,global,wp-admin' type='text/css' media='all' />
        <link rel='stylesheet' id='colors-css'  href='<?php 
        echo $urlblog;
        ?>
/wp-admin/css/colors-fresh.css' type='text/css' media='all' />
        <!--[if lte IE 7]>
        <link rel='stylesheet' id='ie-css'  href='<?php 
        echo $urlblog;
        ?>
/wp-admin/css/ie.css' type='text/css' media='all' />
        <![endif]-->
        <link rel='stylesheet'  href='<?php 
        echo $urlblog;
        ?>
/wp-content/plugins/wysija-newsletters/css/tmce/widget.css' type='text/css' media='all' />
        <?php 
        wp_print_scripts('jquery');
        ?>
        <script type="text/javascript" src="<?php 
        echo $urlblog;
        ?>
/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
        <script type='text/javascript' src='<?php 
        echo $urlblog;
        ?>
/wp-content/plugins/wysija-newsletters/js/admin-tmce.js'></script>
        <?php 
    }
开发者ID:rotoballer,项目名称:emily,代码行数:35,代码来源:tmce.php

示例4: wrap

    function wrap($content)
    {
        $html = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://gmpg.org/xfn/11">
<meta name="robots" content="NOINDEX,NOFOLLOW">
<meta charset="utf-8" />
<title>' . __('Wysija Subscription', WYSIJA) . '</title>';
        global $wp_scripts, $wp_styles;
        ob_start();
        //if(isset($_REQUEST['external_site'])) wp_head();
        wp_print_scripts('jquery');
        wp_print_styles('validate-engine-css');
        //add custom css for external site iframe
        if (isset($_REQUEST['external_site']) && file_exists(WYSIJA_UPLOADS_DIR . 'css' . DS . 'iframe.css')) {
            wp_register_style('wysija-iframe', WYSIJA_UPLOADS_URL . "css/iframe.css", array(), WYSIJA::get_version());
            wp_print_styles('wysija-iframe');
        }
        wp_print_scripts('wysija-validator-lang');
        wp_print_scripts('wysija-validator');
        wp_print_scripts('wysija-front-subscribers');
        $html .= ob_get_contents();
        ob_end_clean();
        $html .= '</head><body>';
        if (isset($_REQUEST['external_site'])) {
            $classform = '';
        } else {
            $classform = ' iframe-hidden';
        }
        $html .= '<div class="wysija-frame' . $classform . '" >' . $content . '</div>';
        $html .= '</body></html>';
        return $html;
    }
开发者ID:rotoballer,项目名称:emily,代码行数:33,代码来源:widget_nl.php

示例5: oa_social_login_add_javascripts

/**
 * Include the Social Library
 */
function oa_social_login_add_javascripts()
{
    //Read the plugin settings.
    $settings = get_option('oa_social_login_settings');
    //Without the subdomain we can't include the libary.
    if (!empty($settings['api_subdomain'])) {
        //Forge library path.
        $oneall_js_library = (oa_social_login_https_on() ? 'https' : 'http') . '://' . $settings['api_subdomain'] . '.api.oneall.com/socialize/library.js';
        // Synchronous JavaScript: This is the default to stay compatible with existing installations.
        if (empty($settings['asynchronous_javascript'])) {
            //Make sure the library has not yet been included.
            if (!wp_script_is('oa_social_library', 'registered')) {
                //Include in header, without having the version appended
                wp_register_script('oa_social_library', $oneall_js_library, array(), null, false);
            }
            wp_print_scripts('oa_social_library');
        } else {
            //JavaScript Method Reference: http://docs.oneall.com/api/javascript/library/methods/
            $output = array();
            $output[] = '';
            $output[] = " <!-- OneAll.com / Social Login for WordPress / v" . constant('OA_SOCIAL_LOGIN_VERSION') . " -->";
            $output[] = '<script type="text/javascript">';
            $output[] = " (function() {";
            $output[] = "  var oa = document.createElement('script'); oa.type = 'text/javascript';";
            $output[] = "  oa.async = true; oa.src = '" . $oneall_js_library . "';";
            $output[] = "  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(oa, s);";
            $output[] = " })();";
            $output[] = "</script>";
            $output[] = '';
            //Display
            echo implode("\n", $output);
        }
    }
}
开发者ID:frankynomad,项目名称:bux-wpcontent,代码行数:37,代码来源:user_interface.php

示例6: print_script

 static function print_script()
 {
     if (!self::$add_script) {
         return;
     }
     wp_print_scripts('my-script');
 }
开发者ID:srespane,项目名称:MvdTransparencyPlugin,代码行数:7,代码来源:transparency.php

示例7: Scripts

    function Scripts()
    {
        $id = $this->id;
        wp_print_scripts('plupload-handlers');
        ?>
		
<script type="text/javascript">
//<![CDATA[

function uploadProgress(up, file) {
	var item = jQuery('#file-upload-progress');
	jQuery('.bar', item).width( (200 * file.loaded) / file.size );
	jQuery('.percent', item).html( file.percent + '%' );

	if ( file.percent == 100 ) {
		item.html('<strong class="crunching">' + '<?php 
        _e('File %s uploaded.', WPFB);
        ?>
'.replace(/%s/g, file.name) + '</strong>');
	}
}
	
//]]>
</script>
<?php 
    }
开发者ID:Seravo,项目名称:WP-Filebase,代码行数:26,代码来源:PLUpload.php

示例8: tm_js_admin_header

function tm_js_admin_header()
{
    // use JavaScript SACK library for Ajax
    wp_print_scripts(array('sack'));
    ?>
	<script type="text/javascript">
		//<![CDATA[
		function loadAnalytics(url, row, button) {

			if (button.value == 'View Analytics') {
    			var mysack = new sack("<?php 
    bloginfo('wpurl');
    ?>
/wp-admin/admin-ajax.php");
				mysack.execute = 1;
				mysack.method = 'POST';
				mysack.setVar("action", "tm_ajax_elev_lookup");
				mysack.setVar("url", url);
				mysack.setVar("id", 't' + row);
				mysack.onError = function() {
					alert('Ajax error in looking up url');
				};
				mysack.runAJAX();
			}

  			return true;
		}
		//]]>
	</script>
<?php 
}
开发者ID:simpsonjulian,项目名称:puppet-wordpress,代码行数:31,代码来源:analytics.php

示例9: bp_core_confirmation_js

function bp_core_confirmation_js()
{
    if (is_multisite() && !bp_is_root_blog()) {
        return false;
    }
    if (!wp_script_is('jquery')) {
        wp_enqueue_script('jquery');
    }
    if (!wp_script_is('jquery', 'done')) {
        wp_print_scripts('jquery');
    }
    ?>

	<script type="text/javascript">
		jQuery( document ).ready( function() {
			jQuery( 'a.confirm').click( function() {
				if ( confirm( '<?php 
    _e('Are you sure?', 'buddypress');
    ?>
' ) )
					return true; else return false;
			});
		});
	</script>

<?php 
}
开发者ID:pyropictures,项目名称:wordpress-plugins,代码行数:27,代码来源:bp-core-cssjs.php

示例10: disable_parent_menu_link

function disable_parent_menu_link()
{
    wp_print_scripts('jquery');
    ?>
      <script type="text/javascript">
	if (jQuery("li.page_item").has("ul.children").length > 0) {
	  jQuery("li.page_item").has("ul.children").hover(function () {
            jQuery(this).children("a").removeAttr('href');
            jQuery(this).children("a").css('cursor', 'pointer');
            jQuery(this).children("a").click(function () {
              return false;
            });
          });
 	}
	else if (jQuery("li.menu-item").has("ul.sub-menu").length > 0) {
          jQuery("li.menu-item").has("ul.sub-menu").hover(function () {
            jQuery(this).children("a").removeAttr('href');
            jQuery(this).children("a").css('cursor', 'pointer');
            jQuery(this).children("a").click(function () {
              return false;
            });
          });
	}
      </script> 
<?php 
}
开发者ID:koopmant,项目名称:Mens-site,代码行数:26,代码来源:disable-parent-menu-link.php

示例11: facebookall_front_scripts

/**
 * Add js to front side.
 */
function facebookall_front_scripts()
{
    $fball_settings = get_option('fball_settings');
    if ($fball_settings['share_pin'] == '1') {
        wp_register_script('pinjs', 'http://assets.pinterest.com/js/pinit.js', false, '1.4.2');
        wp_enqueue_script('pinjs');
    }
    if ($fball_settings['share_linkedin'] == '1') {
        wp_register_script('linkedinjs', 'http://platform.linkedin.com/in.js', false, '1.4.2');
        wp_enqueue_script('linkedinjs');
    }
    if ($fball_settings['share_twitter'] == '1') {
        wp_register_script('twitterjs', 'http://platform.twitter.com/widgets.js', false, '1.4.2');
        wp_enqueue_script('twitterjs');
    }
    if ($fball_settings['share_gplus'] == '1') {
        wp_register_script('gplusjs', 'https://apis.google.com/js/plusone.js', false, '1.4.2');
        wp_enqueue_script('gplusjs');
    }
    if (!wp_script_is('connect_js', 'registered')) {
        wp_register_script('connect_js', plugins_url('assets/js/fball_connect.js', __FILE__), false, '1.0.0');
    }
    wp_print_scripts("connect_js");
    //wp_enqueue_script('connect_js');
}
开发者ID:junibrosas,项目名称:shoppingyourway,代码行数:28,代码来源:facebookall.php

示例12: print_enqueue

 /**
  * Load JS
  */
 static function print_enqueue()
 {
     if (!self::$do_enqueue) {
         return;
     }
     wp_print_scripts('responsive-video-js');
 }
开发者ID:fdelarosa191,项目名称:iftheme-docs,代码行数:10,代码来源:responsive-video-embeds.php

示例13: html_quicktags

function html_quicktags()
{
    $output = "<script type='text/javascript'>\n\n\t/* <![CDATA[ */ \n";
    wp_print_scripts('quicktags');
    $buttons = array();
    /*$buttons[] = array(
    		'name' => 'raw',
    		'options' => array(
    			'display_name' => 'raw',
    			'open_tag' => '\n[raw]',
    			'close_tag' => '[/raw]\n',
    			'key' => ''
    	));*/
    $buttons[] = array('name' => 'one_whole', 'options' => array('display_name' => 'Full width', 'open_tag' => '\\n[one_whole]', 'close_tag' => '[/one_whole]\\n', 'key' => ''));
    $buttons[] = array('name' => 'one_third', 'options' => array('display_name' => 'one third', 'open_tag' => '\\n[one_third]', 'close_tag' => '[/one_third]\\n', 'key' => ''));
    $buttons[] = array('name' => 'two_third', 'options' => array('display_name' => 'two third', 'open_tag' => '\\n[two_third]', 'close_tag' => '[/two_third]\\n', 'key' => ''));
    $buttons[] = array('name' => 'one_half', 'options' => array('display_name' => 'one half', 'open_tag' => '\\n[one_half]', 'close_tag' => '[/one_half]\\n', 'key' => ''));
    $buttons[] = array('name' => 'one_fourth', 'options' => array('display_name' => 'one fourth', 'open_tag' => '\\n[one_fourth]', 'close_tag' => '[/one_fourth]\\n', 'key' => ''));
    $buttons[] = array('name' => 'three_fourth', 'options' => array('display_name' => 'three fourth', 'open_tag' => '\\n[three_fourth]', 'close_tag' => '[/three_fourth]\\n', 'key' => ''));
    $buttons[] = array('name' => 'one_sixth', 'options' => array('display_name' => 'one sixth', 'open_tag' => '\\n[one_sixth]', 'close_tag' => '[/one_sixth]\\n', 'key' => ''));
    $buttons[] = array('name' => 'five_twelveth', 'options' => array('display_name' => 'five twelveth', 'open_tag' => '\\n[five_twelveth]', 'close_tag' => '[/five_twelveth]\\n', 'key' => ''));
    $buttons[] = array('name' => 'seven_twelveth', 'options' => array('display_name' => 'seven twelveth', 'open_tag' => '\\n[seven_twelveth]', 'close_tag' => '[/seven_twelveth]\\n', 'key' => ''));
    $buttons[] = array('name' => 'one_twelveth', 'options' => array('display_name' => 'one twelveth', 'open_tag' => '\\n[one_twelveth]', 'close_tag' => '[/one_twelveth]\\n', 'key' => ''));
    $buttons[] = array('name' => 'eleven_twelveth', 'options' => array('display_name' => 'eleven twelveth', 'open_tag' => '\\n[eleven_twelveth]', 'close_tag' => '[/eleven_twelveth]\\n', 'key' => ''));
    $buttons[] = array('name' => 'five_sixth', 'options' => array('display_name' => 'five sixth', 'open_tag' => '\\n[five_sixth]', 'close_tag' => '[/five_sixth]\\n', 'key' => ''));
    $buttons[] = array('name' => 'row', 'options' => array('display_name' => 'Insert Row', 'open_tag' => '\\n[row]', 'close_tag' => '[/row]\\n', 'key' => ''));
    $buttons[] = array('name' => 'clear', 'options' => array('display_name' => 'Clear Float', 'open_tag' => '[clear /]', 'close_tag' => '', 'key' => ''));
    for ($i = 0; $i <= count($buttons) - 1; $i++) {
        $output .= "edButtons[edButtons.length] = new edButton('ed_{$buttons[$i]['name']}'\n\t\t\t,'{$buttons[$i]['options']['display_name']}'\n\t\t\t,'{$buttons[$i]['options']['open_tag']}'\n\t\t\t,'{$buttons[$i]['options']['close_tag']}'\n\t\t\t,'{$buttons[$i]['options']['key']}'\n\t\t); \n";
    }
    $output .= "\n /* ]]> */ \n\n\t</script>";
    echo $output;
}
开发者ID:ashanrupasinghe,项目名称:govforuminstalledlocal,代码行数:33,代码来源:shortcode.php

示例14: wp_affiliate_js_admin_header

function wp_affiliate_js_admin_header()
{
    // use JavaScript SACK library for Ajax
    wp_print_scripts(array('sack'));
    // Define custom JavaScript function
    ?>
<script type="text/javascript">
//<![CDATA[
function wp_affiliate_ajax_add_link( link, text, category )
{
   var mysack = new sack( 
       "<?php 
    bloginfo('wpurl');
    ?>
/wp-admin/admin-ajax.php" );    

  mysack.execute = 1;
  mysack.method = 'POST';
  mysack.setVar( "action", "wp_affiliate_add_link" );
  mysack.setVar( "link", link.value );
  mysack.setVar( "text", text.value );
  mysack.setVar( "category", category );
  mysack.encVar( "cookie", document.cookie, false );
  mysack.onError = function() { alert('Ajax error in adding affiliate link' )};
  mysack.runAJAX();

  return true;

} // end of JavaScript function
//]]>
</script>
<?php 
}
开发者ID:macconsultinggroup,项目名称:WordPress,代码行数:33,代码来源:wp-affiliate-link-functions.php

示例15: Scripts

    function Scripts($prefix)
    {
        $id = $this->id;
        wp_print_scripts('swfupload-all');
        wp_print_scripts('swfupload-handlers');
        ?>
		
<script type="text/javascript">
//<![CDATA[

function uploadProgress(fileObj, bytesDone, bytesTotal) {
	var w = jQuery('#file-upload-progress').width() - 2, item = jQuery('#file-upload-progress');
	jQuery('.bar', item).width( w * bytesDone / bytesTotal );
	jQuery('.percent', item).html( Math.ceil(bytesDone / bytesTotal * 100) + '%' );

	if ( bytesDone == bytesTotal ) {
		jQuery('.bar', item).html('<strong class="crunching">' + '<?php 
        _e('File %s uploaded.', WPFB);
        ?>
'.replace(/%s/g, fileObj.name) + '</strong>');
		jQuery('.filename', '#file-upload-progress').hide();
	}
}
	
//]]>
</script>
<?php 
    }
开发者ID:bruno-barros,项目名称:w.eloquent.light,代码行数:28,代码来源:SWFUpload.php


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