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

@@ -43,6 +43,7 @@ class Partnerexpo_Core_Public {
add_shortcode( 'partnerexpo_searchbox', [ $this, 'searchbox_shortcode' ] );
add_shortcode( 'partnerexpo_comment_section', [ $this, 'comments_shortcode' ] );
add_shortcode( 'partnerexpo_company_head', [ $this, 'company_head_shortcode' ] );
}
public function searchbox_shortcode() {
@@ -67,6 +68,14 @@ class Partnerexpo_Core_Public {
return ob_get_clean();
}
public function company_head_shortcode() {
wp_enqueue_style( $this->plugin_name . '-company-head-css' );
ob_start();
include plugin_dir_path( __FILE__ ) . 'partials/partnerexpo-core-public-company-head.php';
return ob_get_clean();
}
public function register_endpoint() {
register_rest_route('pexpo/v1', '/query', [
'methods' => 'GET',
@@ -208,6 +217,14 @@ class Partnerexpo_Core_Public {
$this->version,
'all'
);
wp_register_style(
$this->plugin_name . '-company-head-css',
plugin_dir_url( __FILE__ ) . 'css/company-head.css',
[],
$this->version,
'all'
);
}
/**

View File

@@ -0,0 +1,28 @@
.pexpo-core-company-head-wrapper {
display: flex;
align-items: left;
gap: 50px;
margin: 20px;
width: 100%;
}
.pexpo-core-company-head-logo-wrapper {
flex-shrink: 0;
& .pexpo-core-company-logo {
width: max-content;
height: 100px;
object-fit: contain;
}
}
.pexpo-core-company-head-name-wrapper {
flex-grow: 1;
display: flex;
align-items: center;
& .pexpo-core-company-name {
font-size: 2em;
margin: 0;
}
}

View File

@@ -0,0 +1,25 @@
<?php
/**
* Displays company data for the partner offers.
*
* @link https://github.com/Duskell
* @since 1.1.6
*
* @package Partnerexpo_Core
* @subpackage Partnerexpo_Core/public/partials
*/
$logo_id = get_user_meta( get_current_user_id(), 'company_logo_attachment_id', true );
$logo_url = $logo_id ? wp_get_attachment_url( $logo_id ) : '';
?>
<div class="pexpo-core-company-head-wrapper">
<div class="pexpo-core-company-head-logo-wrapper">
<img class="pexpo-core-company-logo" src="<?php echo esc_url( $logo_url ); ?>" alt="<?php echo esc_attr( get_user_meta( get_current_user_id(), 'company', true ) ); ?> logo">
</div>
<div class="pexpo-core-company-head-name-wrapper">
<h2 class="pexpo-core-company-name"><?php echo esc_html( get_user_meta( get_current_user_id(), 'company', true ) ); ?></h2>
</div>
</div>

View File

@@ -1,16 +0,0 @@
<?php
/**
* Provide a public-facing view for the plugin
*
* This file is used to markup the public-facing aspects of the plugin.
*
* @link https://github.com/Duskell
* @since 1.0.0
*
* @package Partnerexpo_Core
* @subpackage Partnerexpo_Core/public/partials
*/
?>
<!-- This file should primarily consist of HTML with a little bit of PHP. -->