added the WIP company head shortcut and a menu for editing company stuff, instead of the user profile.

This commit is contained in:
2026-03-12 22:05:37 +01:00
parent b6d0959cf6
commit ccfb737949
12 changed files with 222 additions and 94 deletions

View File

@@ -60,21 +60,7 @@ class Partnerexpo_Core_Admin {
* @since 1.0.0
*/
public function enqueue_styles() {
/**
* This function is provided for demonstration purposes only.
*
* An instance of this class should be passed to the run() function
* defined in Partnerexpo_Core_Loader as all of the hooks are defined
* in that particular class.
*
* The Partnerexpo_Core_Loader will then create the relationship
* between the defined hooks and the functions defined in this
* class.
*/
wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/partnerexpo-core-admin.css', array(), $this->version, 'all' );
wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/partnerexpo-core-business-page.css', [], $this->version, 'all' );
}
/**
@@ -83,21 +69,33 @@ class Partnerexpo_Core_Admin {
* @since 1.0.0
*/
public function enqueue_scripts() {
/**
* This function is provided for demonstration purposes only.
*
* An instance of this class should be passed to the run() function
* defined in Partnerexpo_Core_Loader as all of the hooks are defined
* in that particular class.
*
* The Partnerexpo_Core_Loader will then create the relationship
* between the defined hooks and the functions defined in this
* class.
*/
wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/partnerexpo-core-admin.js', array( 'jquery' ), $this->version, false );
wp_enqueue_script( $this->plugin_name . '-business-page', plugin_dir_url( __FILE__ ) . 'js/partnerexpo-core-business-page.js', [ 'jquery' ], $this->version, true );
wp_localize_script(
$this->plugin_name . '-business-page',
'businessData',
[
'post_id' => get_user_meta( get_current_user_id(), 'company_logo_attachment_id', true ),
'title' => esc_html__( 'Céges logó kiválasztása', 'partnerexpo-core' ),
'button' => esc_html__( 'Kép használata', 'partnerexpo-core' ),
]
);
}
public function display_business_data_page() {
include_once plugin_dir_path( __FILE__ ) . 'partials/partnerexpo-core-admin-business.php';
}
public function add_menu() {
add_menu_page(
esc_html__( 'Üzleti adatok', 'partnerexpo-core' ),
esc_html__( 'Üzleti adatok', 'partnerexpo-core' ),
'manage_options',
'pexpo-core-business-data',
[ $this, 'display_business_data_page' ],
'dashicons-businessman',
6
);
}
}