' . esc_html__( 'Knowledge', 'mainwp' ) . '', 'manage_options', 'Knowledge', array( static::class, 'render' ) ); MainWP_Menu::add_left_menu( array( 'title' => esc_html__( 'Knowledge', 'mainwp' ), 'parent_key' => 'ai', 'slug' => 'Knowledge', 'href' => 'admin.php?page=Knowledge', 'leftsub_order_level2' => 1, ), 2 ); } /** * Dashboard page access is required even when the base permission passes. * * @return void */ public static function render() { if ( ! MainWP_System_Utility::is_admin() || true !== MainWP_Abilities_Util::check_rest_api_permission() ) { echo '
' . esc_html__( 'You do not have permission to access this knowledge.', 'mainwp' ) . '
'; return; } $tab = isset( $_GET['tab'] ) && is_string( $_GET['tab'] ) && 'agency' === sanitize_key( wp_unslash( $_GET['tab'] ) ) ? 'agency' : 'review'; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Navigation is read-only. MainWP_UI::render_top_header( array( 'title' => esc_html__( 'Knowledge', 'mainwp' ) ) ); self::render_navigation( $tab ); ?>
'; } /** * Render the Knowledge page tabular navigation. * * @param string $active Active tab. * * @return void */ private static function render_navigation( $active ) { ?> array( 'label' => __( 'Status', 'mainwp' ), 'options' => array( 'all' => __( 'All', 'mainwp' ), 'unverified' => __( 'Unverified', 'mainwp' ), 'verified' => __( 'Verified', 'mainwp' ), ), ), 'level' => array( 'label' => __( 'Level', 'mainwp' ), 'options' => array( 'all' => __( 'All levels', 'mainwp' ), 'agency' => __( 'Agency', 'mainwp' ), 'client' => __( 'Client', 'mainwp' ), 'site' => __( 'Site', 'mainwp' ), ), ), ); ?>
$filter ) : ?>
'mainwp-knowledge-review-sections', 'section_class' => 'mainwp-knowledge-review-section', 'show_add' => false, 'empty_title' => __( 'No matching records', 'mainwp' ), 'empty_description' => __( 'No records of this type match the selected filters.', 'mainwp' ), ) ); ?>