• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP make_clickable函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: huddle_bp_get_the_profile_field_value

function huddle_bp_get_the_profile_field_value($value, $type = '', $id = '')
{
    global $field;
    if (substr_count(strtolower($field->name), 'twitter')) {
        if (!substr_count($field->data->value, 'twitter.com')) {
            $value = 'http://twitter.com/' . $value;
        }
    } elseif (substr_count(strtolower($field->name), 'about')) {
    } else {
        $values = explode(',', $value);
        if ($values) {
            foreach ((array) $values as $value) {
                $value = trim($value);
                // If the value is a URL, skip it and just make it clickable.
                if (preg_match('@(https?://([-\\w\\.]+)+(:\\d+)?(/([\\w/_\\.]*(\\?\\S+)?)?)?)@', $value)) {
                    $new_values[] = make_clickable($value);
                } else {
                    if (count(explode(' ', $value)) > 5) {
                        $new_values[] = $value;
                    } else {
                        $new_values[] = '<a href="' . site_url(bp_get_members_root_slug()) . '/?s=' . strip_tags($value) . '" rel="nofollow">' . $value . '</a>';
                    }
                }
            }
            $value = implode(', ', $new_values);
        }
    }
    return $value;
}
开发者ID:nxtclass,项目名称:NXTClass-themes,代码行数:29,代码来源:functions.php


示例2: xprofile_filter_link_profile_data

function xprofile_filter_link_profile_data($field_value, $field_type = 'textbox')
{
    if ('datebox' == $field_type) {
        return $field_value;
    }
    if (!strpos($field_value, ',') && count(explode(' ', $field_value)) > 5) {
        return $field_value;
    }
    $values = explode(',', $field_value);
    if ($values) {
        foreach ($values as $value) {
            $value = trim($value);
            /* If the value is a URL, skip it and just make it clickable. */
            if (preg_match('@(https?://([-\\w\\.]+)+(:\\d+)?(/([\\w/_\\.]*(\\?\\S+)?)?)?)@', $value)) {
                $new_values[] = make_clickable($value);
            } else {
                if (count(explode(' ', $value)) > 5) {
                    $new_values[] = $value;
                } else {
                    $new_values[] = '<a href="' . site_url(BP_MEMBERS_SLUG) . '/?s=' . $value . '">' . $value . '</a>';
                }
            }
        }
        $values = implode(', ', $new_values);
    }
    return $values;
}
开发者ID:alvaropereyra,项目名称:shrekcms,代码行数:27,代码来源:bp-xprofile-filters.php


示例3: format_message

 function format_message($message)
 {
     if (!function_exists('process_smilies')) {
         include BASE_DIR . 'include' . DS . 'smilies.inc.php';
     }
     return make_clickable(process_smilies(bb_decode($message)));
 }
开发者ID:phill104,项目名称:branches,代码行数:7,代码来源:forum_helper.php


示例4: widget

 function widget($args, $instance)
 {
     extract($args);
     $title = apply_filters('PhoenixTeam_Widget_Twitter', $instance['title']);
     $username = $instance['username'] ? $instance['username'] : null;
     $number = isset($instance['qty']) ? $instance['qty'] : null;
     static $counter = 1;
     // IDs for Widget;
     // echo $args['before_widget']; // It's the right way, but doesn't work with VC :(
     echo '<div id="' . THEME_SLUG . '-twitter-' . esc_attr($counter) . '" class="footer-twitter widget_' . THEME_SLUG . '-twitter">';
     if ($title) {
         echo '<h4 class="widget-title">' . esc_html($title) . '</h4>';
     }
     // $tweets = $this->get_tweets($args['widget_id'], $instance); // Good old, but doesn't work with VC
     $tweets = $this->get_tweets(THEME_SLUG . '-twitter-' . $counter, $instance);
     if (!empty($tweets['tweets']) && empty($tweets['tweets']->errors)) {
         $user = current($tweets['tweets']);
         if (is_object($user)) {
             $user = $user->user;
         }
         echo '<ul class="tweet_list">';
         $checker = 0;
         foreach ($tweets['tweets'] as $tweet) {
             if ($checker <= $number) {
                 if (isset($tweet->text)) {
                     if (is_object($tweet)) {
                         $avatar = $user->profile_image_url;
                         $username = $user->screen_name;
                         $user_url = 'https://twitter.com/' . $username;
                         $tweet_text = htmlentities($tweet->text, ENT_QUOTES, 'UTF-8');
                         $tweet_text = make_clickable($tweet_text);
                         $tweet_text = popuplinks($tweet_text);
                         if ($tweet_text) {
                             echo '<li>
                           <a class="tweet_avatar" href="' . esc_url($user_url) . '">
                             <img src="' . esc_url($avatar) . '" alt="' . esc_attr($username) . '" title="' . esc_attr($username) . '">
                           </a>
                           <span class="tweet_text">' . wp_kses_post($tweet_text) . '</span>
                         </li>';
                             $checker++;
                         }
                     }
                 } else {
                     if ($checker == 0) {
                         echo '<li><span class="content">' . __("There's no tweets in your feed...", 'grandway') . '</span></li>';
                         break;
                     }
                     break;
                 }
             }
         }
         echo '</ul>';
     } elseif ($tweets['tweets']->errors) {
         _e('Authentication failed! Please check your Twitter app data.', 'grandway');
     } elseif (!$tweets['tweets']) {
         _e("There's no tweets there", 'grandway');
     }
     echo $args['after_widget'];
     $counter++;
 }
开发者ID:WillLin,项目名称:CS-SC-Front-End,代码行数:60,代码来源:widget-twitter.php


示例5: sanitizeString

 /**
  * Sanitize the input string. HTML tags can be permitted.
  * The permitted tags can be supplied in an array.
  *
  * @TODO: Finish the code needed to support the $permittedTags array.
  *
  * @param string $string
  * @param bool $allowHTML [optional]
  * @param array $permittedTags [optional]
  * @return string
  */
 public function sanitizeString($string, $allowHTML = FALSE, $permittedTags = array())
 {
     // Strip all tags except the permitted.
     if (!$allowHTML) {
         // Ensure all tags are closed. Uses WordPress method balanceTags().
         $balancedText = balanceTags($string, TRUE);
         $strippedText = strip_tags($balancedText);
         // Strip all script and style tags.
         $strippedText = preg_replace('@<(script|style)[^>]*?>.*?</\\1>@si', '', $strippedText);
         // Escape text using the WordPress method and then strip slashes.
         $escapedText = stripslashes(esc_attr($strippedText));
         // Remove line breaks and trim white space.
         $escapedText = preg_replace('/[\\r\\n\\t ]+/', ' ', $escapedText);
         return trim($escapedText);
     } else {
         // Strip all script and style tags.
         $strippedText = preg_replace('@<(script|style)[^>]*?>.*?</\\1>@si', '', $string);
         $strippedText = preg_replace('/&lt;(script|style).*?&gt;.*?&lt;\\/\\1&gt;/si', '', stripslashes($strippedText));
         /*
          * Use WordPress method make_clickable() to make links clickable and
          * use kses for filtering.
          *
          * http://ottopress.com/2010/wp-quickie-kses/
          */
         return wptexturize(wpautop(make_clickable(wp_kses_post($strippedText))));
     }
 }
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:38,代码来源:class.utility.php


示例6: pmpro_send_html

function pmpro_send_html($phpmailer)
{
    // Set the original plain text message
    $phpmailer->AltBody = wp_specialchars_decode($phpmailer->Body, ENT_QUOTES);
    // Clean < and > around text links in WP 3.1
    $phpmailer->Body = preg_replace('#<(http://[^*]+)>#', '$1', $phpmailer->Body);
    // Convert line breaks & make links clickable
    $phpmailer->Body = make_clickable($phpmailer->Body);
    // Add header to message if found
    if (file_exists(get_stylesheet_directory() . "/email_header.html")) {
        $phpmailer->Body = file_get_contents(get_stylesheet_directory() . "/email_header.html") . "\n" . $phpmailer->Body;
    } elseif (file_exists(get_template_directory() . "/email_header.html")) {
        $phpmailer->Body = file_get_contents(get_template_directory() . "/email_header.html") . "\n" . $phpmailer->Body;
    }
    // Add footer to message if found
    if (file_exists(get_stylesheet_directory() . "/email_footer.html")) {
        $phpmailer->Body = $phpmailer->Body . "\n" . file_get_contents(get_stylesheet_directory() . "/email_footer.html");
    } elseif (file_exists(get_template_directory() . "/email_footer.html")) {
        $phpmailer->Body = $phpmailer->Body . "\n" . file_get_contents(get_template_directory() . "/email_footer.html");
    }
    // Replace variables in email
    global $current_user;
    $data = array("name" => $current_user->display_name, "sitename" => get_option("blogname"), "login_link" => pmpro_url("account"), "display_name" => $current_user->display_name, "user_email" => $current_user->user_email, "subject" => $phpmailer->Subject);
    foreach ($data as $key => $value) {
        $phpmailer->Body = str_replace("!!" . $key . "!!", $value, $phpmailer->Body);
    }
    do_action("pmpro_after_phpmailer_init", $phpmailer);
    do_action("pmpro_after_pmpmailer_init", $phpmailer);
    //typo left in for backwards compatibility
}
开发者ID:Tanya-atsocial,项目名称:paid-memberships-pro,代码行数:30,代码来源:email.php


示例7: display

    /**
     * Display meta in a formatted list.
     *
     * @param bool $flat (default: false)
     * @param bool $return (default: false)
     * @param string $hideprefix (default: _)
     * @param  string $delimiter Delimiter used to separate items when $flat is true
     * @return string|void
     */
    public function display($flat = false, $return = false, $hideprefix = '_', $delimiter = ", \n")
    {
        $output = '';
        $formatted_meta = $this->get_formatted($hideprefix);
        if (!empty($formatted_meta)) {
            $meta_list = array();
            foreach ($formatted_meta as $meta) {
                if ($flat) {
                    $meta_list[] = wp_kses_post($meta['label'] . ': ' . $meta['value']);
                } else {
                    $meta_list[] = '
						<dt class="variation-' . sanitize_html_class(sanitize_text_field($meta['key'])) . '">' . wp_kses_post($meta['label']) . ':</dt>
						<dd class="variation-' . sanitize_html_class(sanitize_text_field($meta['key'])) . '">' . wp_kses_post(wpautop(make_clickable($meta['value']))) . '</dd>
					';
                }
            }
            if (!empty($meta_list)) {
                if ($flat) {
                    $output .= implode($delimiter, $meta_list);
                } else {
                    $output .= '<dl class="variation">' . implode('', $meta_list) . '</dl>';
                }
            }
        }
        $output = apply_filters('woocommerce_order_items_meta_display', $output, $this);
        if ($return) {
            return $output;
        } else {
            echo $output;
        }
    }
开发者ID:jesusmarket,项目名称:jesusmarket,代码行数:40,代码来源:class-wc-order-item-meta.php


示例8: in_plugin_update_message

 function in_plugin_update_message($plugin_data, $r)
 {
     // vars
     $readme = wp_remote_fopen(str_replace('/info/', '/trunk/readme.txt', $this->settings['remote']));
     $regexp = '/== Changelog ==(.*)= ' . $this->get_version() . ' =/sm';
     $o = '';
     // validate
     if (!$readme) {
         return;
     }
     // regexp
     preg_match($regexp, $readme, $matches);
     if (!isset($matches[1])) {
         return;
     }
     // add style
     $o .= '<style type="text/css">';
     $o .= '#advanced-custom-fields-options-page + .plugin-update-tr .update-message { background: #EAF2FA; border: #C7D7E2 solid 1px; padding: 10px; }';
     $o .= '</style>';
     // render changelog
     $changelog = explode('*', $matches[1]);
     array_shift($changelog);
     if (!empty($changelog)) {
         $o .= '<div class="acf-plugin-update-info">';
         $o .= '<h3>' . __("What's new", 'acf') . '</h3>';
         $o .= '<ul>';
         foreach ($changelog as $item) {
             $o .= '<li>' . make_clickable($item) . '</li>';
         }
         $o .= '</ul></div>';
     }
     echo $o;
 }
开发者ID:adhitiadarmawan,项目名称:rsa,代码行数:33,代码来源:acf-options-page-update.php


示例9: tamatebako_post_format_link_content

/**
 * Filters the content of the link format posts.  Wraps the content in the make_clickable() function 
 * so that users can enter just a URL into the post content editor.
 */
function tamatebako_post_format_link_content($content)
{
    if (has_post_format('link') && !preg_match('/<a\\s[^>]*?href=[\'"](.+?)[\'"]/is', $content)) {
        $content = make_clickable($content);
    }
    return $content;
}
开发者ID:WPDevHQ,项目名称:nevertheless,代码行数:11,代码来源:post-formats.php


示例10: default_keywords

 /**
  * Generate HTML for the keywords which will be defaulted
  */
 private function default_keywords()
 {
     // Default keywords
     echo WPSEO_News_Wrappers::textinput('default_keywords', __('Default Keywords', 'wordpress-seo-news'));
     echo '<p>' . __('It might be wise to add some of Google\'s suggested keywords to all of your posts, add them as a comma separated list. Find the list here:', 'wordpress-seo-news') . ' ' . make_clickable('http://www.google.com/support/news_pub/bin/answer.py?answer=116037') . '</p>';
     echo WPSEO_News_Wrappers::checkbox('restrict_sitemap_featured_img', __('Only use featured image for XML News sitemap, ignore images in post.', 'wordpress-seo-news'), false);
     echo '<br><br>';
 }
开发者ID:scottnkerr,项目名称:eeco,代码行数:11,代码来源:class-admin-page.php


示例11: rfbp_make_clickable

/**
 * @param $text
 * @param $target
 *
 * @return mixed|string
 */
function rfbp_make_clickable($text, $target)
{
    $clickable_text = make_clickable($text);
    if (!empty($target)) {
        return str_replace('<a href="', '<a target="' . $target . '" href="', $clickable_text);
    }
    return $clickable_text;
}
开发者ID:fedeB-IT-dept,项目名称:fedeB_website,代码行数:14,代码来源:helpers.php


示例12: text_format

 public function text_format($text)
 {
     if (!$text) {
         return;
     }
     $text = make_clickable($text);
     $text = wptexturize(str_replace(array("\r\n", "\r", "\n"), '', nl2br(trim($text))));
     return $text;
 }
开发者ID:lykeven,项目名称:graspzhihu,代码行数:9,代码来源:class-quotes-collection-quote.php


示例13: sanitizie_comment

 public function sanitizie_comment($content, $comment)
 {
     $post_type = get_post_type($comment->comment_post_ID);
     if ($post_type == 'dwqa-question' || $post_type == 'dwqa-answer') {
         $content = str_replace(esc_html('<br>'), '<br>', esc_html($content));
         $content = make_clickable($content);
         $content = preg_replace('/( <a[^>]* )( > )/', '$1 target="_blank" $2', $content);
     }
     return $content;
 }
开发者ID:layoutzweb,项目名称:dw-question-answer,代码行数:10,代码来源:Comment.php


示例14: Process

    /**
     * Convert plaintext URI to HTML links.
     *
     * Converts URI, www and ftp, and email addresses. Finishes by fixing links
     * within links.
     *
     * @since 0.71
     *
     * @param string $text Content to convert URIs.
     * @return string Content with converted URIs.
     */
    public static function Process($text)
    {
        $timer = Debug::GetTimer();
        $r = '';
        $textarr = preg_split('/(<[^<>]+>)/', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
        // split out HTML tags
        foreach ($textarr as $piece) {
            if (empty($piece) || $piece[0] == '<' && !preg_match('|^<\\s*[\\w]{1,20}+://|', $piece)) {
                $r .= $piece;
                continue;
            }
            // Long strings might contain expensive edge cases ...
            if (10000 < strlen($piece)) {
                // ... break it up
                foreach (self::_split_str_by_whitespace($piece, 2100) as $chunk) {
                    // 2100: Extra room for scheme and leading and trailing paretheses
                    if (2101 < strlen($chunk)) {
                        $r .= $chunk;
                        // Too big, no whitespace: bail.
                    } else {
                        $r .= make_clickable($chunk);
                    }
                }
            } else {
                $ret = " {$piece} ";
                // Pad with whitespace to simplify the regexes
                $url_clickable = '~
					([\\s(<.,;:!?])                                        # 1: Leading whitespace, or punctuation
					(                                                      # 2: URL
						[\\w]{1,20}+://                                # Scheme and hier-part prefix
						(?=\\S{1,2000}\\s)                               # Limit to URLs less than about 2000 characters long
						[\\w\\x80-\\xff#%\\~/@\\[\\]*(+=&$-]*+         # Non-punctuation URL character
						(?:                                            # Unroll the Loop: Only allow puctuation URL character if followed by a non-punctuation URL character
							[\'.,;:!?)]                            # Punctuation URL character
							[\\w\\x80-\\xff#%\\~/@\\[\\]*(+=&$-]++ # Non-punctuation URL character
						)*
					)
					(\\)?)                                                  # 3: Trailing closing parenthesis (for parethesis balancing post processing)
				~xS';
                // The regex is a non-anchored pattern and does not have a single fixed starting character.
                // Tell PCRE to spend more time optimizing since, when used on a page load, it will probably be used several times.
                $ret = preg_replace_callback($url_clickable, 'self::_make_url_clickable_cb', $ret);
                $ret = preg_replace_callback('#([\\s>])((www|ftp)\\.[\\w\\x80-\\xff\\#$%&~/.\\-;:=,?@\\[\\]+]+)#is', 'self::_make_web_ftp_clickable_cb', $ret);
                $ret = preg_replace_callback('#([\\s>])([.0-9a-z_+-]+)@(([0-9a-z-]+\\.)+[0-9a-z]{2,})#i', 'self::_make_email_clickable_cb', $ret);
                $ret = substr($ret, 1, -1);
                // Remove our whitespace padding.
                $r .= $ret;
            }
        }
        // Cleanup of accidental links within links
        $r = preg_replace('#(<a( [^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i', "\$1\$3</a>", $r);
        Debug::LogEvent(__METHOD__, $timer);
        return $r;
    }
开发者ID:railpage,项目名称:railpagecore,代码行数:65,代码来源:MakeClickable.php


示例15: output_csv

 /**
  * Sort the data for CSV output first
  *
  * @param int   $product_id
  * @param array $headers
  * @param array $body
  * @param array $items
  */
 public static function output_csv($product_id, $headers, $body, $items)
 {
     $headers['quantity'] = __('Quantity', 'wcvendors');
     $new_body = array();
     foreach ($body as $i => $order) {
         // Remove comments
         unset($body[$i]['comments']);
         // Remove all numeric keys in each order (these are the meta values we are redoing into new lines)
         foreach ($order as $key => $col) {
             if (is_int($key)) {
                 unset($order[$key]);
             }
         }
         // New order row
         $new_row = $body[$i];
         // Remove order to redo
         unset($body[$i]);
         $order = new WC_Order($i);
         foreach ($items[$i]['items'] as $item) {
             $product_id = !empty($item['variation_id']) ? $item['variation_id'] : $item['product_id'];
             $new_row_with_meta = $new_row;
             // Add the qty row
             $new_row_with_meta[] = $item['qty'];
             $item_meta = $item['name'];
             if ($metadata = $order->has_meta($item['product_id'])) {
                 foreach ($metadata as $meta) {
                     // Skip hidden core fields
                     if (in_array($meta['meta_key'], apply_filters('woocommerce_hidden_order_itemmeta', array('_qty', '_tax_class', '_product_id', '_variation_id', '_line_subtotal', '_line_subtotal_tax', '_line_total', '_line_tax', WC_Vendors::$pv_options->get_option('sold_by_label'))))) {
                         continue;
                     }
                     // Skip serialised meta
                     if (is_serialized($meta['meta_value'])) {
                         continue;
                     }
                     // Get attribute data
                     if (taxonomy_exists(wc_sanitize_taxonomy_name($meta['meta_key']))) {
                         $term = get_term_by('slug', $meta['meta_value'], wc_sanitize_taxonomy_name($meta['meta_key']));
                         $meta['meta_key'] = wc_attribute_label(wc_sanitize_taxonomy_name($meta['meta_key']));
                         $meta['meta_value'] = isset($term->name) ? $term->name : $meta['meta_value'];
                     } else {
                         $meta['meta_key'] = apply_filters('woocommerce_attribute_label', wc_attribute_label($meta['meta_key'], $_product), $meta['meta_key']);
                     }
                     $item_meta .= wp_kses_post(rawurldecode($meta['meta_key'])) . ':' . wp_kses_post(wpautop(make_clickable(rawurldecode($meta['meta_value']))));
                 }
             }
             $new_row_with_meta['product'] = $item_meta;
             $new_body[] = $new_row_with_meta;
         }
     }
     $headers = apply_filters('wcvendors_csv_headers', $headers, $product_id, $items);
     $body = apply_filters('wcvendors_csv_body', $new_body, $product_id, $items);
     WCV_Export_CSV::download($headers, $body, $product_id);
 }
开发者ID:stodorovic,项目名称:wcvendors,代码行数:61,代码来源:class-export-csv.php


示例16: strip_fancy_content

 /**
  * Remove all images, shortcodes, iframes, objects, and other fancy stuff.
  *
  * Makes unlinked URIs clickable.
  *
  * @param string $content
  * @return string
  */
 public function strip_fancy_content($content)
 {
     // strip images
     $content = preg_replace('/<img[^>]*>/', '', $content);
     // strip shortcodes
     $content = strip_shortcodes($content);
     // strip iframes and objects
     $content = preg_replace('#<(iframe|object)[^>]*>.*?<\\/\\1>#', '', $content);
     // make unlinked URLs clickable
     $content = make_clickable($content);
     return $content;
 }
开发者ID:postmatic,项目名称:beta-dist,代码行数:20,代码来源:local-post-rendering-modifier.php


示例17: display_tweets

    function display_tweets($show, $tweets, $hidepublicized, $before_tweet, $before_timesince, $account)
    {
        $tweets_out = 0;
        ?>
<ul class='tweets'><?php 
        foreach ((array) $tweets as $tweet) {
            if ($tweets_out >= $show) {
                break;
            }
            if (empty($tweet['text'])) {
                continue;
            }
            if ($hidepublicized && false !== strstr($tweet['source'], 'http://publicize.wp.com/')) {
                continue;
            }
            $tweet['text'] = esc_html($tweet['text']);
            // escape here so that Twitter handles in Tweets don't get mangled
            $tweet = $this->expand_tco_links($tweet);
            $tweet['text'] = make_clickable($tweet['text']);
            /*
             * Create links from plain text based on Twitter patterns
             * @link http://github.com/mzsanford/twitter-text-rb/blob/master/lib/regex.rb Official Twitter regex
             */
            $tweet['text'] = preg_replace_callback('/(^|[^0-9A-Z&\\/]+)(#|\\xef\\xbc\\x83)([0-9A-Z_]*[A-Z_]+[a-z0-9_\\xc0-\\xd6\\xd8-\\xf6\\xf8\\xff]*)/iu', array($this, '_jetpack_widget_twitter_hashtag'), $tweet['text']);
            $tweet['text'] = preg_replace_callback('/([^a-zA-Z0-9_]|^)([@\\xef\\xbc\\xa0]+)([a-zA-Z0-9_]{1,20})(\\/[a-zA-Z][a-zA-Z0-9\\x80-\\xff-]{0,79})?/u', array($this, '_jetpack_widget_twitter_username'), $tweet['text']);
            if (isset($tweet['id_str'])) {
                $tweet_id = urlencode($tweet['id_str']);
            } else {
                $tweet_id = urlencode($tweet['id']);
            }
            ?>

			<li>
				<?php 
            echo esc_attr($before_tweet) . $tweet['text'] . esc_attr($before_timesince);
            ?>
				<a href="<?php 
            echo esc_url("http://twitter.com/{$account}/statuses/{$tweet_id}");
            ?>
" class="timesince"><?php 
            echo esc_html(str_replace(' ', '&nbsp;', $this->time_since(strtotime($tweet['created_at']))));
            ?>
&nbsp;ago</a>
			</li>

			<?php 
            unset($tweet_it);
            $tweets_out++;
        }
        ?>
</ul><?php 
    }
开发者ID:moscarar,项目名称:cityhow,代码行数:52,代码来源:twitter.php


示例18: columns_data

 function columns_data($column)
 {
     global $post;
     $url = get_post_meta($post->ID, '_affurls_redirect', true);
     $count = get_post_meta($post->ID, '_affurls_count', true);
     if ($column == 'url') {
         echo make_clickable(esc_url($url ? $url : ''));
     } elseif ($column == 'permalink') {
         echo make_clickable(get_permalink());
     } elseif ($column == 'clicks') {
         echo esc_html($count ? $count : 0);
     }
 }
开发者ID:jinguanio,项目名称:Affiliate-URLs,代码行数:13,代码来源:affiliate-urls.php


示例19: chunk_url_grabber

 /**
  * Return the URL for the first link found in this post.
  *
  * @param string the_content Post content, falls back to current post content if empty.
  * @return string URL or empty string when no link is present.
  */
 function chunk_url_grabber($the_content = '')
 {
     if (empty($the_content)) {
         $the_content = make_clickable(get_the_content());
     }
     if (function_exists('get_url_in_content')) {
         return get_url_in_content($the_content);
     }
     if (preg_match('/<a\\s[^>]*?href=([\'"])(.+?)\\1/is', $the_content, $matches)) {
         return esc_url_raw($matches[1]);
     }
     return '';
 }
开发者ID:jun200,项目名称:wordpress,代码行数:19,代码来源:content-grabbers.php


示例20: show_entry

 public static function show_entry($atts)
 {
     $atts = shortcode_atts(array('id' => false, 'entry' => false, 'fields' => false, 'plain_text' => false, 'user_info' => false, 'include_blank' => false, 'default_email' => false, 'form_id' => false, 'format' => 'text', 'direction' => 'ltr', 'font_size' => '', 'text_color' => '', 'border_width' => '', 'border_color' => '', 'bg_color' => '', 'alt_bg_color' => '', 'clickable' => false), $atts);
     if ($atts['format'] != 'text') {
         //format options are text, array, or json
         $atts['plain_text'] = true;
     }
     if (is_object($atts['entry']) && !isset($atts['entry']->metas)) {
         // if the entry does not include metas, force it again
         $atts['entry'] = false;
     }
     if (!$atts['entry'] || !is_object($atts['entry'])) {
         if (!$atts['id'] && !$atts['default_email']) {
             return '';
         }
         if ($atts['id']) {
             $atts['entry'] = FrmEntry::getOne($atts['id'], true);
         }
     }
     if ($atts['entry']) {
         $atts['form_id'] = $atts['entry']->form_id;
         $atts['id'] = $atts['entry']->id;
     }
     if (!$atts['fields'] || !is_array($atts['fields'])) {
         $atts['fields'] = FrmField::get_all_for_form($atts['form_id'], '', 'include');
     }
     $values = array();
     foreach ($atts['fields'] as $f) {
         if ($f->type != 'password' && $f->type != 'credit_card') {
             self::fill_entry_values($atts, $f, $values);
         }
         unset($f);
     }
     self::fill_entry_user_info($atts, $values);
     if ($atts['format'] == 'json') {
         return json_encode($values);
     } else {
         if ($atts['format'] == 'array') {
             return $values;
         }
     }
     $content = array();
     self::convert_entry_to_content($values, $atts, $content);
     if ('text' == $atts['format']) {
         $content = implode('', $content);
     }
     if ($atts['clickable']) {
         $content = make_clickable($content);
     }
     return $content;
 }
开发者ID:hugocica,项目名称:locomotiva-2016,代码行数:51,代码来源:FrmEntryFormat.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP make_config_revision_entry函数代码示例发布时间:2022-05-15
下一篇:
PHP make_categories_options函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap