• Good afternoon, im kind of new to wordpress plugin making, so this is probably a dumb question.

    I’m working on a plugin that is basically a shortcode for image effects. The problem is that each image might have different effects… for example

    [imgeffect src=”image.png” effect=”1″]
    [imgeffect src=”image2.png” effect=”2″]
    etc.

    I already got the plugin to give each image a random class, and to include the jquery plugins to give the effect to these images. Sadly, I cant seem to send ‘class’ and ‘effect’ parameters to the function i built to add the on-ready javascript code… i need it to call the plugin using $(‘.class’).plugin();

    Sorry about my english, if you need me to explain myself better let me know.

    Regards,
    Bruno Q.

Viewing 1 replies (of 1 total)
  • Thread Starter Fusiondevs

    (@fusiondevs)

    Just because i forgot,… i have something like this:

    function print_effect_script($img_class, $effect) {
    	echo '<script language="javascript" type="text/javascript">';
    	echo "
    		$(documment).ready(function() {
    			$('.".$img_class."').script({offset: ".$effect."});
    		});
    	";
    	echo '</script>';
    }
    add_action('wp_head', 'print_effect_script' );

    My only problem is… how do i send ‘img_class’ and ‘effect’ params to the function?

Viewing 1 replies (of 1 total)
  • The topic ‘Giving parameters to a function called through wp_head?’ is closed to new replies.