本文整理汇总了PHP中wpview_media_sandbox_styles函数的典型用法代码示例。如果您正苦于以下问题:PHP wpview_media_sandbox_styles函数的具体用法?PHP wpview_media_sandbox_styles怎么用?PHP wpview_media_sandbox_styles使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wpview_media_sandbox_styles函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: 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
示例2: wp_ajax_parse_media_shortcode
/**
* @since 4.0.0
*
* @global WP_Post $post
* @global WP_Scripts $wp_scripts
*/
function wp_ajax_parse_media_shortcode()
{
global $post, $wp_scripts;
if (empty($_POST['shortcode'])) {
wp_send_json_error();
}
$shortcode = wp_unslash($_POST['shortcode']);
if (!empty($_POST['post_ID'])) {
$post = get_post((int) $_POST['post_ID']);
}
// the embed shortcode requires a post
if (!$post || !current_user_can('edit_post', $post->ID)) {
if ('embed' === $shortcode) {
wp_send_json_error();
}
} else {
setup_postdata($post);
}
$parsed = do_shortcode($shortcode);
if (empty($parsed)) {
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 . '">';
}
if (!empty($wp_scripts)) {
$wp_scripts->done = array();
}
ob_start();
echo $parsed;
if ('playlist' === $_REQUEST['type']) {
wp_underscore_playlist_templates();
wp_print_scripts('wp-playlist');
} else {
wp_print_scripts(array('froogaloop', 'wp-mediaelement'));
}
wp_send_json_success(array('head' => $head, 'body' => ob_get_clean()));
}
开发者ID:hughnet,项目名称:WordPress,代码行数:46,代码来源:ajax-actions.php
示例3: ajax_parse_shortcode
/**
* Parse shortcode for display within a TinyMCE view.
*/
public static function ajax_parse_shortcode()
{
global $wp_scripts;
static $once = false;
if ($once) {
return;
}
$once = true;
if (empty($_POST['shortcode'])) {
wp_send_json_error();
}
$slug = sanitize_text_field($_POST['type']);
$full_shortcode = wp_kses_post(wp_unslash($_POST['shortcode']));
$shortcode = do_shortcode($full_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 . '">';
}
if (!empty($wp_scripts)) {
$wp_scripts->done = array();
}
ob_start();
echo $shortcode;
$send = array('head' => $head, 'body' => ob_get_clean());
$send = apply_filters("shortcode_button_parse_mce_view_before_send", $send);
$send = apply_filters("shortcode_button_parse_mce_view_before_send_{$slug}", $send);
self::send_json_success($send);
}
开发者ID:jtsternberg,项目名称:Shortcode_Button,代码行数:35,代码来源:class-shortcode-button.php
注:本文中的wpview_media_sandbox_styles函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论