cptui_products_sidebar

Displays WebDevStudios products in a sidebar on the add/edit screens for post types and taxonomies.

Description

cptui_products_sidebar(); 

We hope you don't mind.


Usage

  1. if ( !function_exists( 'cptui_products_sidebar' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'custom-post-type-ui/inc/utility.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = cptui_products_sidebar(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/inc/utility.php  
  1. function cptui_products_sidebar() { 
  2.  
  3. echo '<div class="wdspromos">'; 
  4.  
  5.  
  6. $ads = cptui_get_ads(); 
  7. if ( ! empty( $ads ) ) { 
  8. foreach ( $ads as $ad ) { 
  9. $the_ad = sprintf( 
  10. '<img src="%s" alt="%s">',  
  11. esc_attr( $ad['image'] ),  
  12. esc_attr( $ad['text'] ) 
  13. ); 
  14.  
  15. // Escaping $the_ad breaks the html. 
  16. printf( 
  17. '<p><a href="%s">%s</a></p>',  
  18. esc_url( $ad['url'] ),  
  19. $the_ad 
  20. ); 
  21. printf( 
  22. '<p><a href="%s">%s</a></p>',  
  23. 'https://pluginize.com/plugins/custom-post-type-ui-extended/ref/pluginizeaff/?campaign=cptui-sidebar-remove',  
  24. esc_html__( 'Remove these ads?', 'custom-post-type-ui' ) 
  25. ); 
  26. echo '</div>'; 
  27.