Making WordPress.org

Changeset 12504


Ignore:
Timestamp:
03/28/2023 05:38:32 AM (3 years ago)
Author:
dd32
Message:

Markdown Importers: Jetpack's jetpack_require_lib() helper method no longer exists. Use direct file references.

See #6411.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins
Files:
2 edited

Legend:

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

    r11951 r12504  
    228228            return $markdown_source;
    229229        }
    230         if ( ! function_exists( 'jetpack_require_lib' ) ) {
    231             return new WP_Error( 'missing-jetpack-require-lib', 'jetpack_require_lib() is missing on system.' );
     230
     231        if ( ! class_exists( 'WPCom_GHF_Markdown_Parser' ) && defined( 'JETPACK__PLUGIN_DIR' ) ) {
     232            include JETPACK__PLUGIN_DIR . '/_inc/lib/markdown.php';
     233        }
     234        if ( ! class_exists( 'WPCom_GHF_Markdown_Parser' ) ) {
     235            return new WP_Error( 'missing-jetpack-markdown', 'Jetpack Markdown is missing on system.' );
    232236        }
    233237
     
    253257
    254258        // Transform to HTML and save the post
    255         jetpack_require_lib( 'markdown' );
    256259        $parser = new \WPCom_GHF_Markdown_Parser;
    257260        $html = $parser->transform( $markdown );
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-markdown/inc/class-importer.php

    r10833 r12504  
    420420            return $markdown_source;
    421421        }
    422         if ( ! function_exists( 'jetpack_require_lib' ) ) {
    423             return new WP_Error( 'missing-jetpack-require-lib', 'jetpack_require_lib() is missing on system.' );
     422
     423        if ( ! class_exists( 'WPCom_GHF_Markdown_Parser' ) && defined( 'JETPACK__PLUGIN_DIR' ) ) {
     424            include JETPACK__PLUGIN_DIR . '/_inc/lib/markdown.php';
     425        }
     426        if ( ! class_exists( 'WPCom_GHF_Markdown_Parser' ) ) {
     427            return new WP_Error( 'missing-jetpack-markdown', 'Jetpack Markdown is missing on system.' );
    424428        }
    425429
     
    479483
    480484        // Transform to HTML and save the post
    481         jetpack_require_lib( 'markdown' );
    482485        $parser = new WPCom_GHF_Markdown_Parser();
    483486        $parser->preserve_shortcodes = false;
Note: See TracChangeset for help on using the changeset viewer.