You are here

function image_replace_add in Image Replace 7

Add an image replacement mapping.

Parameters

string $target_style: The target image style name.

string $target_uri: The uri of the image for which to set a replacement.

string $replacement_uri: The replacement uri to set for the given uri/style combination.

2 calls to image_replace_add()
image_replace_field_attach_presave in ./image_replace.module
Implements hook_field_attach_presave().
ReplaceEffectTest::testReplaceEffect in src/Tests/ReplaceEffectTest.php
Tests functionality of the replace image effect.

File

./image_replace.module, line 39
Provides an image style effect replacing the whole image with another one.

Code

function image_replace_add($target_style, $target_uri, $replacement_uri) {
  return db_insert('image_replace')
    ->fields(array(
    'target_style' => $target_style,
    'target_uri' => $target_uri,
    'replacement_uri' => $replacement_uri,
  ))
    ->execute();
}