", $feed); $stepTwo = explode("", $stepOne[1]); $tweet = $stepTwo[0]; $tweet = str_replace('<', '<', $tweet); $tweet = str_replace('>', '>', $tweet); return $tweet; } public static function last_tweet($username, $prefix = '', $suffix = '') { $feed = "http://search.twitter.com/search.atom?q=from:" . $username . "&rpp=1"; // Prefix - some text you want displayed before your latest tweet. // (HTML is OK, but be sure to escape quotes with backslashes: for example href=\"link.html\") //$prefix = ""; // Suffix - some text you want display after your latest tweet. (Same rules as the prefix.) //$suffix = ""; $twitterFeed = file_get_contents($feed); echo stripslashes($prefix) . self::parse_feed($twitterFeed) . stripslashes($suffix); } /** * * @param strig $username twitter user name */ public static function latest_tweet($username) { include_once(ABSPATH . WPINC . '/class-simplepie.php'); $tweet = fetch_rss("http://search.twitter.com/search.atom?q=from:" . $username . "&rpp=1"); echo $tweet->items[0]['atom_content']; } public static function extra_contact_info($contactmethods) { unset($contactmethods['aim']); unset($contactmethods['yim']); unset($contactmethods['jabber']); $contactmethods['feedburner_page'] = 'Feedburner Url'; $contactmethods['facebook'] = 'Facebook Url'; $contactmethods['facebook_page'] = 'Facebook Fan Page'; $contactmethods['google_plus_url'] = 'Google Plus Url'; $contactmethods['google_page_url'] = 'Google Page Url'; $contactmethods['twitter'] = 'Twitter Url'; $contactmethods['twitter_user'] = 'Twitter Username'; $contactmethods['linkedin'] = 'LinkedIn'; $contactmethods['flickr'] = 'Flickr Username'; $contactmethods['blog'] = 'Blog Url'; $contactmethods['cell'] = 'Mobile Phone'; return $contactmethods; } public static function contact_info() { //http://www.wprecipes.com/how-to-easily-modify-user-contact-info //http://thomasgriffinmedia.com/blog/2010/09/how-to-add-custom-user-contact-info-in-wordpress/ //the_author_meta('facebook', $current_author->ID); add_filter('user_contactmethods', array('cwp_social', 'extra_contact_info')); } /** * * @param string $name -- twitter, facebook, google_plus, linkedin, feedburner_page */ public static function connections($name = null) { $link = false; $theme_admin = (cwp::theme_options('themeadmin') ? cwp::theme_options('themeadmin') : 1); if (isset($name)): $link = the_author_meta($name, $theme_admin); endif; return $link; } /** * * @param type $user_id * @return string feed subscriptions url for verification */ public static function feedburner_subscriptions($user_id = 1) { $feed = get_the_author_meta('feedburner_page', $user_id); //$r = explode('=', $feed); return "http://feedburner.google.com/fb/a/mailverify?uri={$feed}"; } public static function feedburner_url($user_id = 1) { $feed = the_author_meta('feedburner_url', $user_id); $r = explode('=', $feed); return $feed; } public static function google_plusone($content) { $content = $content . '
'); ' if you want to keep some tags
$text = substr($text, 0, $length); $excerpt = self::reverse_strrchr($text, '.', 1); if ($excerpt) { echo apply_filters('the_excerpt', $excerpt); } else { echo apply_filters('the_excerpt', $text); } } public static function reverse_strrchr($haystack, $needle, $trail) { return strrpos($haystack, $needle) ? substr($haystack, 0, strrpos($haystack, $needle) + $trail) : false; } public static function editor() { add_editor_style('post_css'); } function fb_move_admin_bar() { echo ' '; } // on backend area //add_action( 'admin_head', 'fb_move_admin_bar' ); // on frontend area public static function admin_bar_footer() { add_action('wp_head', array('core_functions', 'fb_move_admin_bar')); } public static function hide_bar_admin() { add_filter('show_admin_bar', '__return_false'); } /** * Add all post format support * @param array $array -default : 'aside', 'gallery', 'video', 'link', 'image', 'quote', 'status' */ public static function all_post_formats($array = array('aside', 'gallery', 'video', 'link', 'image', 'quote', 'status', 'chat')) { add_theme_support('post-formats', $array); } /** * * @param string $theme_name * @param string $option_value */ public function theme_activation($theme_name = null, $option_value = 'yes') { $theme = $theme_name . '_activated'; if (get_option($theme) != $option_value) { update_option($theme, $option_value); } } /** * * @param type $theme_name */ public function theme_deactivation($theme_name = null) { $theme = $theme_name . '_activated'; delete_option($theme); } public static function no_smiley_face() { add_action('wp_head', array('core_functions', '_smiley_face')); } public function _smiley_face() { echo ' '; } public static function jquery($url = 'https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js', $version = '1.6.1') { if (!is_admin()) { // comment out the next two lines to load the local copy of jQuery wp_deregister_script('jquery'); wp_register_script('jquery', $url, false, $version); wp_enqueue_script('jquery'); } } public static function inuit_css($style = 'inuit') { $path = CM_URL . '/inuit/css/'; $css = $path . 'inuit.css'; wp_enqueue_style('inuit', $css); $grid = $path . 'grid.inuit.css'; wp_enqueue_style('grid-inuit', $grid, array('inuit')); $dropdown = $path . 'dropdown.inuit.css'; wp_enqueue_style('dropdown-inuit', $dropdown, array('inuit')); } public static function extra_contact_info($contactmethods) { unset($contactmethods['aim']); unset($contactmethods['yim']); unset($contactmethods['jabber']); $contactmethods['facebook'] = 'Facebook'; $contactmethods['twitter'] = 'Twitter'; $contactmethods['linkedin'] = 'LinkedIn'; $contactmethods['flickr'] = 'Flickr'; return $contactmethods; } public static function add_contact_info() { //http://www.wprecipes.com/how-to-easily-modify-user-contact-info //http://thomasgriffinmedia.com/blog/2010/09/how-to-add-custom-user-contact-info-in-wordpress/ //the_author_meta('facebook', $current_author->ID); add_filter('user_contactmethods', array('core_functions', 'extra_contact_info')); } }