sprintf( '%2$s', esc_url( add_query_arg( 'page', AMP_Options_Manager::OPTION_NAME, admin_url( 'admin.php' ) ) ), __( 'Settings', 'amp' ) ), ), $links ); } /** * Add menu. */ public function add_menu_items() { add_menu_page( __( 'AMP Options', 'amp' ), __( 'AMP', 'amp' ), 'edit_posts', AMP_Options_Manager::OPTION_NAME, array( $this, 'render_screen' ), self::ICON_BASE64_SVG ); add_submenu_page( AMP_Options_Manager::OPTION_NAME, __( 'AMP Settings', 'amp' ), __( 'General', 'amp' ), 'edit_posts', AMP_Options_Manager::OPTION_NAME ); add_settings_section( 'general', false, '__return_false', AMP_Options_Manager::OPTION_NAME ); add_settings_field( 'theme_support', __( 'Template Mode', 'amp' ), array( $this, 'render_theme_support' ), AMP_Options_Manager::OPTION_NAME, 'general', array( 'class' => 'theme_support', ) ); add_settings_field( 'validation', __( 'Validation Handling', 'amp' ), array( $this, 'render_validation_handling' ), AMP_Options_Manager::OPTION_NAME, 'general', array( 'class' => 'amp-validation-field', ) ); add_settings_field( 'supported_templates', __( 'Supported Templates', 'amp' ), array( $this, 'render_supported_templates' ), AMP_Options_Manager::OPTION_NAME, 'general', array( 'class' => 'amp-template-support-field', ) ); if ( wp_using_ext_object_cache() ) { add_settings_field( 'caching', __( 'Caching', 'amp' ), array( $this, 'render_caching' ), AMP_Options_Manager::OPTION_NAME, 'general', array( 'class' => 'amp-caching-field', ) ); } $submenus = array( new AMP_Analytics_Options_Submenu( AMP_Options_Manager::OPTION_NAME ), ); // Create submenu items and calls on the Submenu Page object to render the actual contents of the page. foreach ( $submenus as $submenu ) { $submenu->init(); } } /** * Render theme support. * * @since 1.0 */ public function render_theme_support() { $theme_support = AMP_Options_Manager::get_option( 'theme_support' ); $native_description = __( 'Reuses active theme\'s templates to display AMP responses but does not use separate URLs for AMP. This means your site is AMP-first and your canonical URLs are AMP.', 'amp' ); $paired_description = __( 'Reuses active theme\'s templates to display AMP responses, but uses separate URLs for AMP. Each canonical URL may have a corresponding AMP URL, if the content is fully AMP valid.', 'amp' ); $builtin_support = in_array( get_template(), AMP_Core_Theme_Sanitizer::get_supported_themes(), true ); ?>