• First of all, I know nothing about wordpress development so I’m probably missing something pretty basic.

    I’m using the JetPack Markdown plugin, however I want to runt a simple filter (a search/replace using regexp) before the content is passed to the markdown converter. So I wrote a plugin that seem to work perfectly when I DON’T have markdown activated, but when markdown is activated the result is not what I want.

    Based on the resulting output and that everything works when markdown is turned off I guess that markdown is run before my plugin is able to run.

    I add my filter using this line

    add_filter('the_content', 'fix_my_links', 1);

    which should, if I understand things correctly, run my filter “first”, but it seem like markdown is run before that.

    Are my guesses correct? If so, how do apply my filter before markdown gets the chance to do anything?

    If I’m wrong, what am I missing?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    I’m not that familiar with the Markdown plugin, but it appears to me that it transforms the content upon post save. The original markdown is saved elsewhere for later editing. Thus ‘the_content’ can never come before the plugin handles the content. If you hook something like ‘wp_insert_post’ with a low priority, then you will have first crack at the content since the plugin takes the default 10 priority. To see other hooks the plugin uses, see easy-markdown.php around line 113.

    Thread Starter skromta

    (@skromta)

    Thanks, I think that put me on the right track

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Applying a filter to a markdown post’ is closed to new replies.