'About Author',
'singular_name' => 'About Author',
'menu_name' => 'About Author',
'add_new' => 'Add New',
'add_new_item' => 'Add New',
'edit_item' =>'Edit About Author',
'new_item' => 'New About Author',
'view_item' => 'View About Author',
'search_items' => 'Search About Author',
'not_found' => 'No About Author Shortcode Found',
'not_found_in_trash' => 'No About Author Shortcode in Trash',
'parent_item_colon' => 'Parent About Author:',
'all_items' => 'All Shortcodes',
);
$args = array(
'labels' => $labels,
'hierarchical' => false,
'supports' => array( 'title'),
'public' => false,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 65,
'menu_icon' => 'dashicons-id',
'show_in_nav_menus' => false,
'publicly_queryable' => false,
'exclude_from_search' => true,
'has_archive' => true,
'query_var' => true,
'can_export' => true,
'rewrite' => false,
'capability_type' =>'post'
);
register_post_type( 'about_author', $args );
add_filter( 'manage_edit-about_author_columns', array(&$this, 'about_author_columns' )) ;
add_action( 'manage_about_author_posts_custom_column', array(&$this, 'about_author_manage_columns' ), 10, 2 );
}
function about_author_columns( $columns ){
$columns = array(
'cb' => '',
'title' => __( 'About Author' ),
'shortcode' => __( 'About Author Shortcode' ),
'date' => __( 'Date' )
);
return $columns;
}
function about_author_manage_columns( $column, $post_id ){
global $post;
switch( $column ) {
case 'shortcode' :
echo '';
break;
default :
break;
}
}
//add metaboxes
public function Add_all_About_m_e_meta_boxes() {
add_meta_box( __(' Add Images', 'WL_ABTM_TXT_DM'), __('Select Template', 'WL_ABTM_TXT_DM'), array(&$this, 'about_me_meta_box_setting_function'), 'about_author', 'normal', 'low' );
add_meta_box ( __('Add Settings', 'WL_ABTM_TXT_DM'), __('Add settings', 'WL_ABTM_TXT_DM'), array(&$this, 'me_meta_box_setting_function'), 'about_author', 'normal', 'low');
add_meta_box ( __('Copy Shortcode', 'WL_ABTM_TXT_DM'), __('Copy Shortcode', 'WL_ABTM_TXT_DM'), array(&$this, 'ABTM_shotcode_meta_box_function'), 'about_author', 'side', 'low');
add_meta_box ( __('Preview Shortcode', 'WL_ABTM_TXT_DM'), __('Preview Shortcode', 'WL_ABTM_TXT_DM'), array(&$this, 'ab_preview_box'), 'about_author', 'side', 'low');
add_meta_box(__('Activate About Author Widget','WL_ABTM_TXT_DM') , __('Activate About Author Widget', 'WL_ABTM_TXT_DM'), array(&$this,'abtm_use_widget_meta_box'), 'about_author', 'side', 'low');
}
//add setting page of general settings
public function about_me_meta_box_setting_function($post) {
require("settings/template-settings.php");
}
public function me_meta_box_setting_function($post) {
require("settings/general-settings.php");
}
//display short code on custom post type page
public function ABTM_shotcode_meta_box_function() { ?>
">
Click here to preview
';
$ABT=$_REQUEST['post'];
echo '
';
} else {
echo "Please save first to check preview.
";
}
}
function abtm_use_widget_meta_box() { ?>
$About_me_bg_color,
'About_me_user_name' => $About_me_user_name,
'About_me_web_site_name' => $About_me_web_site_name,
'About_me_dis_cription' => $About_me_dis_cription,
'followfb' => $followfb,
'followgoogle' => $followgoogle,
'followinsta' => $followinsta,
'followlinkdln' =>$followlinkdln,
'followtwit' =>$followtwit,
'bodr' =>$bodr,
'img_bdr_type' =>$img_bdr_type,
'bdr_size' =>$bdr_size,
'img_bdr_color' =>$img_bdr_color,
'name_font_size' =>$name_font_size,
'name_Color' =>$name_Color,
'weblink_font_size' =>$weblink_font_size,
'weblink_text_color' =>$weblink_text_color,
'dis_font_size' =>$dis_font_size,
'dis_text_color' =>$dis_text_color,
'PGPP_Font_Style' =>$PGPP_Font_Style,
'profile_user_image' =>$profile_user_image,
'user_header_image' =>$user_header_image,
'About_me_social_color' =>$About_me_social_color,
'About_me_custom_css' =>$About_me_custom_css,
'Tem_pl_at_e' =>$Tem_pl_at_e,
'Social_icon_size' =>$Social_icon_size,
);
$abt_Settings = "abt_Settings_".$PostID;
update_post_meta($PostID, $abt_Settings, serialize($ABTArray));
}
}
} // end of class
//create object of About_Author_Shorcode_And_Widget class
global $About_Author_Shorcode_And_Widget;
$About_Author_Shorcode_And_Widget = new About_Author_Shorcode_And_Widget();
//include short code file
require_once("about-author-use-shortcode.php");
// include widget code file
require_once("about-author-widget-code.php");
add_action('media_buttons_context', 'aa_add_rpg_custom_button');
add_action('admin_footer', 'aa_add_rpg_inline_popup_content');
//add media button fuction
function aa_add_rpg_custom_button($context) {
$container_id = 'AMSA';
$title = __('Select About Author Shortcode to insert with content','WL_ABTM_TXT_DM') ;
$context = '
'. __("About Author Shortcode And Widget","'WL_ABTM_TXT_DM'").'
';
return $context;
}
function aa_add_rpg_inline_popup_content() { ?>
publish;
if(!$all_posts==null) {?>
No About Author Shortcode Found
sanitize_text_field($_POST['followfb']),
'followgoogle' =>sanitize_text_field($_POST['followgoogle']),
'followinsta' =>sanitize_text_field($_POST['followinsta']),
'followlinkdln' =>sanitize_text_field($_POST['followlinkdln']),
'followtwit' =>sanitize_text_field($_POST['followtwit']),
);
foreach($metas as $key => $value) {
update_user_meta( $user_id, $key, $value );
}
}
add_action( 'show_user_profile', 'fb_add_custom_user_profile_fields' );
add_action( 'edit_user_profile', 'fb_add_custom_user_profile_fields' );
add_action( 'personal_options_update', 'fb_save_custom_user_profile_fields' );
add_action( 'edit_user_profile_update', 'fb_save_custom_user_profile_fields' );
function load_author_info_after_page_content($content) {
if (!is_single() && get_post_type( $post = get_post() ) == "page") {
$ABio_settings = unserialize(get_option('author_info_Settings'));
$use_page=$ABio_settings[0]['Author_short_code'];
$switch_off_page = $ABio_settings[0]['switch_off_page'];
if($switch_off_page=='yes') {
if($use_page) {
$content .= do_shortcode( '[ABINFO id='. $use_page.']' );
}
}
}
return $content;
}
add_filter( "the_content", "load_author_info_after_page_content", 20 );
function load_author_info_after_post_content($content){
if (is_single() && get_post_type( $post = get_post() ) == "post") {
$ABio_settings = unserialize(get_option('author_info_Settings'));
$use_page=$ABio_settings[0]['Author_short_code'];
$switch_off_post = $ABio_settings[0]['switch_off_post'];
if($switch_off_post=='yes') {
if($use_page) {
$content .= do_shortcode( '[ABINFO id='. $use_page.']' );
}
}
}
return $content;
}
add_filter( "the_content", "load_author_info_after_post_content", 20);
require_once("author-setting/about-author-use-shortcode2.php");
?>