latex_render

The Jetpack by WordPress.com latex render function.

Description

latex_render( $latex, $fg, $bg, (int) $s = 0 ); 

Parameters (4)

0. $latex
The latex.
1. $fg
The fg.
2. $bg
The bg.
3. $s — Optional. (int)
The s.

Usage

  1. if ( !function_exists( 'latex_render' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'jetpack-by-wordpress-com/modules/latex.php'; 
  3.  
  4. // The latex. 
  5. $latex = null; 
  6.  
  7. // The fg. 
  8. $fg = null; 
  9.  
  10. // The bg. 
  11. $bg = null; 
  12.  
  13. // The s. 
  14. $s = -1; 
  15.  
  16. // NOTICE! Understand what this does before running. 
  17. $result = latex_render($latex, $fg, $bg, $s); 
  18.  

Defined (1)

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

/modules/latex.php  
  1. function latex_render( $latex, $fg, $bg, $s = 0 ) { 
  2. $url = "//s0.wp.com/latex.php?latex=" . urlencode( $latex ) . "&bg=" . $bg . "&fg=" . $fg . "&s=" . $s; 
  3. $url = esc_url( $url ); 
  4. $alt = str_replace( '\\', '\', esc_attr( $latex ) ); 
  5.  
  6. return '<img src="' . $url . '" alt="' . $alt . '" title="' . $alt . '" class="latex" />';