array( 'name' => __( 'Dashboard', 'admin-tour' ), 'url' => admin_url(), ), array( 'id' => 'menu_posts', 'tagget_element' => '#menu-posts', 'title' => __( 'Manage Posts', 'admin-tour' ), 'content' => __( 'Create, edit, or manage blog posts for your website.', 'admin-tour' ), 'position' => array( 'edge' => 'left', 'align' => 'left', ), 'url' => admin_url( 'edit.php' ), ), array( 'id' => 'menu_media', 'tagget_element' => '#menu-media', 'title' => __( 'Handle Media', 'admin-tour' ), 'content' => __( 'Upload and manage your site’s images, videos, and files.', 'admin-tour' ), 'position' => array( 'edge' => 'left', 'align' => 'left', ), 'url' => admin_url( 'upload.php' ), ), array( 'id' => 'menu_pages', 'tagget_element' => '#menu-pages', 'title' => __( 'Manage Pages', 'admin-tour' ), 'content' => __( 'Create and update the main pages of your website here.', 'admin-tour' ), 'position' => array( 'edge' => 'left', 'align' => 'left', ), 'url' => add_query_arg( array( 'post_type' => 'page' ), admin_url( 'edit.php' ) ), ), array( 'id' => 'menu_comments', 'tagget_element' => '#menu-comments', 'title' => __( 'Manage Comments', 'admin-tour' ), 'content' => __( 'Check, approve, or reply to comments from your readers.', 'admin-tour' ), 'position' => array( 'edge' => 'left', 'align' => 'left', ), 'url' => admin_url( 'edit-comments.php' ), ), array( 'id' => 'menu_appearance', 'tagget_element' => '#menu-appearance', 'title' => __( 'Manage Appearance', 'admin-tour' ), 'content' => __( 'Change how your site looks — edit themes, menus, and widgets.', 'admin-tour' ), 'position' => array( 'edge' => 'left', 'align' => 'left', ), 'url' => admin_url( 'themes.php' ), ), array( 'id' => 'menu_users', 'tagget_element' => '#menu-users', 'title' => __( 'Manage Users', 'admin-tour' ), 'content' => __( 'Manage who can access your site and what they can do.', 'admin-tour' ), 'position' => array( 'edge' => 'left', 'align' => 'left', ), 'url' => admin_url( 'users.php' ), ), array( 'id' => 'menu_settings', 'tagget_element' => '#menu-settings', 'title' => __( 'Handle Global Site Settings', 'admin-tour' ), 'content' => __( 'You can easily configure essential site settings in WordPress, such as setting your site title, URL, and permalink structure. Additionally, you have the flexibility to define default pages for your homepage and blog posts, customize general settings, and optimize your site SEO and performance.', 'admin-tour' ), 'position' => array( 'edge' => 'left', 'align' => 'left', ), 'url' => admin_url( 'options-general.php' ), ), array( 'id' => 'wat_widget', 'tagget_element' => '#wat_widget .postbox-header, #wat_widget h2.ui-sortable-handle', 'title' => __( 'Full tour', 'admin-tour' ), 'content' => __( 'You can check all the tours available in the site.', 'admin-tour' ), 'position' => array( 'edge' => 'top', 'align' => 'left', ), 'url' => admin_url( 'index.php' ), ), ); $pointers['options-general'] = array( 'screen_info' => array( 'name' => __( 'Settings', 'admin-tour' ), 'url' => admin_url( 'options-general.php' ), ), array( 'id' => 'settings_general', 'tagget_element' => '#menu-settings .wp-submenu a[href="options-general.php"]', 'title' => __( 'General Settings', 'admin-tour' ), 'content' => __( 'Configure your site title, tagline, URL, email address, timezone, date format, and language preferences.', 'admin-tour' ), 'position' => array( 'edge' => 'left', 'align' => 'left', ), ), array( 'id' => 'settings_writing', 'tagget_element' => '#menu-settings .wp-submenu a[href="options-writing.php"]', 'title' => __( 'Writing Settings', 'admin-tour' ), 'content' => __( 'Set your default post category, post format, and configure publishing options like remote publishing and post via email.', 'admin-tour' ), 'position' => array( 'edge' => 'left', 'align' => 'left', ), 'url' => admin_url( 'options-writing.php' ), ), array( 'id' => 'settings_reading', 'tagget_element' => '#menu-settings .wp-submenu a[href="options-reading.php"]', 'title' => __( 'Reading Settings', 'admin-tour' ), 'content' => __( 'Choose what displays on your homepage, set the number of blog posts to show per page, and manage RSS feed settings.', 'admin-tour' ), 'position' => array( 'edge' => 'left', 'align' => 'left', ), 'url' => admin_url( 'options-reading.php' ), ), array( 'id' => 'settings_discussion', 'tagget_element' => '#menu-settings .wp-submenu a[href="options-discussion.php"]', 'title' => __( 'Discussion Settings', 'admin-tour' ), 'content' => __( 'Control comment settings, moderation options, avatars, and notification preferences for your site.', 'admin-tour' ), 'position' => array( 'edge' => 'left', 'align' => 'left', ), 'url' => admin_url( 'options-discussion.php' ), ), array( 'id' => 'settings_media', 'tagget_element' => '#menu-settings .wp-submenu a[href="options-media.php"]', 'title' => __( 'Media Settings', 'admin-tour' ), 'content' => __( 'Set default image sizes for thumbnails, medium and large images and configure file upload settings.', 'admin-tour' ), 'position' => array( 'edge' => 'left', 'align' => 'left', ), 'url' => admin_url( 'options-media.php' ), ), array( 'id' => 'settings_permalinks', 'tagget_element' => '#menu-settings .wp-submenu a[href="options-permalink.php"]', 'title' => __( 'Permalinks Settings', 'admin-tour' ), 'content' => __( 'Customize your URL structure for posts, pages, and archives to make them more SEO-friendly and readable.', 'admin-tour' ), 'position' => array( 'edge' => 'left', 'align' => 'left', ), 'url' => admin_url( 'options-permalink.php' ), ), array( 'id' => 'settings_privacy', 'tagget_element' => '#menu-settings .wp-submenu a[href="options-privacy.php"]', 'title' => __( 'Privacy Settings', 'admin-tour' ), 'content' => __( 'Set up your privacy policy page and manage data protection settings to comply with privacy regulations.', 'admin-tour' ), 'position' => array( 'edge' => 'left', 'align' => 'left', ), 'url' => admin_url( 'options-privacy.php' ), ), ); $pointers['edit-category'] = array( 'screen_info' => array( 'name' => __( 'Category', 'admin-tour' ), 'url' => add_query_arg( 'taxonomy', 'category', admin_url( 'edit-tags.php' ) ), ), array( 'id' => 'tag_name', 'tagget_element' => '#tag-name', 'title' => __( 'Add New Category', 'admin-tour' ), 'content' => __( 'Create a new taxonomy to group and organize your content.', 'admin-tour' ), 'position' => array( 'edge' => 'top', 'align' => 'left', ), ), array( 'id' => 'tag_slug', 'tagget_element' => '#tag-slug', 'title' => __( 'Category Slug', 'admin-tour' ), 'content' => __( 'Add a new term to this taxonomy to help organize your content.', 'admin-tour' ), 'position' => array( 'edge' => 'top', 'align' => 'left', ), ), array( 'id' => 'tag_edit', 'tagget_element' => '#the-list tr:eq(0) .name', 'title' => __( 'Edit Category', 'admin-tour' ), 'content' => __( 'Update the name or description of an existing term.', 'admin-tour' ), 'position' => array( 'edge' => 'top', 'align' => 'left', ), ), ); $pointers = apply_filters( 'wat_pointers', $pointers ); if ( ! $return_all ) { $pointers = wat_remove_dismiss_pointers( $pointers ); } return $pointers; } if ( ! function_exists( 'wat_remove_dismiss_pointers' ) ) { /** * Remove dismiss pointers. * * @param array $pointers Pointers. * @return array */ function wat_remove_dismiss_pointers( $pointers ) { $current_screen = 'general'; // Check if Dokan is active and if Dokan screen exists. if ( function_exists( 'atp_dokan_is_active' ) && atp_dokan_is_active() ) { if ( function_exists( 'atp_dokan_screen' ) && atp_dokan_screen() ) { if ( function_exists( 'apt_current_dokan_page_id' ) ) { $current_screen = apt_current_dokan_page_id(); } } } // Check if WooCommerce is active and if on the account page. if ( function_exists( 'atp_woocommerce_is_active' ) && atp_woocommerce_is_active() ) { if ( function_exists( 'is_account_page' ) && is_account_page() ) { $current_screen = 'woocommerce'; } } // Check if we are in the admin and fetch current screen. if ( is_admin() && function_exists( 'get_current_screen' ) ) { $screen_obj = get_current_screen(); $current_screen = $screen_obj ? $screen_obj->id : $current_screen; } // Create transient key. $transient_key = 'wat_dismiss_pointers_general'; if ( ! empty( $current_screen ) && isset( $pointers[ $current_screen ] ) ) { $wat_screen_id = array( 'woocommerce' ); if ( function_exists( 'apt_current_dokan_page_id' ) ) { $wat_screen_id[] = apt_current_dokan_page_id(); } if ( in_array( $current_screen, $wat_screen_id, true ) && is_user_logged_in() ) { $transient_key = 'wat_dismiss_pointers_' . $current_screen . '_' . get_current_user_id(); } else { $transient_key = 'wat_dismiss_pointers_' . $current_screen; } } // Restart admin tour if necessary. // phpcs:ignore WordPress.Security.NonceVerification.Recommended $start_tour = isset( $_GET['wat_start_tour'] ) ? (int) $_GET['wat_start_tour'] : 0; if ( $start_tour ) { delete_transient( $transient_key ); } // If transient exists, skip pointers. if ( get_transient( $transient_key ) ) { return array(); } // Check user roles for showing the pointers. if ( is_admin() ) { if ( is_user_logged_in() && ! wat_allowed_roles() ) { return array(); } } // Return current screen pointers if they exist. if ( ! empty( $current_screen ) && isset( $pointers[ $current_screen ] ) ) { $pointers = array( 'screen_id' => $current_screen, 'pointers' => $pointers[ $current_screen ], ); return $pointers; } // Default to dashboard pointers if on dashboard screen. if ( 'dashboard' === $current_screen ) { $pointers = array( 'screen_id' => 'general', 'pointers' => isset( $pointers['general'] ) ? $pointers['general'] : array(), ); return $pointers; } return array(); } } if ( ! function_exists( 'wat_reorder_pointers' ) ) { /** * Reoder pointers. * * @param array $pointers pointers. * @param array $order reorder array index. * @return array */ function wat_reorder_pointers( $pointers = array(), $order = array() ) { if ( empty( $pointers ) || empty( $order ) ) { return $pointers; } $reorder_pointers = array(); foreach ( $pointers as $key => $pointer ) { $reoder_id = false; if ( isset( $pointer['id'] ) ) { $reoder_id = array_search( $pointer['id'], $order, true ); } if ( false !== $reoder_id ) { $reorder_pointers[ $reoder_id ] = $pointer; } else { $reorder_pointers[ $key ] = $pointer; } } ksort( $reorder_pointers ); return $reorder_pointers; } } if ( ! function_exists( 'wat_allowed_roles' ) ) { /** * Allowed roles. */ function wat_allowed_roles() { $allowed = false; if ( function_exists( 'wp_get_current_user' ) ) { $current_user_info = wp_get_current_user(); $roles = $current_user_info->roles; $allowed_roles = apply_filters( 'wat_allowed_roles', array( 'administrator' ) ); $allowed_roles = array_intersect( $allowed_roles, $roles ); $allowed = ! empty( $allowed_roles ) ? true : false; } return $allowed; } } }