'' . esc_html__('Settings', 'General', 'WEBLIZAR_ABOUT_DOMAIN') . ''); $author_pro_link = array('Get Pro' => 'Get Premium'); $links = array_merge($author_settings_link, $links); $links = array_merge($author_pro_link, $links); } return $links; } add_filter('plugin_action_links', 'author_settings_link', 10, 5); class About_Author_Shorcode_And_Widget { public function __construct() { if (is_admin()) { add_action('init', array(&$this, 'AboutmeShortcode')); add_action('add_meta_boxes', array(&$this, 'Add_all_About_m_e_meta_boxes'), 1); add_action('admin_enqueue_scripts', array(&$this, 'my_about_me_style_files'), 1); add_action('about_me_save_post', array(&$this, 'About_me_Save_Settings'), 1); add_action('save_post', array(&$this, 'Weblizar_Save_fag_meta_box_save'), 9, 1); } } public function my_about_me_style_files($hook) { if ($hook != 'post.php' && $hook != 'post-new.php') { return; } wp_enqueue_script('jquery'); wp_register_script('popper', WEBLIZAR_ABOUT_ME_PLUGIN_URL . 'js/popper.min.js', array('jquery')); wp_enqueue_script('popper'); wp_register_script('bootstrap', WEBLIZAR_ABOUT_ME_PLUGIN_URL . 'js/bootstrap.min.js', array('jquery')); wp_enqueue_script('bootstrap'); wp_enqueue_script('theme-preview'); wp_enqueue_script('media-upload'); wp_enqueue_script('thickbox'); wp_enqueue_script('upload_media_widget', WEBLIZAR_ABOUT_ME_PLUGIN_URL . 'js/upload-media.js', array('jquery')); wp_enqueue_style('thickbox'); wp_enqueue_style('wp-color-picker'); wp_enqueue_script('wp-color-picker'); // code-mirror css & js for custom css section wp_enqueue_style('font-awesome', WEBLIZAR_ABOUT_ME_PLUGIN_URL . 'css/all.min.css'); wp_enqueue_style('author_codemirror-css', WEBLIZAR_ABOUT_ME_PLUGIN_URL . 'css/codemirror/codemirror.css'); wp_register_style('author_blackboard', WEBLIZAR_ABOUT_ME_PLUGIN_URL . 'css/codemirror/blackboard.css'); wp_enqueue_style('author_blackboard'); wp_register_style('author_show-hint-css', WEBLIZAR_ABOUT_ME_PLUGIN_URL . 'css/codemirror/show-hint.css'); wp_enqueue_style('author_show-hint-css'); wp_enqueue_style('bootstrap', WEBLIZAR_ABOUT_ME_PLUGIN_URL . 'css/bootstrap.min.css'); wp_register_script('author_codemirror-js', WEBLIZAR_ABOUT_ME_PLUGIN_URL . 'css/codemirror/codemirror.js', array('jquery')); wp_enqueue_script('author_codemirror-js'); wp_register_script('author_css-js', WEBLIZAR_ABOUT_ME_PLUGIN_URL . 'css/codemirror/aa-css.js', array('jquery')); wp_enqueue_script('author_css-js'); wp_register_script('author_css-hint-js', WEBLIZAR_ABOUT_ME_PLUGIN_URL . 'css/codemirror/css-hint.js', array('jquery')); wp_enqueue_script('author_css-hint-js'); } // Register Custom Post Type public function AboutmeShortcode() { $labels = array( 'name' => esc_html_x( 'About Author', 'Taxonomy General Name', WEBLIZAR_ABOUT_DOMAIN ), 'singular_name' => esc_html_x( 'About Author', 'Post Type Singular Name', WEBLIZAR_ABOUT_DOMAIN ), 'menu_name' => esc_html__( 'About Author', WEBLIZAR_ABOUT_DOMAIN ), 'add_new' => esc_html__( 'Add New', WEBLIZAR_ABOUT_DOMAIN ), 'add_new_item' => esc_html__( 'Add New', WEBLIZAR_ABOUT_DOMAIN ), 'edit_item' => esc_html__( 'Edit About Author', WEBLIZAR_ABOUT_DOMAIN ), 'new_item' => esc_html__( 'New About Author', WEBLIZAR_ABOUT_DOMAIN ), 'view_item' => esc_html__( 'View About Author', WEBLIZAR_ABOUT_DOMAIN ), 'search_items' => esc_html__( 'Search About Author', WEBLIZAR_ABOUT_DOMAIN ), 'not_found' => esc_html__( 'No About Author Shortcode Found', WEBLIZAR_ABOUT_DOMAIN ), 'not_found_in_trash' => esc_html__( 'No About Author Shortcode in Trash', WEBLIZAR_ABOUT_DOMAIN ), 'parent_item_colon' => esc_html__( 'Parent About Author:', WEBLIZAR_ABOUT_DOMAIN ), 'all_items' => esc_html__( 'All Shortcodes', WEBLIZAR_ABOUT_DOMAIN ), ); $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' => esc_html__('About Author', 'WEBLIZAR_ABOUT_DOMAIN'), 'shortcode' => esc_html__('About Author Shortcode', 'WEBLIZAR_ABOUT_DOMAIN'), 'author' => esc_html__('Author', 'WEBLIZAR_ABOUT_DOMAIN'), 'date' => esc_html__('Date', 'WEBLIZAR_ABOUT_DOMAIN') ); 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(esc_html__(' Add Images', 'WEBLIZAR_ABOUT_DOMAIN'), esc_html__('Select Template', 'WEBLIZAR_ABOUT_DOMAIN'), array(&$this, 'about_me_meta_box_setting_function'), 'about_author', 'normal', 'low'); add_meta_box(esc_html__('Add Settings', 'WEBLIZAR_ABOUT_DOMAIN'), esc_html__('Add settings', 'WEBLIZAR_ABOUT_DOMAIN'), array(&$this, 'me_meta_box_setting_function'), 'about_author', 'normal', 'low'); add_meta_box(esc_html__('Copy Shortcode', 'WEBLIZAR_ABOUT_DOMAIN'), esc_html__('Copy Shortcode', 'WEBLIZAR_ABOUT_DOMAIN'), array(&$this, 'Weblizar_shotcode_meta_box_function'), 'about_author', 'side', 'low'); add_meta_box(esc_html__('UpgradetoAboutAuthorPro', 'WEBLIZAR_ABOUT_DOMAIN'), esc_html__('About Author Pro', 'WEBLIZAR_ABOUT_DOMAIN'), array(&$this, 'weblizar_about_author_pro_meta_box'), 'about_author', 'side', 'low'); add_meta_box(esc_html__('Preview Shortcode', 'WEBLIZAR_ABOUT_DOMAIN'), esc_html__('Preview Shortcode', 'WEBLIZAR_ABOUT_DOMAIN'), array(&$this, 'ab_preview_box'), 'about_author', 'side', 'low'); add_meta_box(esc_html__('Activate About Author Widget', 'WEBLIZAR_ABOUT_DOMAIN'), esc_html__('Activate About Author Widget', 'WEBLIZAR_ABOUT_DOMAIN'), array(&$this, 'weblizar_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 Weblizar_shotcode_meta_box_function() { ?>
">[Weblizar id=' + id + ']
'); tb_remove(); }) });