Plugin Author
RazyRx
(@razyrx)
Hello,
You can execute specific function from plugin to create images with watermark or restore default image.
$BeRocket_image_watermark = BeRocket_image_watermark::getInstance();
$BeRocket_image_watermark->add_watermark_to_images($attachment_id, 'create');//create or restore
$attachment_id – is ID of media attachment
Second parameters is action that will be applied for attachment.
create – to add watermark to image
restore – to restore original image and remove backuped images
Regards,
Oleg
Hi @razyrx
I don’t want a function that adds the watermark.
I just want the hooks to be created in your plugin. So we can make it compatible with our plugin.
[ Please do not bump your topic. ]
Plugin Author
RazyRx
(@razyrx)
Hello,
We will add some hooks for generate/restore function in next plugin release.
It will be one hook before action and one hook after action.
Regards,
Oleg
@razyrx please let me know the hooks when it is released
Hi @razyrx ,
We found that you added hooks in the function but it is useful
public function add_watermark_to_images($post_id, $generation = 'create') {
$options = $this->get_option();
$types = $this->convert_image_types();
$upload_dir = wp_upload_dir();
$image_data_class = new BeRocket_attachment_data($post_id);
$image_data = $image_data_class->get_attachment_info();
if( $image_data != FALSE ) {
do_action('brwm_add_watermark_to_images_before_all', $post_id, $generation);
$fullsize_filepath = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . $image_data['relative_path'];
$this->backup_image($fullsize_filepath, 'restore');
Here you added hook after $image_data_class->get_attachment_info() this.
this function has file exist checks, so your action brwm_add_watermark_to_images_before_all is not accessible.
We want a hook above the function, Because, we need to restore the files before your checks.
public function add_watermark_to_images($post_id, $generation = 'create') {
do_action('brwm_add_watermark_to_images_start', $post_id, $generation)
$options = $this->get_option();
$types = $this->convert_image_types();
$upload_dir = wp_upload_dir();
$image_data_class = new BeRocket_attachment_data($post_id);
$image_data = $image_data_class->get_attachment_info();
if( $image_data != FALSE ) {
do_action('brwm_add_watermark_to_images_before_all', $post_id, $generation);
$fullsize_filepath = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . $image_data['relative_path'];
$this->backup_image($fullsize_filepath, 'restore');
Can you please update this. Also add a hook at end Also.
Thank you
Dudlewebs Support
@razyrx Please provide an update on this issue
@razyrx Can you please add this hook on next release. Our support tickets are pending due to this issue. Please provide me an update on this.
Plugin Author
RazyRx
(@razyrx)
Hello,
We will add hook exactly as you suggested in next plugin release
hook in
do_action('brwm_add_watermark_to_images_start', $post_id, $generation);
And also another hook in the end
do_action('brwm_add_watermark_to_images_end', $post_id, $generation);
Regards,
Oleg