Support » Plugins and Hacks » [Resolved] Bug in 'menu updated' add_action line

[Resolved] Bug in 'menu updated' add_action line

Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Author webheadllc


    Thank you! and sorry for the inconvenience. The fix is in version 0.4 which should be out now.

    Thank you for quick fix.

    Another small suggestion to make the plugin even better, add a callback action so 3rd party code can hook into the process and know when the cache was cleared and if it was via button or menu update or widget update.

    Something like this at the end of function ccfm_clear_cache_for_me():

    do_action( 'ccfm_clear_cache_for_me', 'arg' );

    Where ‘arg’ would be ‘button’ or ‘menu’ or ‘widgets’ or similar.

    Then 3rd party code could deal with that in functions.php or similar.

    function ov3rfly_cache_cleared( $arg ) {
    	switch ( $arg ) {
    add_action( 'ccfm_clear_cache_for_me', 'ov3rfly_cache_cleared' );

    The feature would require a few small changes, e.g. adding an arg to ccfm_clear_cache_for_me() and an extra function for wp_update_nav_menu action hook…

    This would be great.

    Thanks for the great plugin.

    And here a small update 0.4.1, with do_action( 'ccfm_clear_cache_for_me' .. ) stub and enhanced for translation, with ccfm.pot file and german language files:

    (link valid 14 days from today)

    @webheadllc: Feel free to use the code and files as you like.

    Plugin Author webheadllc


    Sounds easy enough. hooks for 3rd parties have been added and german language added in version 0.5.


    Thank you for quick update.

    Background for the $source request: Have some rewrite rules with own query_vars which show custom database data on a page like example.com/page/myvar1/myvar2/ and these “sub”-pages get cached fine in W3 Total Cache but are not flushed if the “Empty Cache” option is used. Now with your button and the new hook, it is possible to flush also these “sub”-pages (I just do a glob/unlink/rmdir with the relevant files/folders from the page-cache folder of W3TC).

    Noted the missing security against CSRF in 0.4 after my post yesterday and added wp_nonce_field and check_admin_referer to the forms which use both post now. Also fixed the html a bit, moved <p> into <form>. Also added an optional infotext above the button (as asked for by my client).

    (link valid 14 days from today)

    Edit: An esc_attr() could be added to infotext input or a better handling of " etc. chars in infotext.

    Again, feel free to use the code and files as you like.

    Another small update, now using stripslashes() for the infotext and allowing html, why not trust the admin here.

    Also rearranged the code within ccfm_dashboard_widget_output() a bit so only one check for manage_options is required.

    (link valid 14 days from today)

    Plugin Author webheadllc


    Thanks i’ll put this in as soon as i have a chance to test it.

    Another note, instead of stripslashes() better use wp_unslash() to clean the the infotext.

    Plugin Author webheadllc


    Thanks again.

    I’ll be updating the plugin today. I changed the label for the infotext field. It will show as “Instructions to show above button (optional):”. If you have time to update the german that would be nice. if not that’s ok.

    Plugin Author webheadllc


    oh, and also added “Settings” as a header.

    Thanks, here the new language files:
    (link valid 2 days from today)

    These new strings were added:

    “Instructions to show above button (optional):”
    -> “Kurzanleitung oberhalb des Buttons (optional):”

    -> “Einstellungen”

    Plugin Author webheadllc


    updates should be in version 0.6. Thank you for all your help!

    No problem, did the changes for a client anyway.

    0.6 works fine so far, good idea to also catch theme customizing.

    Found/added two more changed strings which were different since 0.5.x or not translated yet. Also updated the html a bit with some css to match the general look&feel of WordPress, see included screenshots before/after. Removed the label from the infotext, as submit buttons should not have clickable labels.

    Feel free to use the code for a future release.

    (link valid 14 days from today)

    Plugin Author webheadllc


    Thanks. Added all your changes in 0.6.1.

    0.6.1 works fine.

    For a future relase you could use above posted 0.6.2, some css-class naming is “ccfm” instead “ccf” there now and a margin-bottom has been added to h4 “Settings” headline. No need to do a release now as the changes are purely cosmetic…

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘[Resolved] Bug in 'menu updated' add_action line’ is closed to new replies.