WordPress.org

Ready to get started?Download WordPress

Forums

Transposh WordPress Translation
Transposh Pugin Callbacks (5 posts)

  1. andruhapx
    Member
    Posted 1 year ago #

    Can you please add do_action into Parser->fix_html() at function start and end
    do_action('transposh_fix_html_start') and do_action('transposh_fix_html_end')

    and add do_action into transposh_plugin->process_page:

    do_action('transposh_process_page_start');
    $buffer = $parse->fix_html($buffer);
    do_action('transposh_process_page_end');

    http://wordpress.org/extend/plugins/transposh-translation-filter-for-wordpress/

  2. Ofer Wald
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    Would appreciate the reasoning for this.

    And in the parser, probably not, because this is designed to be "wordpress free" but the process changes are fine, but do explain.

    Best

  3. andruhapx
    Member
    Posted 1 year ago #

    Its ok to leave only 'process_page' callback
    I just need to change error reporting level for parse->fix_html, because our server has old Centos version, admin cant update php here. And in old php version there is bug with warning suppressing using @

    Actually you can use apply_filter here and pass parser instance here, so it will be possible to change its parameters. And then use apply_filter to modify $buffer.

    $parse->change_parsing_rules(...)
    $parse = apply_filter('transposh_process_page_start',..., $parse)
    $buffer = $parse->fix_html($buffer);
    $buffer = apply_filter('transposh_process_page_end',..., $buffer)
  4. Ofer Wald
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    I will think about it, I am not sure this will prove really useful in most cases, and regarding those warnings, I'm adding those suppressions.

    Also, please make the case for the filter, why would one want to change the parameters? and what would she do with the results?

  5. andruhapx
    Member
    Posted 1 year ago #

    Hi, thanks for response

    First filter may be needed to use different parsing settings for some post types or even different pages.
    Second filter can be used to fix some translation errors etc.
    Plugin is very popupal and it will be very useful for developers to have some way to modify plugin input/output

    There are all required suppressions in plugin, but we just have old centos 5 server with old php version with warning suppression bug https://bugs.php.net/bug.php?id=39018,
    but hope we will update our server soon

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic