Ready to get started?Download WordPress


prettyPhoto Media
Enhance the main js function with args (1 post)

  1. Tsun4Ever
    Posted 1 year ago #

    just to share with you guys, i needed to add the callbackchangepicture function available from the original prettyphoto Media inside this plugin as the settings does not allow this for now.
    So i had to hook like this :

    add_action( 'init', 'remove_prettyphoto_footer_script', 100 );
    function remove_prettyphoto_footer_script() {
       // remove the original plugin action
        remove_action( 'wp_footer', 'prettyphoto_footer_script', 100 );
      // add my custom action
        add_action('wp_footer','custom_prettyphoto_footer_script', 100);

    and then my custom function

    function custom_prettyphoto_footer_script() {
        // copy / paste of the orginal function with your own customization
     // customization start here
         $my_new_awesome_callback_function = 'changepicturecallback: function(){ prettyPhotoMedia_attachPrintPreview(); },';
    // where prettyPhotoMedia_attachPrintPreview() is my own js function doing the stuff i need
         $out .= '{ ' . $my_new_awesome_callback_function . implode( ', ', $options_changed ) . ' }';
        echo $out;

    That's it, hope it helps someone some day


Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic