get_pointers(); if ( empty( $pointers ) ) { return; } // Only enqueue one pointer at a time to prevent them overlaying each other. foreach ( $pointers as $pointer ) { if ( ! $pointer->is_active( $hook_suffix ) ) { continue; } $pointer->enqueue(); return; } } /** * Gets available admin pointers. * * @since 1.2 * * @return array List of AMP_Admin_Pointer instances. */ private function get_pointers() { return array( new AMP_Admin_Pointer( 'amp_template_mode_pointer_10', array( 'selector' => '#toplevel_page_amp-options', 'heading' => __( 'AMP', 'amp' ), 'subheading' => __( 'New AMP Template Modes', 'amp' ), 'description' => __( 'You can now reuse your theme\'s templates and styles in AMP responses, in both “Transitional” and “Standard” modes.', 'amp' ), 'position' => array( 'align' => 'middle', ), 'active_callback' => function() { return version_compare( strtok( AMP__VERSION, '-' ), '1.1', '<' ); }, ) ), new AMP_Admin_Pointer( 'amp_stories_support_pointer_12', array( 'selector' => '#toplevel_page_amp-options', 'heading' => __( 'AMP', 'amp' ), 'subheading' => __( 'Stories', 'amp' ), 'description' => __( 'You can now enable Stories, a visual storytelling format for the open web which immerses your readers in fast-loading, full-screen, and visually rich experiences.', 'amp' ), 'position' => array( 'align' => 'middle', ), 'active_callback' => function( $hook_suffix ) { if ( 'toplevel_page_amp-options' === $hook_suffix ) { return false; } return ! AMP_Options_Manager::is_stories_experience_enabled(); }, ) ), new AMP_Admin_Pointer( 'amp_stories_menu_pointer_12', array( 'selector' => '#menu-posts-' . AMP_Story_Post_Type::POST_TYPE_SLUG, 'heading' => __( 'AMP', 'amp' ), 'description' => __( 'Head over here to create your first AMP story.', 'amp' ), 'position' => array( 'align' => 'middle', ), 'active_callback' => function( $hook_suffix ) { if ( 'edit.php' === $hook_suffix && AMP_Story_Post_Type::POST_TYPE_SLUG === filter_input( INPUT_GET, 'post_type' ) ) { return false; } return AMP_Options_Manager::is_stories_experience_enabled(); }, ) ), ); } }