'; if (!empty ($wp_biographia_settings['wp_biographia_content_prefix'])) { $wp_biographia_content .= $wp_biographia_settings['wp_biographia_content_prefix'] . ' '; } if (!empty ($wp_biographia_settings['wp_biographia_content_name']) && ($wp_biographia_settings['wp_biographia_content_name'] != 'none')) { switch($wp_biographia_settings['wp_biographia_content_name']) { case 'first-last-name': $wp_biographia_formatted_name .= $wp_biographia_author['first-last-name']; break; case 'account-name': $wp_biographia_formatted_name .= $wp_biographia_author['account-name']; break; case 'nickname': $wp_biographia_formatted_name .= $wp_biographia_author['nickname']; break; case 'display-name': $wp_biographia_formatted_name .= $wp_biographia_author['display-name']; break; } $wp_biographia_content .= '' . $wp_biographia_formatted_name . ''; } $wp_biographia_content .= ''; } if (!empty ($wp_biographia_settings['wp_biographia_content_bio'])) { $wp_biographia_content .= "

" .$wp_biographia_author['bio'] . "

"; } $wp_biographia_links = array (); $wp_biographia_link_item = ""; if (!empty ($wp_biographia_settings['wp_biographia_content_email']) && ($wp_biographia_settings['wp_biographia_content_email'] == 'on')) { if (!empty ($wp_biographia_author['email'])) { $wp_biographia_link_item = 'Mail'; $wp_biographia_links[] = $wp_biographia_link_item; } } if (!empty ($wp_biographia_settings['wp_biographia_content_web']) && ($wp_biographia_settings['wp_biographia_content_web'] == 'on')) { if (!empty ($wp_biographia_author['website'])) { $wp_biographia_link_item = 'Web'; $wp_biographia_links[] = $wp_biographia_link_item; } } if (!empty ($wp_biographia_settings['wp_biographia_content_twitter']) && ($wp_biographia_settings['wp_biographia_content_twitter'] == 'on')) { if (!empty ($wp_biographia_author['twitter'])) { $wp_biographia_link_item = 'Twitter'; $wp_biographia_links[] = $wp_biographia_link_item; } } if (!empty ($wp_biographia_settings['wp_biographia_content_facebook']) && ($wp_biographia_settings['wp_biographia_content_facebook'] == 'on')) { if (!empty ($wp_biographia_author['facebook'])) { $wp_biographia_link_item = 'Facebook'; $wp_biographia_links[] = $wp_biographia_link_item; } } if (!empty ($wp_biographia_settings['wp_biographia_content_linkedin']) && ($wp_biographia_settings['wp_biographia_content_linkedin'] == 'on')) { if (!empty ($wp_biographia_author['linkedin'])) { $wp_biographia_link_item = 'LinkedIn'; $wp_biographia_links[] = $wp_biographia_link_item; } } if (!empty ($wp_biographia_settings['wp_biographia_content_googleplus']) && ($wp_biographia_settings['wp_biographia_content_googleplus'] == 'on')) { if (!empty ($wp_biographia_author['googleplus'])) { $wp_biographia_link_item = 'Google+'; $wp_biographia_links[] = $wp_biographia_link_item; } } if (!empty ($wp_biographia_settings['wp_biographia_content_delicious']) && ($wp_biographia_settings['wp_biographia_content_delicious'] == 'on')) { if (!empty ($wp_biographia_author['delicious'])) { $wp_biographia_link_item = 'Delicious'; $wp_biographia_links[] = $wp_biographia_link_item; } } if (!empty ($wp_biographia_settings['wp_biographia_content_flickr']) && ($wp_biographia_settings['wp_biographia_content_flickr'] == 'on')) { if (!empty ($wp_biographia_author['flickr'])) { $wp_biographia_link_item = 'Flickr'; $wp_biographia_links[] = $wp_biographia_link_item; } } if (!empty ($wp_biographia_settings['wp_biographia_content_picasa']) && ($wp_biographia_settings['wp_biographia_content_picasa'] == 'on')) { if (!empty ($wp_biographia_author['picasa'])) { $wp_biographia_link_item = 'Picasa'; $wp_biographia_links[] = $wp_biographia_link_item; } } if (!empty ($wp_biographia_settings['wp_biographia_content_vimeo']) && ($wp_biographia_settings['wp_biographia_content_vimeo'] == 'on')) { if (!empty ($wp_biographia_author['vimeo'])) { $wp_biographia_link_item = 'Vimeo'; $wp_biographia_links[] = $wp_biographia_link_item; } } if (!empty ($wp_biographia_settings['wp_biographia_content_youtube']) && ($wp_biographia_settings['wp_biographia_content_youtube'] == 'on')) { if (!empty ($wp_biographia_author['youtube'])) { $wp_biographia_link_item = 'YouTube'; $wp_biographia_links[] = $wp_biographia_link_item; } } if (!empty ($wp_biographia_settings['wp_biographia_content_reddit']) && ($wp_biographia_settings['wp_biographia_content_reddit'] == 'on')) { if (!empty ($wp_biographia_author['reddit'])) { $wp_biographia_link_item = 'Reddit'; $wp_biographia_links[] = $wp_biographia_link_item; } } if (!empty ($wp_biographia_settings['wp_biographia_content_posts']) && ($wp_biographia_settings['wp_biographia_content_posts'] != 'none')) { $wp_biographia_link_item = ''; } $wp_biographia_biography = ""; if (!$for_feed) { $wp_biographia_biography = '
'; if (!empty ($wp_biographia_settings['wp_biographia_content_image']) && ($wp_biographia_settings['wp_biographia_content_image'] == 'on')) { $wp_biographia_biography .= '
' . $wp_biographia_author_pic . '
'; } $wp_biographia_biography .= '
' . $wp_biographia_content . '
'; } else { $wp_biographia_biography = '

'; if (!empty ($wp_biographia_settings['wp_biographia_content_image']) && ($wp_biographia_settings['wp_biographia_content_image'] == 'on')) { $wp_biographia_biography .= '

"on", "wp_biographia_version" => "20", "wp_biographia_style_bg" => "#FFEAA8", "wp_biographia_style_border" => "top", "wp_biographia_display_front" => "on", "wp_biographia_display_archives" => "on", "wp_biographia_display_posts" => "on", "wp_biographia_display_pages" => "on", "wp_biographia_display_feed" => "", "wp_biographia_content_prefix" => "About", "wp_biographia_content_name" => "first-last-name", "wp_biographia_content_image" => "on", "wp_biographia_content_bio" => "on", "wp_biographia_content_email" => "on", "wp_biographia_content_web" => "on", "wp_biographia_content_twitter" => "on", "wp_biographia_content_facebook" => "on", "wp_biographia_content_linkedin" => "on", "wp_biographia_content_googleplus" => "on", "wp_biographia_content_delicious" => "", "wp_biographia_content_flickr" => "", "wp_biographia_content_picasa" => "", "wp_biograpia_content_vimeo" => "", "wp_biographia_content_youtube" => "", "wp_biographia_content_reddit" => "", "wp_biographia_content_posts" => "extended" /* * "wp_biographia_beta_enabled" => "" */ ); update_option ('wp_biographia_settings', $wp_biographia_settings); } if (!$wp_biographia_settings['wp_biographia_display_feed']) { $wp_biographia_settings['wp_biographia_display_feed'] = ""; update_option('wp_biographia_settings', $wp_biographia_settings); } } /* * Display the biography box when the [wp_biographia] short-code is detected */ function wp_biographia_shortcode($atts) { $content = ""; extract (shortcode_atts (array ( 'mode' => 'raw' ), $atts)); if ($mode == 'raw') { $content = wp_biographia_display (); } elseif ($mode == 'configured') { $placeholder_content = ""; $is_shortcode = true; $content = wp_biographia_insert ($placeholder_content, $is_shortcode); } return $content; } /* * Define plugin activation hook */ register_activation_hook(__FILE__, 'wp_biographia_add_defaults'); /* * Define plugin specific core action hooks * * 1) Add in our admin panel * 2) Add in our scripts for the admin panel * 3) Add in our CSS for the admin panel * 4) Add in our CSS for the generated page * 5) Add in checking for updating the configuration options after a plugin upgrade * 6/7) Add in user profile extensions for excluding the Biography Box * 8/9) Save user profile extensions for exclusing the Biography Box */ add_action ('admin_menu','wp_biographia_add_options_subpanel'); add_action ('admin_print_scripts', 'wp_biographia_add_admin_scripts'); add_action ('admin_print_styles', 'wp_biographia_add_admin_styles'); // Move to using wp_enqueue_scripts rather than wp_print_styles; see // http://wpdevel.wordpress.com/2011/12/12/use-wp_enqueue_scripts-not-wp_print_styles-to-enqueue-scripts-and-styles-for-the-frontend/ // add_action ('wp_print_styles', 'wp_biographia_style' ); add_action ('wp_enqueue_scripts', 'wp_biographia_style' ); add_action ('admin_init', 'wp_biographia_admin_init'); add_action ('show_user_profile', 'wp_biographia_add_profile_extensions'); add_action ('edit_user_profile', 'wp_biographia_add_profile_extensions'); add_action ('personal_options_update', 'wp_biographia_save_profile_extensions'); add_action ('edit_user_profile_update', 'wp_biographia_save_profile_extensions'); /* * Define plugin specific core filter hooks * * 1) Sanitize/filter the author's profile contact info * 2) Add in post processing to add the Biography Box to the page content * 3) Add in post processing to add the Biography Box to archive pages using excerpts * 4) Add in plugin settings link */ add_filter ('user_contactmethods', 'wp_biographia_filter_contact'); add_filter ('the_content', 'wp_biographia_insert'); add_filter ('the_excerpt', 'wp_biographia_insert'); add_filter ('plugin_action_links_' . plugin_basename (__FILE__), 'wp_biographia_settings_link'); /* * Define plugin specific short-code hooks * * 1) [wp_biographia] short-code */ add_shortcode ('wp_biographia', 'wp_biographia_shortcode'); ?>