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


PHP td_module类代码示例

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


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

示例1:

 /**
  * This method outputs the item scope for SINGLE templates. If you are looking for the modules @see td_module::get_item_scope_meta()
  * @updated 23 july 2015
  *  - if the module that uses this class is not on a single page, we use the @see td_module::get_item_scope_meta() this allows
  * us to output normal module item scope insted of no item scope like it was before this update
  * @return string
  */
 function get_item_scope_meta()
 {
     if (!is_single()) {
         return parent::get_item_scope_meta();
         // get a normal item scope if we're in a loop - like on a blog style loop
     }
     $buffy = '';
     //the vampire slayer
     $buffy .= parent::get_item_scope_meta();
     // if we have a review, we must add additional stuff
     if (td_review::has_review($this->td_review)) {
         // the item that is reviewd
         $buffy .= '<meta itemprop="itemReviewed " content = "' . $this->title_attribute . '">';
         if (!empty($this->td_review['review'])) {
             $buffy .= '<meta itemprop="about" content = "' . esc_attr($this->td_review['review']) . '">';
         } else {
             //we have no review text :| get a excerpt for the about meta thing
             if ($this->post->post_excerpt != '') {
                 $td_post_excerpt = $this->post->post_excerpt;
             } else {
                 $td_post_excerpt = td_util::excerpt($this->post->post_content, 25);
             }
             $buffy .= '<meta itemprop="about" content = "' . esc_attr($td_post_excerpt) . '">';
         }
         // review rating
         $buffy .= '<span class="td-page-meta" itemprop="reviewRating" itemscope itemtype="' . td_global::$http_or_https . '://schema.org/Rating">';
         $buffy .= '<meta itemprop="worstRating" content = "1">';
         $buffy .= '<meta itemprop="bestRating" content = "5">';
         $buffy .= '<meta itemprop="ratingValue" content = "' . td_review::calculate_total_stars($this->td_review) . '">';
         $buffy .= ' </span>';
     }
     return $buffy;
 }
开发者ID:ryandong82,项目名称:colorfulladysite,代码行数:40,代码来源:td_module_single_base.php

示例2:

 function __construct($post = '')
 {
     //run the parent constructor
     parent::__construct($post);
     //read post settings
     $this->td_post_theme_settings = get_post_meta($post->ID, 'td_post_theme_settings', true);
     $this->is_single = is_single();
 }
开发者ID:Che234,项目名称:andreatelo,代码行数:8,代码来源:td_module_single_base.php

示例3:

 function __construct($post)
 {
     //run the parrent constructor
     parent::__construct($post);
 }
开发者ID:rinodung,项目名称:newspaper-wordpress,代码行数:5,代码来源:td_module_12.php

示例4:

 function get_author($show_stars_on_review = '')
 {
     $buffy = '';
     $buffy .= '<div class="td-clear-author"></div>';
     $buffy .= parent::get_author(false);
     return $buffy;
 }
开发者ID:Vatia13,项目名称:thescroll,代码行数:7,代码来源:td_module_blog.php

示例5:

 function get_image($thumbType)
 {
     $attachment_id = get_post_thumbnail_id($this->post->ID);
     if (empty($attachment_id)) {
         //print_r($this->post);
         if (current_user_can('edit_posts')) {
             $td_edit_link = '<a class="td-admin-edit" href="' . get_edit_post_link($this->post->ID) . '">edit</a>';
         } else {
             $td_edit_link = '';
         }
         $buffy = '';
         $buffy .= '<div class="thumb-wrap">';
         $buffy .= '<a href="' . $this->href . '" rel="bookmark">';
         if ($this->post->post_type == 'page') {
             $buffy .= $td_edit_link . '<img src="' . get_template_directory_uri() . '/images/no-img-page.png" alt="" title="" />';
         } else {
             $buffy .= $td_edit_link . '<img src="' . get_template_directory_uri() . '/images/no-img-post.png" alt="" title="" />';
         }
         $buffy .= '</a>';
         $buffy .= '</div>';
         return $buffy;
     } else {
         return parent::get_image($thumbType);
     }
 }
开发者ID:Vatia13,项目名称:wordpress,代码行数:25,代码来源:td_module_search.php


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