parent_id ) { wp_enqueue_script( 'top-ten-admin-js' ); wp_enqueue_style( 'top-ten-admin-css' ); } } /** * Admin Menu. * * @since 3.0.0 */ public function network_admin_menu() { $this->parent_id = add_submenu_page( 'tptn_dashboard', esc_html__( 'Top 10 - Network Popular Posts', 'top-10' ), esc_html__( 'Popular Posts', 'top-10' ), 'manage_network_options', 'tptn_network_pop_posts_page', array( $this, 'render_page' ) ); add_action( "load-{$this->parent_id}", array( $this, 'screen_option' ) ); } /** * Set screen. * * @param string $status Status of screen. * @param string $option Option name. * @param string $value Option value. * @return string Value. */ public static function set_screen( $status, $option, $value ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundBeforeLastUsed return $value; } /** * Plugin settings page */ public function render_page() { $page = ''; if ( isset( $_REQUEST['page'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended $page = sanitize_text_field( wp_unslash( $_REQUEST['page'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended } ?>

pop_posts_table->prepare_items(); $this->hidden_inputs(); $this->pop_posts_table->display(); ?>

__( 'Popular Posts', 'top-10' ), 'default' => 20, 'option' => 'pop_posts_per_page', ); add_screen_option( $option, $args ); $this->pop_posts_table = new \WebberZone\Top_Ten\Admin\Statistics_Table( true ); } /** * Displays the hidden inputs. */ public function hidden_inputs() { if ( ! empty( $_REQUEST['orderby'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended echo ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended } if ( ! empty( $_REQUEST['order'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended echo ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended } } }