Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow themes and plugins to add their own custom content hooks #40

Closed
herrvigg opened this issue Jun 21, 2018 · 5 comments
Closed

Allow themes and plugins to add their own custom content hooks #40

herrvigg opened this issue Jun 21, 2018 · 5 comments
Labels
legacy PR Legacy PR imported from original repo

Comments

@herrvigg
Copy link
Collaborator

Issue by funkjedi
Wednesday Feb 25, 2015 at 09:00 GMT
Originally opened as qTranslate-Team/qtranslate-x#40


Trigger a custom event when addCustomContentHooks is called to allow themes and plugin developers to add their own custom content hooks.

Usage example:

jQuery(document).on('qTranslateX:addCustomContentHooks', function(event, qtx, form) {

    jQuery('.acf-field-text .acf-input-wrap input').each(function() {
        qtx.addContentHookById(this.id, form);
    });

});

funkjedi included the following code: https://github.com/qTranslate-Team/qtranslate-x/pull/40/commits

@herrvigg
Copy link
Collaborator Author

Comment by johnclause
Wednesday Feb 25, 2015 at 09:23 GMT


Hi Tim, this is an interesting idea - thank you. I am also trying to implement the best possible way to integrate and that is being developed like every day. Have you seen the code of plugins:

https://github.com/qTranslate-Team/woocommerce-qtranslate-x
https://github.com/qTranslate-Team/wp-seo-qtranslate-x
https://github.com/qTranslate-Team/events-made-easy-qtranslate-x

The last one, events-made-easy, is incomplete, but it has the most of comments and explanations, since I was preparing it for the author of Events Made Easy (https://wordpress.org/plugins/events-made-easy/) to finish the code.

The idea is that, eventually, users and plugin authors will be able to submit a custom configuration as an xml or json text or file, which will describe the fields need to be translatable. For now, we code the array needed and submit it through a hook.

I believe you can achieve what you need with already existent hooks, following the pattern of the plugins mentioned above.

Please, take a look and let me know what you think.

@herrvigg herrvigg added the legacy issue Legacy issue imported from original repo label Jun 21, 2018
@herrvigg
Copy link
Collaborator Author

Comment by funkjedi
Wednesday Feb 25, 2015 at 11:39 GMT


Brilliant worked like a charm.

@herrvigg
Copy link
Collaborator Author

Comment by johnclause
Friday Feb 27, 2015 at 03:04 GMT


Hi Tim, were you able to complete all what you need? Which plugin is that? Should I listed it on the Description page as an example of integration?

@herrvigg
Copy link
Collaborator Author

Comment by funkjedi
Friday Feb 27, 2015 at 10:32 GMT


The qtranslate_load_admin_page_config filter did the job splendidly. The plugin's called ACF qTranslate and absolutely feel free to put it as an example.

@herrvigg
Copy link
Collaborator Author

Comment by johnclause
Friday Feb 27, 2015 at 18:09 GMT


I listed it on the description page. I believe you have made many people happy with this plugin! Thank you.

@herrvigg herrvigg added legacy PR Legacy PR imported from original repo and removed legacy issue Legacy issue imported from original repo labels Jun 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy PR Legacy PR imported from original repo
Projects
None yet
Development

No branches or pull requests

1 participant