PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 3.4.0
ShopBuilder – WooCommerce Builder For Elementor v3.4.0
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
shopbuilder / app / Modules / Compare / CompareAdmin.php

CompareAdmin.php in ShopBuilder – WooCommerce Builder For Elementor 3.4.0, at app/Modules/Compare/CompareAdmin.php

35 lines 933 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace RadiusTheme\SB\Modules\Compare;
4
5 // Do not allow directly accessing this file.
6 if ( ! defined( 'ABSPATH' ) ) {
7 exit( 'This script cannot be accessed directly.' );
8 }
9
10 use RadiusTheme\SB\Helpers\Fns;
11 use RadiusTheme\SB\Traits\SingletonTrait;
12 use WP_Post;
13
14 class CompareAdmin {
15
16 use SingletonTrait;
17
18 public function __construct() {
19 add_filter( 'display_post_states', [ $this, 'add_display_post_states' ], 10, 2 );
20 }
21
22 /**
23 * Add a post display state for special WC pages in the page list table.
24 *
25 * @param array $post_states An array of post display states.
26 * @param WP_Post $post The current post object.
27 */
28 public function add_display_post_states( $post_states, $post ) {
29 if ( (int) Fns::get_option( 'modules', 'compare', 'page' ) === $post->ID ) {
30 $post_states['rtsb_page_for_compare'] = esc_html__( 'Compare Page', 'shopbuilder' );
31 }
32
33 return $post_states;
34 }
35 }