posts or/and pages with social media icons Author: Oğulcan Orhan Version: 1.0.1 Author URI: http://ogulcan.org Copyright 2011 Ogulcan Orhan (email : mail@ogulcan.org) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ function author_box_style() { $plugin_style = "/another-author-box/style.css"; echo ''."\n"; } function author_box_display($content) { $options["page"] = get_option("show_page"); $options["post"] = get_option("show_post"); $options["author"] = get_option("show_author"); $options["social"] = get_option("show_social_link"); $options["twitter"] = get_option("social_twitter"); $options["facebook"] = get_option("social_facebook"); $options["linkedin"] = get_option("social_linkedin"); //plugin images $image_content = plugins_url()."/another-author-box"."/images/"; //author post links $link = get_author_posts_url( get_the_author_meta( 'ID' ) ); if ( (is_single() && $options["post"]) || (is_page() && $options["page"]) ) { $bio_box = '
'.get_avatar( get_the_author_meta("user_email"), "80" ).'

'.get_the_author_meta("display_name").'

'.get_the_author_meta("description").'

'; //show social links? if( $options["social"] ) { $twitter = empty ($options["twitter"]); $facebook = empty ($options["facebook"]); $linkedin = empty ($options["linkedin"]); if( !$twitter || !$facebook || !$linkedin ) { $bio_box .= ''; if(!$twitter) { $bio_box .= ''; } if(!$facebook) { $bio_box .= ''; } if(!$linkedin) { $bio_box .= ''; } $bio_box .= ''; } } //show author link? if( $options["author"] ) { $bio_box .= 'Yazara ait tüm yazılar →'; } $bio_box .= "
"; return $content . $bio_box; } else { return $content; } } function author_box_settings() { if ($_POST["action"] == "update") { $_POST["show_pages"] == "on" ? update_option("show_page", "checked") : update_option("show_page", ""); $_POST["show_posts"] == "on" ? update_option("show_post", "checked") : update_option("show_post", ""); $_POST["author_links"] == "on" ? update_option("show_author", "checked") : update_option("show_author", ""); $_POST["show_social_link"] == "on" ? update_option("show_social_link", "checked") : update_option("show_social_link", ""); is_null($_POST["twitter"]) ? update_option("social_twitter", "") : update_option("social_twitter", $_POST["twitter"]); is_null($_POST["facebook"]) ? update_option("social_facebook", "") : update_option("social_facebook", $_POST["facebook"]); is_null($_POST["linkedin"]) ? update_option("social_linkedin", "") : update_option("social_linkedin", $_POST["linkedin"]); $message = '

Options saved

'; } $options["page"] = get_option("show_page"); $options["post"] = get_option("show_post"); $options["author"] = get_option("show_author"); $options["social"] = get_option("show_social_link"); $options["twitter"] = get_option("social_twitter"); $options["facebook"] = get_option("social_facebook"); $options["linkedin"] = get_option("social_linkedin"); echo '
'.$message.'

Author Box Settings

Display Options

Show on pages: Default: false
Show on posts: Default: false
Show author links: Show author post link

Social Link Options

Show Links:
Need just username (ex: ogulcanor)
Need just username (ex: ogulcan)
Need just username (ex: ogulcanorhan)
Note: If textbox is blank, that icon would not shown
'; } function author_box_admin_menu(){ add_options_page("Author Box", "Author Box", 9, basename(__FILE__), "author_box_settings"); } add_action("the_content", "author_box_display"); add_action("wp_head", "author_box_style"); add_action("admin_menu", "author_box_admin_menu"); ?>