• As the only way to add a rel attribute to links is to switch to the text editor, I’ve made a little change in js/wpp-active.js in the plugin, to enable activation of prettyPhoto via class attribute also:

    jQuery(document).ready(function(){
    	jQuery("a[rel^='prettyPhoto'], a.prettyPhoto").prettyPhoto();
    });

    This way we can even add a “prettyPhoto” class to the tinyMce class selector and make the “prettified link operation” simple for every user.

    add_filter('tiny_mce_before_init', 'myCustomTinyMCE' );
    /* Custom CSS styles on TinyMCE Editor */
    if ( ! function_exists( 'myCustomTinyMCE' ) ) {
    	function myCustomTinyMCE($init) {
    		//$init['theme_advanced_styles'] = 'In evidenza=evidenced; Bottone Verde=verde';
    		$init['theme_advanced_styles'] = 'prettyPhoto=prettyPhoto';
    		return $init;
    	}
    }

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

  • The topic ‘use class instead of rel attribute’ is closed to new replies.