6.4 post_type Doanh nghiệp
Last updated
Last updated
C:\xampp\htdocs\reset\wp-content\themes\twentyseventeen\coreelements-admin.php
<?php
class Coreelements_Admin {
use OptionFunctions;
// use PointFinderCommonFunctions;
// use PointFinderWPMLFunctions;
// use PointFinderCUFunctions;
// use PointFinderMailSystem;
// use PointFinderMembershipPackages;
// use PointFinderPPPPackages;
// use PointFinderListingBackendFilters;
// use PointFinderListingBackendReviewMetabox;
// use PointFinderReviewFunctions;
// use PointFinderMOrderMetaboxes;
// use PointFinderOrderMetaboxes;
// use PointFinderStatusChangeFunctions;
// use ListingMetabox;
// use PointfinderInvoicesMetabox;
// use PointFinderScheduleFunctions;
// use PointFinderUserProfileModifications;
// use PointFinderAdminDashboardWidgets;
// use PointFinderNewVersionNotice;
// use PointFinderListingTypeConnections;
// use PointFinderWPMLStringGenerator;
private $plugin_name;
private $version;
private $post_type_name;
private $agent_post_type_name;
public function __construct($plugin_name, $version, $post_type_name, $agent_post_type_name) {
$this->plugin_name = $plugin_name;
$this->version = $version;
$this->agent_post_type_name = $agent_post_type_name;
$this->post_type_name = $post_type_name;
}
public function enqueue_styles_scripts() {
global $pagenow;
global $post_type;
wp_enqueue_style($this->plugin_name, PFCOREELEMENTSURLADMIN . 'css/coreelements-admin.css', array() , $this->version, 'all');
wp_register_script($this->plugin_name, PFCOREELEMENTSURLADMIN . 'js/coreelements-admin.js', array('jquery') , $this->version, false);
wp_enqueue_script($this->plugin_name);
}
public function create_post_type() {
$setup3_pointposttype_pt2 = $this->PFSAIssetControl('setup3_pointposttype_pt2', '', 'PF Item');
// $setup3_pointposttype_pt3 = $this->PFSAIssetControl('setup3_pointposttype_pt3', '', 'PF Items');
$setup3_pointposttype_pt3 = 'PF Items';
$setup3_pointposttype_pt4 = $this->PFSAIssetControl('setup3_pointposttype_pt4', '', 'Item Types');
$setup3_pointposttype_pt4s = $this->PFSAIssetControl('setup3_pointposttype_pt4s', '', 'Item Type');
$setup3_pointposttype_pt4p = $this->PFSAIssetControl('setup3_pointposttype_pt4p', '', 'types');
// $setup3_pointposttype_pt5 = $this->PFSAIssetControl('setup3_pointposttype_pt5', '', 'Locations');
$setup3_pointposttype_pt5 = 'Locations';
// $setup3_pointposttype_pt5s = $this->PFSAIssetControl('setup3_pointposttype_pt5s', '', 'Location');
$setup3_pointposttype_pt5s = 'Location';
// $setup3_pointposttype_pt5p = $this->PFSAIssetControl('setup3_pointposttype_pt5p', '', 'area');
$setup3_pointposttype_pt5p = 'area';
// $setup3_pointposttype_pt6 = $this->PFSAIssetControl('setup3_pointposttype_pt6', '', 'Features');
$setup3_pointposttype_pt6 = 'Features';
// $setup3_pointposttype_pt6s = $this->PFSAIssetControl('setup3_pointposttype_pt6s', '', 'Feature');
$setup3_pointposttype_pt6s = 'Feature';
// $setup3_pointposttype_pt6p = $this->PFSAIssetControl('setup3_pointposttype_pt6p', '', 'feature');
$setup3_pointposttype_pt6p = 'feature';
// $setup3_pointposttype_pt7 = $this->PFSAIssetControl('setup3_pointposttype_pt7', '', 'Listing Types');
$setup3_pointposttype_pt7 = 'Listing Types';
// $setup3_pointposttype_pt7s = $this->PFSAIssetControl('setup3_pointposttype_pt7s', '', 'Listing Type');
$setup3_pointposttype_pt7s = 'Listing Type';
$setup3_pointposttype_pt7p = $this->PFSAIssetControl('setup3_pointposttype_pt7p', '', 'listing');
$setup3_pointposttype_pt7p = 'listing';
$setup3_pointposttype_pt9 = $this->PFSAIssetControl('setup3_pointposttype_pt9', '', 'PF Agent');
$setup3_pointposttype_pt10 = $this->PFSAIssetControl('setup3_pointposttype_pt10', '', 'PF Agents');
$setup3_pointposttype_pt11 = $this->PFSAIssetControl('setup3_pointposttype_pt11', '', 'testimonials');
$setup3_pointposttype_pt12 = $this->PFSAIssetControl('setup3_pointposttype_pt12', '', 'PF Testimonials');
$setup3_pointposttype_pt13 = $this->PFSAIssetControl('setup3_pointposttype_pt13', '', 'Testimonial');
// $setup3_pt14 = $this->PFSAIssetControl('setup3_pt14', '', 'Conditions');
$setup3_pt14 = 'Conditions';
// $setup3_pt14s = $this->PFSAIssetControl('setup3_pt14s', '', 'Condition');
$setup3_pt14s = 'Condition';
// $setup3_pt14p = $this->PFSAIssetControl('setup3_pt14p', '', 'condition');
$setup3_pt14p = 'condition';
$setup3_pt14_check = $this->PFSAIssetControl('setup3_pt14_check', '', '0');
$setup3_pointposttype_pt4_check = $this->PFSAIssetControl('setup3_pointposttype_pt4_check', '', '1');
$setup3_pointposttype_pt5_check = $this->PFSAIssetControl('setup3_pointposttype_pt5_check', '', '1');
$setup3_pointposttype_pt6_check = $this->PFSAIssetControl('setup3_pointposttype_pt6_check', '', '1');
$setup3_pointposttype_pt6_status = $this->PFSAIssetControl('setup3_pointposttype_pt6_status', '', '1');
$setup4_membersettings_loginregister = $this->PFSAIssetControl('setup4_membersettings_loginregister', '', '1');
$setup4_membersettings_frontend = $this->PFSAIssetControl('setup4_membersettings_frontend', '', '1');
$setup4_membersettings_paymentsystem = $this->PFSAIssetControl('setup4_membersettings_paymentsystem', '', '1');
register_post_type('' . $this->post_type_name . '', array(
'labels' => array(
'name' => '' . $setup3_pointposttype_pt3 . '',
'singular_name' => '' . $setup3_pointposttype_pt2 . '',
'add_new' => wp_sprintf(esc_html__('Add New %s', 'pointfindercoreelements') , $setup3_pointposttype_pt2) ,
'add_new_item' => wp_sprintf(esc_html__('Add New %s', 'pointfindercoreelements') , $setup3_pointposttype_pt2) ,
'edit' => esc_html__('Edit', 'pointfindercoreelements') ,
'edit_item' => wp_sprintf(esc_html__('Edit %s', 'pointfindercoreelements') , $setup3_pointposttype_pt2) ,
'new_item' => wp_sprintf(esc_html__('New %s', 'pointfindercoreelements') , $setup3_pointposttype_pt2) ,
'view' => wp_sprintf(esc_html__('View %s', 'pointfindercoreelements') , $setup3_pointposttype_pt2) ,
'view_item' => wp_sprintf(esc_html__('View %s', 'pointfindercoreelements') , $setup3_pointposttype_pt2) ,
'search_items' => wp_sprintf(esc_html__('Search %s', 'pointfindercoreelements') , $setup3_pointposttype_pt3) ,
'not_found' => wp_sprintf(esc_html__('No %s found', 'pointfindercoreelements') , $setup3_pointposttype_pt2) ,
'not_found_in_trash' => wp_sprintf(esc_html__('No %s found in Trash', 'pointfindercoreelements') , $setup3_pointposttype_pt2) ,
) ,
'public' => true,
'menu_position' => 202,
'menu_icon' => 'dashicons-location-alt',
'hierarchical' => true,
'show_tagcloud' => false,
'has_archive' => true,
'supports' => array(
'title',
'editor',
'thumbnail',
'excerpt',
'page-attributes',
'tags',
) ,
'can_export' => true,
'taxonomies' => array(
'post_tag',
) ,
'show_in_rest' => false,
));
$labels = array(
'name' => '' . $setup3_pointposttype_pt7 . '',
'singular_name' => '' . $setup3_pointposttype_pt7s . '',
'search_items' => wp_sprintf(esc_html__('Search %s', 'pointfindercoreelements') , $setup3_pointposttype_pt7) ,
'popular_items' => wp_sprintf(esc_html__('Popular %s', 'pointfindercoreelements') , $setup3_pointposttype_pt7) ,
'all_items' => wp_sprintf(esc_html__('All %s', 'pointfindercoreelements') , $setup3_pointposttype_pt7) ,
'parent_item' => null,
'parent_item_colon' => null,
'edit_item' => wp_sprintf(esc_html__('Edit %s', 'pointfindercoreelements') , $setup3_pointposttype_pt7s) ,
'update_item' => wp_sprintf(esc_html__('Update %s', 'pointfindercoreelements') , $setup3_pointposttype_pt7s) ,
'add_new_item' => wp_sprintf(esc_html__('Add New %s', 'pointfindercoreelements') , $setup3_pointposttype_pt7s) ,
'new_item_name' => wp_sprintf(esc_html__('New %s', 'pointfindercoreelements') , $setup3_pointposttype_pt7s) ,
'separate_items_with_commas' => wp_sprintf(esc_html__('Separate %s with commas', 'pointfindercoreelements') , $setup3_pointposttype_pt7) ,
'add_or_remove_items' => wp_sprintf(esc_html__('Add or remove %s', 'pointfindercoreelements') , $setup3_pointposttype_pt7s) ,
'choose_from_most_used' => wp_sprintf(esc_html__('Choose from the most used %s', 'pointfindercoreelements') , $setup3_pointposttype_pt7s) ,
'menu_name' => '' . $setup3_pointposttype_pt7 . '',
);
register_taxonomy('pointfinderltypes', '' . $this->post_type_name . '', array(
'hierarchical' => true,
'labels' => $labels,
'show_ui' => true,
'show_admin_column' => true,
'show_in_nav_menus' => true,
'update_count_callback' => '_update_post_term_count',
'query_var' => true,
'rewrite' => array(
'slug' => $setup3_pointposttype_pt7p,
'hierarchical' => true,
) ,
'sort' => true,
'show_in_rest' => false,
));
// if ($setup3_pointposttype_pt5_check == 1) {
$labels = array(
'name' => '' . $setup3_pointposttype_pt5 . '',
'singular_name' => '' . $setup3_pointposttype_pt5 . '',
'search_items' => wp_sprintf(esc_html__('Search %s', 'pointfindercoreelements') , $setup3_pointposttype_pt5) ,
'popular_items' => wp_sprintf(esc_html__('Popular %s', 'pointfindercoreelements') , $setup3_pointposttype_pt5) ,
'all_items' => wp_sprintf(esc_html__('All %s', 'pointfindercoreelements') , $setup3_pointposttype_pt5) ,
'parent_item' => null,
'parent_item_colon' => null,
'edit_item' => wp_sprintf(esc_html__('Edit %s', 'pointfindercoreelements') , $setup3_pointposttype_pt5s) ,
'update_item' => wp_sprintf(esc_html__('Update %s', 'pointfindercoreelements') , $setup3_pointposttype_pt5s) ,
'add_new_item' => wp_sprintf(esc_html__('Add New %s', 'pointfindercoreelements') , $setup3_pointposttype_pt5s) ,
'new_item_name' => wp_sprintf(esc_html__('New %s', 'pointfindercoreelements') , $setup3_pointposttype_pt5s) ,
'separate_items_with_commas' => wp_sprintf(esc_html__('Separate %s with commas', 'pointfindercoreelements') , $setup3_pointposttype_pt5) ,
'add_or_remove_items' => wp_sprintf(esc_html__('Add or remove %s', 'pointfindercoreelements') , $setup3_pointposttype_pt5s) ,
'choose_from_most_used' => wp_sprintf(esc_html__('Choose from the most used %s', 'pointfindercoreelements') , $setup3_pointposttype_pt5s) ,
'menu_name' => '' . $setup3_pointposttype_pt5 . '',
);
register_taxonomy('pointfinderlocations', '' . $this->post_type_name . '', array(
'hierarchical' => true,
'labels' => $labels,
'show_ui' => true,
'show_admin_column' => false,
'show_in_nav_menus' => true,
'update_count_callback' => '_update_post_term_count',
'query_var' => true,
'rewrite' => array(
'slug' => $setup3_pointposttype_pt5p,
'hierarchical' => true
) ,
'show_in_rest' => false,
));
// }
// if ($setup3_pointposttype_pt6_check == 1) {
$labels = array(
'name' => '' . $setup3_pointposttype_pt6 . '',
'singular_name' => '' . $setup3_pointposttype_pt6 . '',
'search_items' => wp_sprintf(esc_html__('Search %s', 'pointfindercoreelements') , $setup3_pointposttype_pt6) ,
'popular_items' => wp_sprintf(esc_html__('Popular %s', 'pointfindercoreelements') , $setup3_pointposttype_pt6) ,
'all_items' => wp_sprintf(esc_html__('All %s', 'pointfindercoreelements') , $setup3_pointposttype_pt6) ,
'parent_item' => null,
'parent_item_colon' => null,
'edit_item' => wp_sprintf(esc_html__('Edit %s', 'pointfindercoreelements') , $setup3_pointposttype_pt6s) ,
'update_item' => wp_sprintf(esc_html__('Update %s', 'pointfindercoreelements') , $setup3_pointposttype_pt6s) ,
'add_new_item' => wp_sprintf(esc_html__('Add New %s', 'pointfindercoreelements') , $setup3_pointposttype_pt6s) ,
'new_item_name' => wp_sprintf(esc_html__('New %s', 'pointfindercoreelements') , $setup3_pointposttype_pt6s) ,
'separate_items_with_commas' => wp_sprintf(esc_html__('Separate %s with commas', 'pointfindercoreelements') , $setup3_pointposttype_pt6) ,
'add_or_remove_items' => wp_sprintf(esc_html__('Add or remove %s', 'pointfindercoreelements') , $setup3_pointposttype_pt6s) ,
'choose_from_most_used' => wp_sprintf(esc_html__('Choose from the most used %s', 'pointfindercoreelements') , $setup3_pointposttype_pt6s) ,
'menu_name' => '' . $setup3_pointposttype_pt6 . '',
);
register_taxonomy('pointfinderfeatures', '' . $this->post_type_name . '', array(
'hierarchical' => true,
'labels' => $labels,
'show_ui' => true,
'show_admin_column' => false,
'show_in_nav_menus' => true,
'update_count_callback' => '_update_post_term_count',
'query_var' => true,
'rewrite' => array(
'slug' => $setup3_pointposttype_pt6p,
'hierarchical' => true
) ,
'show_in_rest' => false,
));
// }
// if ($setup3_pt14_check == 1) {
$labels = array(
'name' => '' . $setup3_pt14 . '',
'singular_name' => '' . $setup3_pt14 . '',
'search_items' => wp_sprintf(esc_html__('Search %s', 'pointfindercoreelements') , $setup3_pt14) ,
'popular_items' => wp_sprintf(esc_html__('Popular %s', 'pointfindercoreelements') , $setup3_pt14) ,
'all_items' => wp_sprintf(esc_html__('All %s', 'pointfindercoreelements') , $setup3_pt14) ,
'parent_item' => null,
'parent_item_colon' => null,
'edit_item' => wp_sprintf(esc_html__('Edit %s', 'pointfindercoreelements') , $setup3_pt14s) ,
'update_item' => wp_sprintf(esc_html__('Update %s', 'pointfindercoreelements') , $setup3_pt14s) ,
'add_new_item' => wp_sprintf(esc_html__('Add New %s', 'pointfindercoreelements') , $setup3_pt14s) ,
'new_item_name' => wp_sprintf(esc_html__('New %s', 'pointfindercoreelements') , $setup3_pt14s) ,
'separate_items_with_commas' => wp_sprintf(esc_html__('Separate %s with commas', 'pointfindercoreelements') , $setup3_pt14) ,
'add_or_remove_items' => wp_sprintf(esc_html__('Add or remove %s', 'pointfindercoreelements') , $setup3_pt14s) ,
'choose_from_most_used' => wp_sprintf(esc_html__('Choose from the most used %s', 'pointfindercoreelements') , $setup3_pt14s) ,
'menu_name' => '' . $setup3_pt14 . '',
);
register_taxonomy('pointfinderconditions', '' . $this->post_type_name . '', array(
'hierarchical' => true,
'labels' => $labels,
'show_ui' => true,
'show_admin_column' => false,
'show_in_nav_menus' => true,
'update_count_callback' => '_update_post_term_count',
'query_var' => true,
'rewrite' => array(
'slug' => $setup3_pt14p,
'hierarchical' => true
) ,
'show_in_rest' => false,
));
// }
}
}
C:\xampp\htdocs\reset\wp-content\themes\twentyseventeen\coreelements.php
<?php
class Coreelements {
use OptionFunctions;
protected $loader;
protected $version;
private $post_type_name;
private $agent_post_type_name;
public function __construct() {
$this->version = '1.0.0';
$this->plugin_name = 'pointfindercoreelements';
$this->post_type_name = $this->GetPostTypeName();
$this->agent_post_type_name = $this->GetAgentPostTypeName();
$this->load_dependencies();
$this->define_public_hooks();
$this->define_admin_hooks();
$this->define_ajax_hooks();
}
private function GetAgentPostTypeName(){
return 'agents';
// return $this->PFSAIssetControl("setup3_pointposttype_pt8","","agents");
}
private function GetPostTypeName(){
return 'listing';
// return $this->PFSAIssetControl("setup3_pointposttype_pt1","","pfitemfinder");
}
private function load_dependencies() {
require_once PFCOREELEMENTSDIR . '/pfgetsearchfields.php';
if (function_exists('vc_set_shortcodes_templates_dir')) {
require_once PFCOREELEMENTSDIR . '/includes/pf-search.php';
}
require_once PFCOREELEMENTSDIR . '/traits/listing-metabox.php';
require_once PFCOREELEMENTSDIR . '/coreelements-loader.php';
require_once PFCOREELEMENTSDIR . '/coreelements-admin.php';
require_once PFCOREELEMENTSDIR . '/coreelements-public.php';
require_once PFCOREELEMENTSDIR . '/coreelements-ajax.php';
require_once PFCOREELEMENTSDIR . '/autocomplete.php';
require_once PFCOREELEMENTSDIR . '/includes/meta-box.php';
require_once PFCOREELEMENTSDIR . '/coreelements-dashboard-page.php';
$this->loader = new Coreelements_Loader();
}
private function define_public_hooks() {
$plugin_public = new Coreelements_Public();
$this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles_scripts');
$plugin_dashboardpage = new DashboardPageClass();
$this->loader->add_action('dashboardpage_hook', $plugin_dashboardpage, 'dashpage_maindash');
}
private function define_ajax_hooks() {
$AutoCMPLT = new AutoCMPLT();
$this->loader->add_action('PF_AJAX_HANDLER_pfget_autocomplete', $AutoCMPLT, 'pf_ajax_autocomplete');
$this->loader->add_action('PF_AJAX_HANDLER_nopriv_pfget_autocomplete', $AutoCMPLT, 'pf_ajax_autocomplete');
}
private function define_admin_hooks() {
$plugin_admin = new Coreelements_Admin($this->get_plugin_name(), $this->get_version(), $this->post_type_name, $this->agent_post_type_name);
$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles_scripts' );
$this->loader->add_action( 'init', $plugin_admin, 'create_post_type',0 );
}
public function get_plugin_name() {
return $this->plugin_name;
}
public function get_version() {
return $this->version;
}
public function run() {
$this->loader->run();
}
}
?>