添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
  • Conferences
  • Courses
  • Workshops
  • Churches
  • Non-Profits
  • See All Use Cases
  • Promotions and Discount Codes
  • Events Calendar
  • Stripe Payment Gateway
  • Attendee Mover
  • WordPress User Integration
  • Events Table View Template
  • See All Add-ons
  • Contact Us
  • Quick Start Guide
  • Support Forums
  • Documentation
  • Blog
  • Guides & Strategies
  • Competitor Comparison
  • Videos
  • I added custom CSS with this hook:

    add_action( 'AHEE__EE_Pdf_messenger__enqueue_scripts_styles', function() {
      wp_enqueue_style( 'messages-css', get_template_directory_uri() . '/css/messages.css' );
    

    However, when I view the invoice in HTML, the CSS link appears at the bottom, right after </body>:

    </body> <link rel='stylesheet' id='messages-css-css' href='.../css/messages.css... /> </html>

    This is not a huge problem in HTML, but when I try to download the PDF, DOMPdf generates an error and I’m thrown back to the home page. The problem disappears when I comment this line in class EE_Pdf_messenger, line 302:

    301 protected function _deregister_wp_hooks() {
     302  // remove_all_actions('wp_head'); -> comment this
     303  ...
    

    Any idea?

    (using EE4 4.9.39)

    That particular hook isn’t well suited for overriding CSS. I can recommend using a filter hook instead where you can swap in your custom stylesheet instead of the default one. Example code follows:

    function ee_modify_html_variation( 
      $variation_path, 
      $messenger, 
      $message_type, 
      $type, 
      $variation, 
      $file_extension, 
      $url, 
      EE_Messages_Template_Pack $template_pack 
      if ( $messenger != 'html' ) {
        return $variation_path;
      if ( $message_type != 'invoice' ) {
        return $variation_path;
      if ( $type != 'main' ) {
        return $variation_path;
      $new_url = get_stylesheet_directory_uri() . '/css/messages.css';
      return $new_url;
    add_filter( 
      'FHEE__EE_Messages_Template_Pack__get_variation', 
      'ee_modify_html_variation', 
    
  • Go to Developer Center
  • Need Custom Coding or Custom Development? Hire an Event Espresso Consultant
  • Help Translate Event Espresso
  •