• Hi,
    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

    https://www.ads-software.com/extend/plugins/prettyphoto-media/

  • The topic ‘[Plugin: prettyPhoto Media] Enhance the main js function with args’ is closed to new replies.