本文整理汇总了PHP中tribe_get_cost函数的典型用法代码示例。如果您正苦于以下问题:PHP tribe_get_cost函数的具体用法?PHP tribe_get_cost怎么用?PHP tribe_get_cost使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tribe_get_cost函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render_single_event_title
public static function render_single_event_title()
{
$event_id = get_the_ID();
?>
<div class="fusion-events-single-title-content">
<?php
the_title('<h2 class="tribe-events-single-event-title summary entry-title">', '</h2>');
?>
<div class="tribe-events-schedule updated published tribe-clearfix">
<?php
echo tribe_events_event_schedule_details($event_id, '<h3>', '</h3>');
?>
<?php
if (tribe_get_cost()) {
?>
<span class="tribe-events-divider">|</span>
<span class="tribe-events-cost"><?php
echo tribe_get_cost(null, true);
?>
</span>
<?php
}
?>
</div>
</div>
<?php
}
示例2: shortcode_handler
/**
* Frontend Shortcode Handler
*
* @param array $atts array of attributes
* @param string $content text within enclosing form of shortcode element
* @param string $shortcodename the shortcode found, when == callback name
* @return string $output returns the modified html string
*/
function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
{
$atts = shortcode_atts(array('categories' => "", 'items' => "3", 'paginate' => "no"), $atts, $this->config['shortcode']);
$output = "";
$posts = $this->query_entries($atts);
$entries = $posts->posts;
if (!empty($entries)) {
$output .= "<div class='av-upcoming-events " . $meta['el_class'] . "'>";
foreach ($entries as $entry) {
$class = "av-upcoming-event-entry";
$image = get_the_post_thumbnail($entry->ID, 'square', array('class' => 'av-upcoming-event-image'));
$class .= empty($image) ? " av-upcoming-event-with-image" : " av-upcoming-event-without-image";
$title = get_the_title($entry->ID);
$link = get_permalink($entry->ID);
$price = tribe_get_cost($entry->ID, true);
$venue = tribe_get_venue($entry->ID);
$output .= "<a href='{$link}' class='{$class}'>";
if ($image) {
$output .= $image;
}
$output .= "<div class='av-upcoming-event-data'>";
$output .= "<h4 title='av-upcoming-event-title'>{$title}</h4>";
$output .= "<div class='av-upcoming-event-meta'>";
$output .= "<span class='av-upcoming-event-schedule'>" . tribe_events_event_schedule_details($entry) . "</span>";
if ($price) {
$output .= "<span class='av-upcoming-event-cost'>{$price}</span>";
}
if ($price && $venue) {
$output .= " - ";
}
if ($venue) {
$output .= "<span class='av-upcoming-event-venue'>{$venue}</span>";
}
$output .= apply_filters('avf_upcoming_event_extra_data', "", $entry);
$output .= "</div>";
$output .= "</div>";
$output .= "</a>";
}
if ($atts['paginate'] == "yes" && ($avia_pagination = avia_pagination($posts->max_num_pages, 'nav'))) {
$output .= "<div class='pagination-wrap pagination-" . TribeEvents::POSTTYPE . "'>{$avia_pagination}</div>";
}
$output .= "</div>";
}
return $output;
}
示例3: get_data
/**
* Fetches the JSON-LD data for this type of object
*
* @param int|WP_Post|null $post The post/event
* @param array $args
* @return array
*/
public function get_data($posts = null, $args = array())
{
$posts = $posts instanceof WP_Post ? array($posts) : (array) $posts;
$return = array();
foreach ($posts as $i => $post) {
$data = parent::get_data($post, $args);
// If we have an Empty data we just skip
if (empty($data)) {
continue;
}
// Fetch first key
$post_id = key($data);
// Fetch first Value
$data = reset($data);
$event_tz_string = get_post_meta($post_id, '_EventTimezone', true);
$tz_mode = tribe_get_option('tribe_events_timezone_mode', 'event');
$tz_string = $event_tz_string && $tz_mode === 'event' ? $event_tz_string : Tribe__Events__Timezones::wp_timezone_string();
$data->startDate = Tribe__Events__Timezones::to_utc(tribe_get_start_date($post_id, true, Tribe__Date_Utils::DBDATETIMEFORMAT), $tz_string, 'c');
$data->endDate = Tribe__Events__Timezones::to_utc(tribe_get_end_date($post_id, true, Tribe__Date_Utils::DBDATETIMEFORMAT), $tz_string, 'c');
if (tribe_has_venue($post_id)) {
$venue_id = tribe_get_venue_id($post_id);
$venue_data = Tribe__Events__JSON_LD__Venue::instance()->get_data($venue_id);
$data->location = reset($venue_data);
}
if (tribe_has_organizer($post_id)) {
$organizer_id = tribe_get_organizer_id($post_id);
$organizer_data = Tribe__Events__JSON_LD__Organizer::instance()->get_data($organizer_id);
$data->organizer = reset($organizer_data);
}
$price = tribe_get_cost($post_id);
$price = $this->normalize_price($price);
if ('' !== $price) {
// Manually Include the Price for non Event Tickets
$data->offers = (object) array('@type' => 'Offer', 'price' => $price, 'url' => $data->url);
}
$return[$post_id] = $data;
}
return $return;
}
示例4: sp_get_cost
/**
* @deprecated
*/
function sp_get_cost($postId = null)
{
_deprecated_function(__FUNCTION__, '2.0', 'tribe_get_cost()');
return tribe_get_cost($postId);
}
示例5: tribe_get_full_address
?>
</a>
<?php
}
?>
</td>
<td class="tribe-events-event-meta-value"><?php
echo tribe_get_full_address(get_the_ID());
?>
</td>
</tr>
<?php
}
?>
<?php
$cost = tribe_get_cost();
if (!empty($cost)) {
?>
<tr>
<td class="tribe-events-event-meta-desc"><?php
_e('Cost:', 'tribe-events-calendar');
?>
</td>
<td class="tribe-events-event-meta-value" itemprop="price"><?php
echo $cost;
?>
</td>
</tr>
<?php
}
?>
示例6: tribe_community_events_form_currency_symbol
<input type='text' id="EventCurrencySymbol" name="EventCurrencySymbol" size="2" value="<?php
tribe_community_events_form_currency_symbol();
?>
" />
</td>
</tr>
<tr>
<td>
<label for="EventCost">
<?php
_e('Cost:', 'tribe-events-calendar');
?>
</label>
</td>
<td><input type='text' id="EventCost" name="EventCost" size="6" value="<?php
echo isset($_POST['EventCost']) ? esc_attr($_POST['EventCost']) : tribe_get_cost();
?>
" /></td>
</tr>
<tr>
<td></td>
<td><small><?php
_e('Leave blank to hide the field. Enter a 0 for events that are free.', 'tribe-events-calendar');
?>
</small></td>
</tr>
</table><!-- #event_cost -->
</div><!-- .tribe-events-community-details -->
示例7: tribe_get_cost
/**
* Returns the cost with the formatting flag set to true.
*/
public function tribe_get_cost()
{
return tribe_get_cost(null, true);
}
示例8: tribe_get_event_link
echo tribe_get_event_link();
?>
"><?php
echo get_the_title(get_the_ID());
?>
</a></h4>
<?php
echo tribe_events_event_schedule_details();
?>
<?php
if (tribe_get_cost(get_the_ID()) != '') {
?>
<span class="tribe-events-divider">|</span>
<span class="tribe-events-event-cost">
<?php
echo tribe_get_cost(get_the_ID(), true);
?>
</span>
<?php
}
?>
</li>
<?php
}
?>
</ul>
<?php
do_action('tribe_events_venue_widget_after_the_list');
?>
<?php
}
示例9: esc_url
<div id="tribe-events-content" class="tribe-events-single vevent hentry">
<p class="tribe-events-back">
<a href="<?php echo esc_url( tribe_get_events_link() ); ?>"> <?php printf( __( '« All %s', 'tribe-events-calendar' ), $events_label_plural ); ?></a>
</p>
<!-- Notices -->
<?php tribe_events_the_notices() ?>
<?php the_title( '<h2 class="tribe-events-single-event-title summary entry-title">', '</h2>' ); ?>
<div class="tribe-events-schedule updated published tribe-clearfix">
<?php echo tribe_events_event_schedule_details( $event_id, '<h3>', '</h3>' ); ?>
<?php if ( tribe_get_cost() ) : ?>
<span class="tribe-events-divider">|</span>
<span class="tribe-events-cost"><?php echo tribe_get_cost( null, true ) ?></span>
<?php endif; ?>
</div>
<!-- Event header -->
<div id="tribe-events-header" <?php tribe_events_the_header_attributes() ?>>
<!-- Navigation -->
<h3 class="tribe-events-visuallyhidden"><?php printf( __( '%s Navigation', 'tribe-events-calendar' ), $events_label_singular ); ?></h3>
<ul class="tribe-events-sub-nav">
<li class="tribe-events-nav-previous"><?php tribe_the_prev_event_link( '<span>«</span> %title%' ) ?></li>
<li class="tribe-events-nav-next"><?php tribe_the_next_event_link( '%title% <span>»</span>' ) ?></li>
</ul>
<!-- .tribe-events-sub-nav -->
</div>
<!-- #tribe-events-header -->
示例10: get_permalink
<li>
<h4><a href="<?php
echo get_permalink($event);
?>
"><?php
echo get_the_title($event->ID);
?>
</a></h4>
<?php
echo tribe_events_event_schedule_details($event->ID);
?>
<?php
if (tribe_get_cost($event->ID) != '') {
?>
<span class="tribe-events-divider">|</span>
<span class="tribe-events-event-cost">
<?php
echo tribe_get_cost($event->ID, true);
?>
</span>
<?php
}
?>
</li>
<?php
}
?>
</ul>
</div>
示例11: tribe_get_region
$output .= tribe_get_region();
} else {
$output = rtrim($output, ', ');
}
if ($zip && tribe_get_zip() != '') {
$output .= $space ? '<br />' : '';
$output .= tribe_get_zip();
$space = true;
}
if ($country && tribe_get_country() != '') {
$output .= $space ? '<br />' : ' ';
$output .= tribe_get_country();
}
if ($phone && tribe_get_phone() != '') {
if ($output) {
$output .= '<br/>';
}
$output .= tribe_get_phone();
}
if ($cost && tribe_get_cost() != '') {
if ($output) {
$output .= '<br/>';
}
$output .= __('Price:', 'tribe-events-calendar-pro') . ' ' . tribe_get_cost();
}
echo $output;
?>
</div>
</li>
<?php
$alt_text = empty($alt_text) ? 'alt' : '';
示例12: the_title
<div class="container all-pad-gone">
<div class="row">
<div class="col-md-12 about">
<?php
the_title('<h1>', '</h1>');
?>
<h2><?php
echo tribe_events_event_schedule_details($event_id);
?>
</h2>
<?php
if (tribe_get_cost()) {
?>
<span class="tribe-events-divider">|</span>
<span class="tribe-events-cost"><?php
echo "<b>Cost: </b>" . tribe_get_cost(null, true);
?>
</span>
<?php
}
?>
</div>
</div>
<br>
<div class="row">
<div class="col-md-12">
<?php
echo tribe_event_featured_image($event_id, 'full', false);
?>
<?php
示例13: tribe_address_exists
<?php
echo tribe_address_exists() ? '<address class="tribe-events-address"><i class="fa fa-map-marker"></i>' . tribe_get_full_address() . '</address>' : '';
?>
<div class="updated published time-details">
<i class="fa fa-calendar"></i><?php
echo tribe_events_event_schedule_details();
?>
</div>
</div>
<div class="right">
<div class="event-cost">
<i class="fa fa-ticket"></i>
<?php
if (tribe_get_cost(get_the_ID()) > 0) {
echo tribe_get_cost(get_the_ID());
echo '$';
} else {
echo 'FREE';
}
?>
</div>
</div>
</div>
</div>
</div><!-- .tribe-events-event-meta -->
<?php
do_action('tribe_events_after_the_meta');
?>
示例14: grve_header_title
/**
* Prints correct title/subtitle for all cases
*/
function grve_header_title()
{
global $post;
$page_title = $page_description = $page_reversed = '';
//Shop
if (grve_woocommerce_enabled() && is_shop() && !is_search()) {
$post_id = wc_get_page_id('shop');
$page_title = get_the_title($post_id);
$page_description = get_post_meta($post_id, 'grve_page_description', true);
return array('title' => $page_title, 'description' => $page_description);
}
//Events Calendar Overview Pages
if (grve_events_calendar_is_overview()) {
return array('title' => tribe_get_events_title(true), 'description' => '');
}
//Main Pages
if (is_front_page() && is_home()) {
// Default homepage
$page_title = get_bloginfo('name');
$page_description = get_bloginfo('description');
} else {
if (is_front_page()) {
// static homepage
$page_title = get_bloginfo('name');
$page_description = get_bloginfo('description');
} else {
if (is_home()) {
// blog page
$page_title = get_bloginfo('name');
$page_description = get_bloginfo('description');
} else {
if (is_search()) {
$page_description = __('Search Results for :', GRVE_THEME_TRANSLATE);
$page_title = esc_attr(get_search_query());
$page_reversed = 'reversed';
} else {
if (is_singular()) {
$post_id = $post->ID;
$post_type = get_post_type($post_id);
//Single Post
if ($post_type == 'page' && is_singular('page')) {
$page_title = get_the_title();
$page_description = get_post_meta($post_id, 'grve_page_description', true);
} else {
if ($post_type == 'portfolio' && is_singular('portfolio')) {
$page_title = get_the_title();
$page_description = get_post_meta($post_id, 'grve_portfolio_description', true);
} else {
if (grve_events_calendar_enabled() && $post_type == 'tribe_events' && is_singular('tribe_events')) {
$page_title = get_the_title();
$page_description = tribe_events_event_schedule_details($post_id, '', '');
if (tribe_get_cost()) {
$page_description .= '<span class="grve-event-cost grve-bg-primary-1">' . tribe_get_cost(null, true) . '</span>';
}
} else {
if (grve_events_calendar_enabled() && $post_type == 'tribe_organizer' && is_singular('tribe_organizer')) {
$page_title = get_the_title();
$page_description = grve_event_organizer_title_meta();
} else {
$page_title = get_the_title();
}
}
}
}
} else {
if (is_archive()) {
//Post Categories
if (is_category()) {
$page_title = single_cat_title("", false);
$page_description = category_description();
} else {
if (is_tag()) {
$page_description = __("Posts Tagged :", GRVE_THEME_TRANSLATE);
$page_title = single_tag_title("", false);
$page_reversed = 'reversed';
} else {
if (is_author()) {
global $author;
$userdata = get_userdata($author);
$page_description = __("Posts By :", GRVE_THEME_TRANSLATE);
$page_title = $userdata->display_name;
$page_reversed = 'reversed';
} else {
if (is_day()) {
$page_description = __("Daily Archives :", GRVE_THEME_TRANSLATE);
$page_title = get_the_time('l, F j, Y');
$page_reversed = 'reversed';
} else {
if (is_month()) {
$page_description = __("Monthly Archives :", GRVE_THEME_TRANSLATE);
$page_title = get_the_time('F Y');
$page_reversed = 'reversed';
} else {
if (is_year()) {
$page_description = __("Yearly Archives :", GRVE_THEME_TRANSLATE);
$page_title = get_the_time('Y');
$page_reversed = 'reversed';
//.........这里部分代码省略.........
示例15: dt_sc_events
function dt_sc_events($atts, $content = null)
{
if (!function_exists('dt_events_list') && dttheme_is_plugin_active('the-events-calendar/the-events-calendar.php')) {
extract(shortcode_atts(array('limit' => '-1', 'carousel' => ''), $atts));
global $post;
$out = '';
$firstcnt = 2;
$post_thumbnail = 'blogcourse-three-column';
$tpl_default_settings = get_post_meta(get_the_ID(), '_tpl_default_settings', TRUE);
$tpl_default_settings = is_array($tpl_default_settings) ? $tpl_default_settings : array();
$page_layout = array_key_exists("layout", $tpl_default_settings) ? $tpl_default_settings['layout'] : "content-full-width";
if ($page_layout == 'with-left-sidebar' || $page_layout == 'with-right-sidebar') {
$post_thumbnail .= '-single-sidebar';
} elseif ($page_layout == 'both-sidebar') {
$post_thumbnail .= '-both-sidebar';
}
if ($carousel == 'true') {
$html_tag = 'li';
} else {
$html_tag = 'div';
}
$all_events = tribe_get_events(array('eventDisplay' => 'all', 'posts_per_page' => $limit));
$cnt = 0;
foreach ($all_events as $post) {
setup_postdata($post);
$temp_class = $firstcls = '';
if ($carousel != 'true') {
$no = $cnt + 1;
if ($no % $firstcnt == 1) {
$firstcls = ' first';
}
}
$out .= '<' . $html_tag . ' class="dt-sc-one-half column ' . $firstcls . '" id="post-' . get_the_ID() . '">';
$out .= '<div class="dt-sc-event-container">';
$out .= '<div class="dt-sc-event-thumb">';
$out .= '<a href="' . get_permalink() . '" title="' . get_the_title() . '">';
if (has_post_thumbnail()) {
$attr = array('title' => get_the_title());
$out .= get_the_post_thumbnail($post->ID, $post_thumbnail, $attr);
} else {
$out .= '<img src="http://placehold.it/1170x895&text=Image" alt="' . get_the_title() . '" />';
}
$out .= '</a>';
if (tribe_get_cost($post->ID) != '') {
$currency_symbol = tribe_get_event_meta($post->ID, '_EventCurrencySymbol', true);
if (!$currency_symbol) {
$currency_symbol = tribe_get_option('defaultCurrencySymbol', '$');
}
$currency_position = tribe_get_event_meta($post->ID, '_EventCurrencyPosition', true);
$out .= '<span class="event-price">';
if ($currency_position == 'suffix') {
$out .= tribe_get_cost($post->ID) . $currency_symbol;
} else {
$out .= $currency_symbol . tribe_get_cost($post->ID);
}
$out .= '</span>';
}
$out .= '</div>';
$out .= '<div class="dt-sc-event-content">';
$out .= '<h2><a href="' . get_permalink() . '">' . get_the_title() . '</a></h2>';
$out .= '<div class="dt-sc-event-meta">';
$out .= '<p> <i class="fa fa-calendar-o"> </i>' . tribe_get_start_date($post->ID, false, 'M Y @ h a') . ' - ' . tribe_get_end_date($post->ID, false, 'M Y @ h a') . ' </p>';
$venue_id = tribe_get_venue_id($post->ID);
if (isset($venue_id) && $venue_id > 0) {
$url = esc_url(get_permalink($venue_id));
$venue_name = tribe_get_venue($post->ID);
$out .= '<p> <i class="fa fa-map-marker"> </i>';
$out .= '<a href="' . $url . '">' . $venue_name . '</a>';
$out .= ', ' . tribe_get_country($post->ID);
if (tribe_get_map_link() != '') {
$out .= '<a href="' . tribe_get_map_link() . '" title="' . $venue_name . '" target="_blank">' . __(' + Google Map ', 'dt_themes') . '</a>';
}
$out .= '</p>';
}
$out .= '</div>';
$out .= '</div>';
$out .= '</div>';
$out .= '</' . $html_tag . '>';
$cnt++;
}
if ($carousel == 'true') {
return '<div class="dt-sc-events-carousel-wrapper"><ul class="dt-sc-events-carousel">' . $out . '</ul><div class="carousel-arrows"><a class="events-prev" href=""></a><a class="events-next" href=""></a></div></div>';
} else {
return $out;
}
} else {
return '';
}
}