diff --git a/.dev-lib b/.dev-lib index cb76151efe1..ac8f8ff8bb4 100644 --- a/.dev-lib +++ b/.dev-lib @@ -1 +1,2 @@ -SYNC_README_MD=0 \ No newline at end of file +SYNC_README_MD=0 +PATH_EXCLUDES_PATTERN=includes/lib/* diff --git a/amp.php b/amp.php index db1abae1f12..1707e70499a 100644 --- a/amp.php +++ b/amp.php @@ -17,16 +17,12 @@ define( 'AMP__DIR__', dirname( __FILE__ ) ); define( 'AMP__VERSION', '0.6.0-alpha' ); +require_once AMP__DIR__ . '/includes/class-amp-autoloader.php'; +AMP_Autoloader::register(); + require_once AMP__DIR__ . '/back-compat/back-compat.php'; require_once AMP__DIR__ . '/includes/amp-helper-functions.php'; -require_once AMP__DIR__ . '/includes/class-amp-post-type-support.php'; require_once AMP__DIR__ . '/includes/admin/functions.php'; -require_once AMP__DIR__ . '/includes/admin/class-amp-customizer.php'; -require_once AMP__DIR__ . '/includes/admin/class-amp-post-meta-box.php'; -require_once AMP__DIR__ . '/includes/settings/class-amp-customizer-settings.php'; -require_once AMP__DIR__ . '/includes/settings/class-amp-customizer-design-settings.php'; -require_once AMP__DIR__ . '/includes/actions/class-amp-frontend-actions.php'; -require_once AMP__DIR__ . '/includes/actions/class-amp-paired-post-actions.php'; register_activation_hook( __FILE__, 'amp_activate' ); function amp_activate() { @@ -150,7 +146,7 @@ function amp_maybe_add_actions() { } function amp_load_classes() { - require_once( AMP__DIR__ . '/includes/class-amp-post-template.php' ); // this loads everything else + _deprecated_function( __FUNCTION__, '0.6.0' ); } function amp_add_frontend_actions() { @@ -196,8 +192,6 @@ function amp_render_post( $post ) { } $post_id = $post->ID; - amp_load_classes(); - /** * Fires before rendering a post in AMP. * @@ -246,9 +240,3 @@ function amp_redirect_old_slug_to_new_url( $link ) { return $link; } - -// Unconditionally load code required when running unit tests. -if ( function_exists( 'tests_add_filter' ) ) { - amp_load_classes(); - require_once dirname( __FILE__ ) . '/tests/stubs.php'; -} diff --git a/composer.json b/composer.json new file mode 100644 index 00000000000..8cbf0c809f4 --- /dev/null +++ b/composer.json @@ -0,0 +1,7 @@ +{ + "name": "automattic/amp-wp", + "description": "WordPress plugin for adding AMP support.", + "homepage": "https://github.com/Automattic/amp-wp", + "type": "wordpress-plugin", + "license": "GPL-2.0" +} diff --git a/dev-lib b/dev-lib index 52874e44d9e..4ac4bd20b5a 160000 --- a/dev-lib +++ b/dev-lib @@ -1 +1 @@ -Subproject commit 52874e44d9e737dfc8f1e9ca33381f45deb9b636 +Subproject commit 4ac4bd20b5a4b3953eb81a8d2536baef2bf60dcb diff --git a/includes/actions/class-amp-frontend-actions.php b/includes/actions/class-amp-frontend-actions.php index baf9a5d441e..8fa8ef1cfab 100644 --- a/includes/actions/class-amp-frontend-actions.php +++ b/includes/actions/class-amp-frontend-actions.php @@ -1,14 +1,27 @@