'byline', //menu, byline, footnote, box
'footnote_last_updated_by' => 'Last updated by',
'footnote_last_updated_at' => 'at',
'footnote_show_updated_date' => true,
'box_about' => 'About',
'box_gravatar_size' => 60,
'menu_about_page' => '',
'menu_primary_author' => '',
'author_show_title' => true,
'author_about' => 'About',
'author_bio' => 'summary',
'author_find_more' => 'Find more about me on:',
'author_profiles'=> array(
'facebook' => array('Facebook','Facebook URL'),
'flickr' => array('Flickr', 'Flickr Profile URL'),
'googleplus'=> array('Google Plus', 'Google Plus Profile URL'),
'linkedin' => array('LinkedIn', 'Linked Profile Profile URL'),
'skype' => array('Skype', 'Skype Name'),
'twitter'=> array('Twitter','Twitter Profile URL'),
'youtube'=> array('YouTube', 'YouTube Channel URL')
),
'author_archive_heading'=> 'Here are my most recent posts',
'publisher_rel' => '', //Google Plus URL of publisher
);
private static $options = array();
private static function get_defaults() {
return self::$defaults;
}
private static $authorsure_bio_count = 0;
public static function get_options ($cache = true) {
if ($cache && (count(self::$options) > 0)) return self::$options;
$as_options = array();
$options = get_option('authorsure_options');
if (empty($options)) {
$as_options = self::get_defaults();
} else {
foreach ($options as $key => $option) if (isset($options[$key]) ) $as_options[$key] = $option;
$as_options = wp_parse_args( $as_options, self::get_defaults());
}
self::$options = $as_options;
return self::$options;
}
public static function get_option($option_name) {
$options = self::get_options();
if ($option_name && $options && array_key_exists($option_name,$options))
return $options[$option_name];
else
return false;
}
public static function get_extended_bio_key() {
return self::$extended_bio_metakey;
}
public static function get_publisher() {
return self::get_option('publisher_rel');
}
public static function save_options ($options) {
$result = update_option('authorsure_options',$options);
self::get_options(false); //update cache
return $result;
}
private static function allow_img($allowedtags) {
if ( !array_key_exists('img', $allowedtags)
|| (array_key_exists('img',$allowedtags) && !array_key_exists('src', $allowedtags['img']))) {
$allowedtags['img']['src'] = array ();
$allowedtags['img']['title'] = array ();
$allowedtags['img']['alt'] = array ();
$allowedtags['img']['height'] = array ();
$allowedtags['img']['width'] = array ();
}
return $allowedtags;
}
private static function allow_arel($allowedtags) {
if ( !array_key_exists('a', $allowedtags)
|| (array_key_exists('a',$allowedtags) && !array_key_exists('rel', $allowedtags['a'])))
$allowedtags['a']['rel'] = array ();
return $allowedtags;
}
public static function wordpress_allow_img() {
global $allowedtags;
$allowedtags = self::allow_img($allowedtags);
}
public static function wordpress_allow_arel() {
global $allowedtags;
$allowedtags = self::allow_arel($allowedtags);
}
public function genesis_allow_arel($allowedtags) {
return self::allow_arel($allowedtags);
}
public static function genesis_allow_img($allowedtags) {
return self::allow_img($allowedtags);
}
public static function is_author($user) {
return user_can($user, 'edit_posts');
}
private static function add_icon($profile, $label ) {
return sprintf(' %3$s',
AUTHORSURE_PLUGIN_URL.'/images/'.$profile.'.png', $profile, $label);
}
public static function add_contactmethods_profile( $contactmethods) {
return self::add_contactmethods( $contactmethods, 1);
}
public static function add_contactmethods( $contactmethods, $label_index=0 ) {
$profiles = self::get_option('author_profiles');
foreach ($profiles as $profile => $labels)
if (!array_key_exists($profile,$contactmethods)) $contactmethods[$profile] = self::add_icon($profile,$labels[$label_index]);
return $contactmethods;
}
public static function get_blog_author_link($id) {
return ''.get_bloginfo().'';
}
private static function get_author_link($id) {
return ''.get_the_author_meta('display_name', $id ).'';
}
private static function get_avatar($id) {
return get_avatar( get_the_author_meta('email', $id), self::get_option('author_gravatar_size') );
}
private static function about_author($id) {
return sprintf( '
%2$s %3$s%4$s.
', get_permalink(), self::get_option('footnote_last_updated_by'), $author, $updated_at); } private static function get_profiles($user) { $s=''; $profiles = self::get_option('author_profiles'); add_filter('user_contactmethods', array(AUTHORSURE,'add_contactmethods'),10,1); foreach (_wp_get_user_contactmethods( $user ) as $name => $desc) { if (array_key_exists($name,$profiles) && !empty($user->$name)) $s .= ''.self::get_option('author_find_more').'