moved css from site to plugin

This commit is contained in:
asus
2024-03-31 20:53:26 +02:00
parent 5d4be76102
commit 0a30bca907
7 changed files with 21 additions and 29 deletions

View File

@@ -48,7 +48,6 @@ include_once(Plgntls::root_path() . 'php/partners_register.php');
include_once(Plgntls::root_path() . 'php/partners_page.php'); include_once(Plgntls::root_path() . 'php/partners_page.php');
include_once(Plgntls::root_path() . 'php/display_css.php'); include_once(Plgntls::root_path() . 'php/display_css.php');
include_once(Plgntls::root_path() . 'php/payments.php'); include_once(Plgntls::root_path() . 'php/payments.php');
include_once(Plgntls::root_path() . 'php/email_registration.php');
include_once(Plgntls::root_path() . 'php/random_posts.php'); include_once(Plgntls::root_path() . 'php/random_posts.php');

View File

@@ -0,0 +1,3 @@
[class*='cipf_display_'] {
display: none !important;
}

View File

@@ -1,3 +1,3 @@
div.partenaire_propre_page_cipf { .partenaire_propre_page_cipf {
display: block; display: none;
} }

View File

@@ -0,0 +1,3 @@
div.partenaire_propre_page_cipf {
display: block;
}

View File

@@ -14,6 +14,7 @@ if (!defined('ABSPATH')) {
function display_page_css_CIPF($user_id = null) { function display_page_css_CIPF($user_id = null) {
Plgntls::debug_infos(); Plgntls::debug_infos();
$css_for_states = array(); $css_for_states = array();
Plgntls::add_to_front(array('css/display_states/_default.css'));
/* /*
* etat paiement * etat paiement

View File

@@ -1,20 +0,0 @@
<?php
/*
* it means someone outside wp is accessing the file, in this case kill it.
*/
if (!defined('ABSPATH')) {
die('You can not access this file!');
}
?>

View File

@@ -19,12 +19,18 @@ if (!defined('ABSPATH')) {
function partner_page_scripts_CIPF() { function partner_page_scripts_CIPF() {
Plgntls::debug_infos(2); Plgntls::debug_infos(2);
$role_partner = Plgntls::ROLE_PARTNER; $role_partner = Plgntls::ROLE_PARTNER;
if (!is_single()) {
return;
}
/* /*
* dont do anything if : * if on post, load css to hide partner own stuff
* - user not logged in *
* - user no partner */
* - partner not author of the page Plgntls::add_to_front(array('css/partner_page.css'));
/*
* then check if is partner own page
* *
*/ */
if (!is_user_logged_in()) { if (!is_user_logged_in()) {
@@ -45,10 +51,10 @@ function partner_page_scripts_CIPF() {
} }
/* /*
* on partner own page, load css * on partner own page, load css to show own stuff
* *
*/ */
Plgntls::add_to_front(array('css/partner_page.css')); Plgntls::add_to_front(array('css/partner_page_own.css'));
} }
add_action('wp_enqueue_scripts', 'partner_page_scripts_CIPF', 11); add_action('wp_enqueue_scripts', 'partner_page_scripts_CIPF', 11);