• Resolved mbouclas

    (@mbouclas)


    For example when editing a category under posts, the description is not replaced

    Same goes for other taxonomies, like woocomerce attribute

    • This topic was modified 6 months, 3 weeks ago by mbouclas.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Pierre-Henri Lavigne

    (@peter202202)

    @mbouclas could you elaborate a little bit more on what you are trying to achieve please ? Are you expecting the markdown editor for taxonomy and woocommerce attribute on the backend edit screen ? Or output every category description (like excerpt) or woocommerce attribute written as markdown ?

    That’s gonna be a tough one ??If you are looking for the frontend output, I haven’t tested it yet but you should be able to use existing filters inside your custom theme for now. With something like this:

    # If using markdown inside the category description textarea form field
    add_filter('category_description', function( $str_desc, $obj_cat ) {
      return mmd()->markdown2html( $str_desc );
    }, 11, 2);
    
    # Using markdown inside the product attribute input form fields
    add_filter('woocommerce_attribute', function( $html_val, $attr, $org_val ) {
      return mmd()->markdown2html( $org_val );
    }, 11, 3);
    
    # Using markdown inside the term description textarea form field
    add_filter( 'get_term', function( $term, $tax ) {
      $term->description = mmd()->markdown2html( $term );
      return $term;
    }, 11, 2);

    Looks like I need to start writing a bit of documentation. ??

    Keep in touch, and best regards

    Thread Starter mbouclas

    (@mbouclas)

    No no, if you go to Posts -> Categories, there’s a description field there. Normally that’s the default wordpress rich editor. Looks like this

    When your plugin is active, this is disabled, as it should be, but the markup editor is not shown, just a textarea.

    Same goes for every taxonomy, as they are rendered the same way

    Plugin Author Pierre-Henri Lavigne

    (@peter202202)

    @mbouclas Thank you for the screenshots, that was really helpful. I’ve been a WordPress user since version 2 or 3, and actually there has never been a wysiwyg editor on the category description. At least natively, it’s probably a feature from one of your plugin or your theme. ???

    The reason you are getting this behavior is because the filter disabling the old TinyMCE Rich Editor WYSIWYG is applied at “a global level” on the backend. It’s a bug, right now I have no plan to handle it properly so it’s gonna be case by case. Please don’t expect the old rich text editor to be replaced by the markdown editor by default ??

    Anyway I’ve just released version 3.4.0 that should add markdown support for categories, tags and terms’ description. That should solve your patterns, and you don’t need the snippets I provided earlier ??

    Free free to give a try when you can, and hope that this will get you back on track ??

    Thread Starter mbouclas

    (@mbouclas)

    Interesting, if it’s a plugin i have no idea which one it is ?? In any case, the new update works perfectly.

    Thank you

    Plugin Author Pierre-Henri Lavigne

    (@peter202202)

    @mbouclas Excellent ! ??
    I’m gonna mark the ticket as solved if you don’t mind. The filter does not seem to work with the API but there is already another ticket. ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Not replacing editors in taxonomies’ is closed to new replies.