示例#1
0
 function plugin_check_version($file, $plugin_data)
 {
     $current = get_transient('update_plugins');
     if (!isset($current->response[$file])) {
         return false;
     }
     $url = gdFunctionsGDSW::get_update_url($this->o, get_option('home'));
     $update = wp_remote_fopen($url);
     echo '<td colspan="3" class="gdr-plugin-update"><div class="gdr-plugin-update-message">';
     echo $update;
     echo '</div></td>';
 }
示例#2
0
 /**
  * Draw a pager for wordpress query loop.
  *
  * @global object $wp_query wordpress query object
  * @param string $query page element for url query
  * @param string $sign what sign to add before page part
  * @param bool $div draw div around the pager
  */
 function loop_pager($query = "pg", $sign = "?", $div = true)
 {
     global $wp_query;
     $numposts = $wp_query->found_posts;
     $max_page = $wp_query->max_num_pages;
     if ($max_page > 1) {
         $page = intval(get_query_var('paged'));
         if ($page == 0) {
             $page++;
         }
         $url = remove_query_arg($query);
         if ($div) {
             echo '<div class="gdpager">';
         }
         echo gdFunctionsGDSW::draw_pager($max_page, $page, $url, $query, $sign);
         if ($div) {
             echo '</div>';
         }
     }
 }
示例#3
0
文件: widget.php 项目: hewu/blogwp
 function get_excerpt($instance, $r)
 {
     $text = trim($r->post_excerpt);
     if ($text == "") {
         $text = strip_shortcodes($r->post_content);
         $text = str_replace(']]>', ']]&gt;', $text);
         $text = strip_tags($text);
         $text = str_replace('"', '\'', $text);
     }
     $text = gdFunctionsGDSW::trim_to_words($text, $instance["display_excerpt_length"]);
     return $text;
 }