Making WordPress.org


Ignore:
Timestamp:
03/18/2021 08:38:45 PM (6 years ago)
Author:
coffee2code
Message:

Markdown Importer: Add 'wporg_markdown_check_etags' filter as a way to prevent checking HTTP ETags during fetch of source docs, effectively allowing a forced reimport of content for all posts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-markdown/inc/class-importer.php

    r10832 r10833  
    432432                        'headers' => array(),
    433433                );
    434                 $last_etag = get_post_meta( $post_id, $this->etag_meta_key, true );
     434                /**
     435                 * Filters if HTTP ETags should be included in request for remote Markdown
     436                 * source update.
     437                 *
     438                 * @param bool $check_etags Should HTTP ETags be checcked? Default true.
     439                 */
     440                $last_etag = apply_filters( 'wporg_markdown_check_etags', true ) ? get_post_meta( $post_id, $this->etag_meta_key, true ) : false;
    435441                if ( ! empty( $last_etag ) ) {
    436442                        $args['headers']['If-None-Match'] = $last_etag;
Note: See TracChangeset for help on using the changeset viewer.