WordPress.org

Ready to get started?Download WordPress

Forums

Better WordPress Minify
[resolved] Simple question (10 posts)

  1. JibsouX
    Member
    Posted 1 year ago #

    Hellow i wonder what does exactly the box minify script alone of the rest

    sorry i have a french version so in french it's : Scripts à minifier et à imprimer séparemment

    the second box option

    because i have jquery in it and i just want to put the setting directly in wordpres core and not in bwp minify option ^^

    http://wordpress.org/extend/plugins/bwp-minify/

  2. Khang Minh
    Member
    Plugin Author

    Posted 1 year ago #

    If you put file3 in that box, for example, you might have this:

    - Instead of:

    http://domain.com/min/?f=file1.js,file2.js,file3.js

    - you will get these two:

    http://domain.com/min/?f=file1.js,file2.js
    http://domain.com/min/?f=file3.js (separately printed out)

  3. JibsouX
    Member
    Posted 1 year ago #

    Thanks i understand that sorry by asking : 'what does exactly the box minify script alone of the rest' i mean what in the code is realy do to actualy inser the script alone ..
    like a priority : add_action( $tag, $function_to_add, $priority,$accepted_args );

    mmh i just want to put jquery alone but always alone and with no setting in option box i want to write dirrectly the setting instead of put jquery in the option box

    you know what i mean ?

    no box option setting but natif setting

  4. Khang Minh
    Member
    Plugin Author

    Posted 1 year ago #

    Are you meaning that you want to minify jquery separately, but you don't want to put anything in the option box?

    Please take a look at these hook references:
    http://betterwp.net/wordpress-plugins/bwp-minify/#references

    bwp_minify_script_direct is probably the one you need.

  5. JibsouX
    Member
    Posted 1 year ago #

    Yes that's it but what is the apropriate syntax for bwp_minify_script_direct ?

    Thanks a lot by the way !

  6. Khang Minh
    Member
    Plugin Author

    Posted 1 year ago #

    It's a hook that you can filter, check this out:

    http://codex.wordpress.org/Function_Reference/add_filter

    Remember to return an array :)

  7. JibsouX
    Member
    Posted 1 year ago #

    mmh like that .. ?
    sorry i'm not a boss in php :p

    add_filter('bwp_minify_script_direct', 'exclude_jquery');

    function exclude_jquery($excluded)
    {
    $excluded = array('jquery');
    return $excluded;
    }

  8. Khang Minh
    Member
    Plugin Author

    Posted 1 year ago #

    It's not excluded to be exact, it's 'direct'. jQuery will be minified, but on its own.

    And yes your codes look fine to me.

  9. JibsouX
    Member
    Posted 1 year ago #

    yeah sorry a cmd-c / v / your code that's why i have exclude ^^

    okey in function.php i test :

    add_filter('bwp_minify_script_direct', 'direct_jquery');

    function direct_jquery($direct)
    {
    $direct = array('jquery');
    return $direct;
    }

  10. JibsouX
    Member
    Posted 1 year ago #

    Okey i think it's work perfectly ;) THANKS A LOT DUDE !!!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.