";
$aftercontent .= "
";
$aftercontent .= "
". __( 'Information', 'author_info_box' )." ";
if(get_the_author_meta( 'facebooktab_profile' )){
$aftercontent .= "
";
$aftercontent .= "
". __( 'Facebook', 'author_info_box' )." ";
}
if(get_the_author_meta( 'twittertab_profile' )){
$aftercontent .= "
";
$aftercontent .= "
". __( 'Twitter', 'author_info_box' )." ";
}
if(get_the_author_meta( 'pinteresttab_profile' )){
$aftercontent .= "
";
$aftercontent .= "
". __( 'Pinterest', 'author_info_box' )." ";
}
if(get_the_author_meta( 'googletab_profile' )){
$aftercontent .= "
";
$aftercontent .= "
". __( 'Google', 'author_info_box' )." ";
}
if( get_option('hide_last_post')!="on"){
$aftercontent .= "
";
$aftercontent .= "
". __( 'Latest post', 'author_info_box' )." ";
}
if(get_the_author_meta( 'custom_content_profile' )){
$aftercontent .= "
";
$aftercontent .= "
".get_the_author_meta( 'custom_title_profile' )." ";
}
if(get_option( 'author_contact' )=="on"){
$aftercontent .= "
";
$aftercontent .= "
". __( 'Contact', 'author_info_box' )." ";
}
$avatarsize = esc_attr( get_option('author_avatar_size') );
if($avatarsize <= 0){
$avatarsize = 120;
}
$aftercontent .= "
";
$aftercontent .= "
";
$aftercontent .= "
";
$aftercontent .= "
".get_avatar( get_the_author_meta( 'email_profile' ), $avatarsize )."
";
$aftercontent .= "
".get_the_author_meta( 'name_profile' )."
";
$aftercontent .= "
";
$aftercontent .= "
".get_the_author_meta( 'description_profile' )."
";
$aftercontent .= "
";
$aftercontent .= "
";
foreach ($arr as &$value) {
if($value!="facebooktab" && $value!="twittertab" && $value!="pinteresttab" && $value!="googletab" && $value!="custom_title" && $value!="custom_content" && $value!="name" && $value!="email" && $value!="website" && $value!="description" && get_the_author_meta( $value.'_profile' )!="" && $value!="author_contact_form"){
$aftercontent .= "
";
}
}
$aftercontent .= "
";
$aftercontent .= "
";
if(get_the_author_meta( 'facebooktab_profile' )){
$aftercontent .= '
';
$aftercontent .= "
";
$aftercontent .= get_the_author_meta( 'facebooktab_profile' );
$aftercontent .= '
';
$aftercontent .= '
';
}
if(get_the_author_meta( 'twittertab_profile' )){
$aftercontent .= '
';
$aftercontent .= "
";
$aftercontent .= get_the_author_meta( 'twittertab_profile' );
$aftercontent .= '
';
$aftercontent .= '
';
}
if(get_the_author_meta( 'pinteresttab_profile' )){
$aftercontent .= '
';
$aftercontent .= "
";
$aftercontent .= get_the_author_meta( 'pinteresttab_profile' );
$aftercontent .= '
';
$aftercontent .= '
';
}
if(get_the_author_meta( 'googletab_profile' )){
$aftercontent .= '
';
$aftercontent .= "
";
$aftercontent .= get_the_author_meta( 'googletab_profile' );
$aftercontent .= '
';
$aftercontent .= '
';
}
$aftercontent .= "
";
$aftercontent .= "
";
$recent = get_posts(array(
'author'=>$user_id,
'orderby'=>'date',
'order'=>'desc',
'numberposts'=>5
));
if( $recent ){
foreach ($recent as &$value) {
$aftercontent .= '
'.''.get_the_date("d/m/Y",$value->ID).' '.get_the_title($value->ID).' ';
}
}else{
//No published posts
}
$aftercontent .= "
";
$aftercontent .= "
";
if(get_the_author_meta( 'custom_content_profile' )){
$aftercontent .= '
';
$aftercontent .= "
";
$aftercontent .= "
";
$aftercontent .= get_the_author_meta( 'custom_content_profile' );
$aftercontent .= '
';
$aftercontent .= '
';
$aftercontent .= '
';
}
$aftercontent .= '
';
$aftercontent .= "
";
$aftercontent .= get_the_author_meta( 'author_contact_form_profile' );
$aftercontent .= '
';
$aftercontent .= '
';
$aftercontent .= "
";
}
if( get_option('display_before')!="on"){
$fullcontent = $content . $aftercontent;
}else{
$fullcontent = $aftercontent . $content;
}
return $fullcontent;
}
add_filter ('the_content', 'author_info_box_user_add_post_content', 0);
add_shortcode("author_info_box", "author_info_box_user_add_post_content");
add_action( 'wp_enqueue_scripts', 'author_info_box_user_stylesheet' );
function author_info_box_user_stylesheet() {
wp_register_style( 'author_info_box_user_style', plugins_url('css/style.css', __FILE__) );
wp_enqueue_style( 'author_info_box_user_style' );
wp_register_style( 'author_info_box_user_socicon_style', plugins_url('socicon/socicon.css', __FILE__) );
wp_enqueue_style( 'author_info_box_user_socicon_style' );
wp_register_style('myStyleSheet', plugins_url('css/frontendcss.php', __FILE__));
wp_enqueue_style( 'myStyleSheet');
}
add_action( 'admin_enqueue_scripts', 'author_info_box_enqueue_color_picker' );
function author_info_box_enqueue_color_picker( $hook_suffix ) {
wp_enqueue_style( 'wp-color-picker' );
wp_enqueue_script( 'my-script-handle', plugins_url('js/custom.js', __FILE__ ), array( 'wp-color-picker' ), false, true );
}
add_action('admin_menu', 'author_info_box_settings_create_menu');
function author_info_box_settings_create_menu() {
add_menu_page('Author Info Box', 'Author Info Box', 'administrator', __FILE__, 'author_info_box_settings_page' );
add_action( 'admin_init', 'author_info_box_settings' );
}
function author_info_box_settings() {
register_setting( 'author-info-box-settings-group', 'display_post' );
register_setting( 'author-info-box-settings-group', 'display_page' );
register_setting( 'author-info-box-settings-group', 'square_avatar' );
register_setting( 'author-info-box-settings-group', 'hide_last_post' );
register_setting( 'author-info-box-settings-group', 'display_before' );
register_setting( 'author-info-box-settings-group', 'background_color' );
register_setting( 'author-info-box-settings-group', 'border_color' );
register_setting( 'author-info-box-settings-group', 'author_name_font' );
register_setting( 'author-info-box-settings-group', 'author_avatar_size' );
register_setting( 'author-info-box-settings-group', 'social_background_color' );
register_setting( 'author-info-box-settings-group', 'social_color' );
register_setting( 'author-info-box-settings-group', 'square_social' );
register_setting( 'author-info-box-settings-group', 'author_contact' );
}
function author_info_box_settings_page() {
?>