本文整理汇总了PHP中RevSliderBase::get_all_image_sizes方法的典型用法代码示例。如果您正苦于以下问题:PHP RevSliderBase::get_all_image_sizes方法的具体用法?PHP RevSliderBase::get_all_image_sizes怎么用?PHP RevSliderBase::get_all_image_sizes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RevSliderBase
的用法示例。
在下文中一共展示了RevSliderBase::get_all_image_sizes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: set_post_data
public function set_post_data($text, $attr, $post_id)
{
$img_sizes = RevSliderBase::get_all_image_sizes();
$title = isset($attr['title']) ? $attr['title'] : '';
$excerpt = isset($attr['excerpt']) ? $attr['excerpt'] : '';
$alias = isset($attr['alias']) ? $attr['alias'] : '';
$content = isset($attr['content']) ? $attr['content'] : '';
$link = isset($attr['link']) ? $attr['link'] : '';
$postDate = isset($attr['postDate']) ? $attr['postDate'] : '';
$dateModified = isset($attr['dateModified']) ? $attr['dateModified'] : '';
$authorName = isset($attr['authorName']) ? $attr['authorName'] : '';
$numComments = isset($attr['numComments']) ? $attr['numComments'] : '';
$catlist = isset($attr['catlist']) ? $attr['catlist'] : '';
$taglist = isset($attr['taglist']) ? $attr['taglist'] : '';
$text = str_replace(array('%title%', '{{title}}'), $title, $text);
$text = str_replace(array('%excerpt%', '{{excerpt}}'), $excerpt, $text);
$text = str_replace(array('%alias%', '{{alias}}'), $alias, $text);
$text = str_replace(array('%content%', '{{content}}'), $content, $text);
$text = str_replace(array('%link%', '{{link}}'), $link, $text);
$text = str_replace(array('%date%', '{{date}}'), $postDate, $text);
$text = str_replace(array('%date_modified%', '{{date_modified}}'), $dateModified, $text);
$text = str_replace(array('%author_name%', '{{author_name}}'), $authorName, $text);
$text = str_replace(array('%num_comments%', '{{num_comments}}'), $numComments, $text);
$text = str_replace(array('%catlist%', '{{catlist}}'), $catlist, $text);
$text = str_replace(array('%taglist%', '{{taglist}}'), $taglist, $text);
foreach ($img_sizes as $img_handle => $img_name) {
$url = isset($attr['img_urls']) && isset($attr['img_urls'][$img_handle]) && isset($attr['img_urls'][$img_handle]['url']) ? $attr['img_urls'][$img_handle]['url'] : '';
$tag = isset($attr['img_urls']) && isset($attr['img_urls'][$img_handle]) && isset($attr['img_urls'][$img_handle]['tag']) ? $attr['img_urls'][$img_handle]['tag'] : '';
$text = str_replace(array('%featured_image_url_' . $img_handle . '%', '{{featured_image_url_' . $img_handle . '}}'), $url, $text);
$text = str_replace(array('%featured_image_' . $img_handle . '%', '{{featured_image_' . $img_handle . '}}'), $tag, $text);
}
//process meta tags:
$text = str_replace('-', '_REVSLIDER_', $text);
$arrMatches = array();
preg_match_all('/%meta:\\w+%/', $text, $arrMatches);
foreach ($arrMatches as $matched) {
foreach ($matched as $match) {
$meta = str_replace("%meta:", "", $match);
$meta = str_replace("%", "", $meta);
$meta = str_replace('_REVSLIDER_', '-', $meta);
$metaValue = get_post_meta($post_id, $meta, true);
$text = str_replace($match, $metaValue, $text);
}
}
$arrMatches = array();
preg_match_all('/{{meta:\\w+}}/', $text, $arrMatches);
foreach ($arrMatches as $matched) {
foreach ($matched as $match) {
$meta = str_replace("{{meta:", "", $match);
$meta = str_replace("}}", "", $meta);
$meta = str_replace('_REVSLIDER_', '-', $meta);
$metaValue = get_post_meta($post_id, $meta, true);
$text = str_replace($match, $metaValue, $text);
}
}
$text = str_replace('_REVSLIDER_', '-', $text);
//replace event's template
if (RevSliderEventsManager::isEventsExists()) {
$eventData = RevSliderEventsManager::getEventPostData($post_id);
if (!empty($eventData)) {
foreach ($eventData as $eventKey => $eventValue) {
$eventPlaceholder = "%event_" . $eventKey . "%";
$eventPlaceholderNew = "{{event_" . $eventKey . "}}";
if ($eventKey == 'start_date' || $eventKey == 'end_date') {
$eventValue = RevSliderFunctionsWP::convertPostDate($eventValue);
}
$text = str_replace(array($eventPlaceholder, $eventPlaceholderNew), $eventValue, $text);
}
}
}
return $text;
}
示例2: intval
$video_volume = RevSliderFunctions::getVal($slideParams, 'video_volume', '100');
$video_start_at = RevSliderFunctions::getVal($slideParams, 'video_start_at', '');
$video_end_at = RevSliderFunctions::getVal($slideParams, 'video_end_at', '');
$video_arguments = RevSliderFunctions::getVal($slideParams, 'video_arguments', RevSliderGlobals::DEFAULT_YOUTUBE_ARGUMENTS);
$video_arguments_vim = RevSliderFunctions::getVal($slideParams, 'video_arguments_vimeo', RevSliderGlobals::DEFAULT_VIMEO_ARGUMENTS);
/* NEW KEN BURN INPUTS */
$kbStartOffsetX = intval(RevSliderFunctions::getVal($slideParams, 'kb_start_offset_x', $def_kb_start_offset_x));
$kbStartOffsetY = intval(RevSliderFunctions::getVal($slideParams, 'kb_start_offset_y', $def_kb_start_offset_y));
$kbEndOffsetX = intval(RevSliderFunctions::getVal($slideParams, 'kb_end_offset_x', $def_kb_end_offset_x));
$kbEndOffsetY = intval(RevSliderFunctions::getVal($slideParams, 'kb_end_offset_y', $def_kb_end_offset_y));
$kbStartRotate = intval(RevSliderFunctions::getVal($slideParams, 'kb_start_rotate', $def_kb_start_rotate));
$kbEndRotate = intval(RevSliderFunctions::getVal($slideParams, 'kb_end_rotate', $def_kb_start_rotate));
/* END OF NEW KEN BURN INPUTS*/
$bgRepeat = RevSliderFunctions::getVal($slideParams, 'bg_repeat', $def_bg_repeat);
$slideBGExternal = RevSliderFunctions::getVal($slideParams, "slide_bg_external", "");
$img_sizes = RevSliderBase::get_all_image_sizes($slider_type);
$bg_image_size = RevSliderFunctions::getVal($slideParams, 'image_source_type', $def_image_source_type);
$style_wrapper = '';
$class_wrapper = '';
switch ($bgType) {
case "trans":
$divLayersClass = "slide_layers";
$class_wrapper = "trans_bg";
break;
case "solid":
$style_wrapper .= "background-color:" . $slideBGColor . ";";
break;
case "image":
switch ($slider_type) {
case 'posts':
$imageUrl = RS_PLUGIN_URL . 'public/assets/assets/sources/post.png';
示例3: _e
" class="label" origtitle=""><?php
_e('Animation Duration', REVSLIDER_TEXTDOMAIN);
?>
</span>
<input type="text" class="text-sidebar withlabel" id="def-transition_duration" name="def-transition_duration" value="<?php
echo $def_trans_dur;
?>
">
<span><?php
_e('ms', REVSLIDER_TEXTDOMAIN);
?>
</span>
<div class="clear"></div>
<?php
$img_sizes = RevSliderBase::get_all_image_sizes();
$bg_image_size = RevSliderFunctions::getVal($arrFieldsParams, 'def-image_source_type', 'full');
?>
<input type="checkbox" class="rs-ingore-save rs-reset-slide-setting" name="reset-image_source_type" /> <span id="label_def-image_source_type" class="label" origtitle="<?php
_e("Default main image source size by creating a new slide.", REVSLIDER_TEXTDOMAIN);
?>
" ><?php
_e('Image Source Size', REVSLIDER_TEXTDOMAIN);
?>
</span>
<select name="def-image_source_type">
<?php
foreach ($img_sizes as $imghandle => $imgSize) {
$sel = $bg_image_size == $imghandle ? ' selected="selected"' : '';
echo '<option value="' . $imghandle . '"' . $sel . '>' . $imgSize . '</option>';
}
示例4: set_post_data
public function set_post_data($text, $attr, $post_id)
{
$img_sizes = RevSliderBase::get_all_image_sizes();
$title = isset($attr['title']) ? $attr['title'] : '';
$excerpt = isset($attr['excerpt']) ? $attr['excerpt'] : '';
$alias = isset($attr['alias']) ? $attr['alias'] : '';
$content = isset($attr['content']) ? $attr['content'] : '';
$link = isset($attr['link']) ? $attr['link'] : '';
$postDate = isset($attr['postDate']) ? $attr['postDate'] : '';
$dateModified = isset($attr['dateModified']) ? $attr['dateModified'] : '';
$authorName = isset($attr['authorName']) ? $attr['authorName'] : '';
$numComments = isset($attr['numComments']) ? $attr['numComments'] : '';
$catlist = isset($attr['catlist']) ? $attr['catlist'] : '';
$catlist_raw = isset($attr['catlist_raw']) ? $attr['catlist_raw'] : '';
$taglist = isset($attr['taglist']) ? $attr['taglist'] : '';
//add filter for addon metas
$text = apply_filters('rev_slider_insert_meta', $text, $post_id);
$text = str_replace(array('%title%', '{{title}}'), $title, $text);
$text = str_replace(array('%excerpt%', '{{excerpt}}'), $excerpt, $text);
$text = str_replace(array('%alias%', '{{alias}}'), $alias, $text);
$text = str_replace(array('%content%', '{{content}}'), $content, $text);
$text = str_replace(array('%link%', '{{link}}'), $link, $text);
$text = str_replace(array('%date%', '{{date}}'), $postDate, $text);
$text = str_replace(array('%date_modified%', '{{date_modified}}'), $dateModified, $text);
$text = str_replace(array('%author_name%', '{{author_name}}'), $authorName, $text);
$text = str_replace(array('%num_comments%', '{{num_comments}}'), $numComments, $text);
$text = str_replace(array('%catlist%', '{{catlist}}'), $catlist, $text);
$text = str_replace(array('%catlist_raw%', '{{catlist_raw}}'), $catlist_raw, $text);
$text = str_replace(array('%taglist%', '{{taglist}}'), $taglist, $text);
foreach ($img_sizes as $img_handle => $img_name) {
$url = isset($attr['img_urls']) && isset($attr['img_urls'][$img_handle]) && isset($attr['img_urls'][$img_handle]['url']) ? $attr['img_urls'][$img_handle]['url'] : '';
$tag = isset($attr['img_urls']) && isset($attr['img_urls'][$img_handle]) && isset($attr['img_urls'][$img_handle]['tag']) ? $attr['img_urls'][$img_handle]['tag'] : '';
$text = str_replace(array('%featured_image_url_' . $img_handle . '%', '{{featured_image_url_' . $img_handle . '}}'), $url, $text);
$text = str_replace(array('%featured_image_' . $img_handle . '%', '{{featured_image_' . $img_handle . '}}'), $tag, $text);
}
//process meta tags:
$text = str_replace('-', '_REVSLIDER_', $text);
$arrMatches = array();
preg_match_all('/%meta:\\w+%/', $text, $arrMatches);
foreach ($arrMatches as $matched) {
foreach ($matched as $match) {
$meta = str_replace("%meta:", "", $match);
$meta = str_replace("%", "", $meta);
$meta = str_replace('_REVSLIDER_', '-', $meta);
$metaValue = get_post_meta($post_id, $meta, true);
$text = str_replace($match, $metaValue, $text);
}
}
$arrMatches = array();
preg_match_all('/{{meta:\\w+}}/', $text, $arrMatches);
foreach ($arrMatches as $matched) {
foreach ($matched as $match) {
$meta = str_replace("{{meta:", "", $match);
$meta = str_replace("}}", "", $meta);
$meta = str_replace('_REVSLIDER_', '-', $meta);
$metaValue = get_post_meta($post_id, $meta, true);
$text = str_replace($match, $metaValue, $text);
}
}
$arrMatches = array();
preg_match_all("/{{content:\\w+[\\:]\\w+}}/", $text, $arrMatches);
foreach ($arrMatches as $matched) {
foreach ($matched as $match) {
//now check length and type
$meta = str_replace("{{content:", "", $match);
$meta = str_replace("}}", "", $meta);
$meta = str_replace('_REVSLIDER_', '-', $meta);
$vals = explode(':', $meta);
if (count($vals) !== 2) {
continue;
}
//not correct values
$vals[1] = intval($vals[1]);
//get real number
if ($vals[1] === 0 || $vals[1] < 0) {
continue;
}
//needs to be at least 1
if ($vals[0] == 'words') {
$metaValue = explode(' ', strip_tags($content), $vals[1] + 1);
if (is_array($metaValue) && count($metaValue) > $vals[1]) {
array_pop($metaValue);
}
$metaValue = implode(' ', $metaValue);
} elseif ($vals[0] == 'chars') {
$metaValue = substr(strip_tags($content), 0, $vals[1]);
} else {
continue;
}
$text = str_replace($match, $metaValue, $text);
}
}
$text = str_replace('_REVSLIDER_', '-', $text);
//replace event's template
if (RevSliderEventsManager::isEventsExists()) {
$eventData = RevSliderEventsManager::getEventPostData($post_id);
if (!empty($eventData)) {
foreach ($eventData as $eventKey => $eventValue) {
$eventPlaceholder = "%event_" . $eventKey . "%";
$eventPlaceholderNew = "{{event_" . $eventKey . "}}";
//.........这里部分代码省略.........