Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author dFactory

    (@dfactory)

    There are to hooks:

    cn_cookie_notice_args() for modifying the notice parameters.

    and

    cn_cookie_notice_output() for modifying the html output.

    In the second case you can use the str_replace or preg_replace PHP functions.

    Thread Starter differentC@rl

    (@differentcrl)

    Thank you!

    A little help (not the best with hooks/filters).

    I have this

    add_filter( 'cn_cookie_notice_output', 'cookie_hook_output' );
    
        function cookie_hook_output (  $options ) {
    
        $output = '
                <div id="cookie-notice" class="cn-'.($options['position']).($options['css_style'] !== 'none' ? ' '.$options['css_style'] : '').'" style="color: '.$options['colors']['text'].'; background-color: '.$options['colors']['bar'].';">'
                    .'<div class="cookie-notice-container2">'
                    .$options['message_text']
                    .'<a href="" id="cn-accept-cookie" class="button'.($options['css_style'] !== 'none' ? ' '.$options['css_style'] : '').'">'.$options['accept_text'].'</a>'
                    .($options['see_more'] === 'yes' ? '<a href="'.($options['see_more_opt']['link_type'] === 'custom' ? $options['see_more_opt']['link'] : get_permalink($options['see_more_opt']['id'])).'" target="_blank" class="button'.($options['css_style'] !== 'none' ? ' '.$options['css_style'] : '').'">'.$options['see_more_opt']['text'].'</a>' : '').'
                    </div>
                </div>';
    
                return $output;
            }

    It is out putting html but not $options data.

    Thanks in advance

    Plugin Author dFactory

    (@dfactory)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Hook into output’ is closed to new replies.