本文整理汇总了PHP中Essential_Grid_Base::get_text_intro方法的典型用法代码示例。如果您正苦于以下问题:PHP Essential_Grid_Base::get_text_intro方法的具体用法?PHP Essential_Grid_Base::get_text_intro怎么用?PHP Essential_Grid_Base::get_text_intro使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Essential_Grid_Base
的用法示例。
在下文中一共展示了Essential_Grid_Base::get_text_intro方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: insert_layer
//.........这里部分代码省略.........
$demo_element_type = str_replace('%s', $layer['settings']['source-woocommerce'], $demo_element_type);
break;
case 'icon':
$text = '<i class="' . @$layer['settings']['source-icon'] . '"></i>';
$demo_element_type = '';
break;
case 'text':
$text = @$layer['settings']['source-text'];
if ($demo === false) {
//check for metas by %meta%
if ($is_post) {
$text = $m->replace_all_meta_in_text($this->post['ID'], $text);
} else {
$text = $m->replace_all_custom_element_meta_in_text($this->layer_values, $text);
}
}
if (@$layer['settings']['source-text-style-disable']) {
$do_ignore_styles = true;
}
$do_display = false;
$demo_element_type = '';
$is_html_source = true;
break;
default:
$demo_element_type = '';
}
if ($do_limit) {
$limit_by = $base->getVar($layer['settings'], 'limit-type', 'none');
if ($limit_by !== 'none') {
switch ($layer['settings']['source']) {
case 'post':
case 'event':
case 'woocommerce':
$text = $base->get_text_intro($text, $base->getVar($layer['settings'], 'limit-num', 10, 'i'), $limit_by);
break;
}
}
}
}
$link_to = $base->getVar($layer['settings'], 'link-type', 'none');
$link_target = $base->getVar($layer['settings'], 'link-target', '_self');
if ($link_target !== 'disabled') {
$link_target = ' target="' . $link_target . '"';
} else {
$link_target = '';
}
$video_play = '';
$ajax_class = '';
$ajax_attr = '';
$lb_class = '';
switch ($link_to) {
case 'post':
if ($demo === false) {
if ($is_post) {
$text = '<a href="' . get_permalink($post['ID']) . '"' . $link_target . '>' . $text . '</a>';
} else {
$get_link = $this->get_custom_element_value('post-link', $separator, '');
//get the post link
if ($get_link == '') {
$text = '<a href="javascript:void(0);"' . $link_target . '>' . $text . '</a>';
} else {
$text = '<a href="' . $get_link . '"' . $link_target . '>' . $text . '</a>';
}
}
} else {
$text = '<a href="javasccript:void(0);"' . $link_target . '>' . $text . '</a>';