• Resolved lepetitben

    (@lepetitben)


    Hi,

    I had to modify your plugin a bit as it is not fully compliant with PolyLang on my WordPress installation.

    Actually your plugin created automatically “enhanced posts” for other types than categories (especially translation “links”).

    So I took a look at your code and immediately saw an empty function named “is_valid_taxonomy”. So I modified a bit the content of this function in order to return FALSE for special posts and called is_valid_taxonomy() in every {CRUD}_category() functions of your WP_Integration.php file.

    I don’t know if it is the only place where I must check the taxonomy in order to make sure your plugin won’t create unnecessary enhancedposts (hints ?) but it would be nice to be able to configure that using the WordPress plugins page.

    I have another question regarding the correlation table. Why do you use it rather than the ‘post_category’ field (that is furthermore commented in your code in add_new_from_category()) ? Indeed if you use the post_category you can then match with the category ID and the correlation table is then not necessary anymore. Furthermore I think there is a problem with import/export as the correlation table’s data won’t be included in the WRX file.

    Thanks in advance for your help and answers!

    https://www.ads-software.com/plugins/enhanced-category-pages/

Viewing 1 replies (of 1 total)
  • Plugin Author cip

    (@cip)

    Hi!

    We are glad you found our plugin useful.

    Here are the answers to your questions:

    1. initially the Enhanced Category Pages plugin enhanced only categories. As per our users’ request, starting with version 1.0 the plugin enhances all terms (including categories). You found in our code the empty method because it is in our future plans to allow users to manage the taxonomies they need to be enhanced.
    2. editing is_valid_taxonomy to filter the taxonomies you need enhanced is enough to avoid enhancing all taxonomies – the method is already called where needed, no further calls are required.
    3. we had an issue using the post_category field – it incremented the count of posts attached to the category and found it difficult to prevent this otherwise. We are open to suggestions.
    4. Export – only standard tables are exported by default and there is no way using to augment the export file. (there are requests for this WP feature lasting 5 years ago…). We may be able to drop the need for the correlation table by using posts meta data. We shall address this for the next release.

    Let me know if I have addressed all your questions and if there is anything open, let us know.

Viewing 1 replies (of 1 total)
  • The topic ‘Question about the code and the correlation table’ is closed to new replies.