Skip to content

Commit

Permalink
Merge pull request #5 from danieliser/patch/1
Browse files Browse the repository at this point in the history
Fix invalid function hook
  • Loading branch information
danieliser authored Aug 5, 2024
2 parents 52f72d7 + 50537e4 commit 8e06ce4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
23 changes: 0 additions & 23 deletions inc/globals.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,26 +62,3 @@ function edd_watermark_repeater_callback( $args ) {

\EDDFileWatermarking\render_watermark_table( $watermarks, $name = 'edd_settings[' . esc_attr( $args['id'] ) . ']' );
}

/**
* Sanitize the watermark repeater.
*
* @param array $value The value.
* @param string $key The key.
*
* @return array The sanitized value.
*/
function sanitize_watermark_repeater_settings( $value, $key ) {
if ( ! isset( $value ) ) {
return $value;
}

if ( is_array( $value ) && ! empty( $value ) && is_array( $value[0] ) && isset( $value[0]['type'] ) ) {
// This is already processed value, must be sanitizing before rendering ?
return $value;
}

$value = \EDDFileWatermarking\remap_watermark_repeater_values( $value );

return \EDDFileWatermarking\sanitize_watermark_repeater( $value );
}
23 changes: 23 additions & 0 deletions inc/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,29 @@ function sanitize_watermark_repeater( $value ) {
return $new_input;
}

/**
* Sanitize the watermark repeater.
*
* @param array $value The value.
* @param string $key The key.
*
* @return array The sanitized value.
*/
function sanitize_watermark_repeater_settings( $value, $key ) {
if ( ! isset( $value ) ) {
return $value;
}

if ( is_array( $value ) && ! empty( $value ) && is_array( $value[0] ) && isset( $value[0]['type'] ) ) {
// This is already processed value, must be sanitizing before rendering ?
return $value;
}

$value = remap_watermark_repeater_values( $value );

return sanitize_watermark_repeater( $value );
}

/**
* Remap the watermark repeater values.
*
Expand Down

0 comments on commit 8e06ce4

Please sign in to comment.