You are here

function minifyhtml_placeholder_replace in Minify Source HTML 7

Helper function to add tag key and value for further replacement.

Parameters

string $content: String before the placeholder replacement.

Return value

string The placeholder string.

5 calls to minifyhtml_placeholder_replace()
minifyhtml_placeholder_callback_iframe in ./minifyhtml.module
Helper function to add place holder for <iframe> tag.
minifyhtml_placeholder_callback_pre in ./minifyhtml.module
Helper function to add place holder for <pre> tag.
minifyhtml_placeholder_callback_script in ./minifyhtml.module
Helper function to add place holder for <script> tag.
minifyhtml_placeholder_callback_style in ./minifyhtml.module
Helper function to add place holder for <style> tag.
minifyhtml_placeholder_callback_textarea in ./minifyhtml.module
Helper function to add place holder for <textarea> tag.

File

./minifyhtml.module, line 336
Hook and helper functions for the Minify HTML module.

Code

function minifyhtml_placeholder_replace($content) {
  global $_minifyhtml_placeholders;

  // PHP 7.2 fix, if the variable is not set count() will emit a warning.
  if (!isset($_minifyhtml_placeholders)) {
    $_minifyhtml_placeholders = array();
  }
  $placeholder = '%' . MINIFYHTML_PLACEHOLDER . count($_minifyhtml_placeholders) . '%';
  $_minifyhtml_placeholders[$placeholder] = $content;
  return $placeholder;
}