/var/www/html_uk/wp-content/plugins/automatewoo/includes/Fields/Sensei_Question.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php

namespace AutomateWoo\Fields;

defined'ABSPATH' ) || exit;

/**
 * Searchable Sensei Question field class.
 *
 * @since 5.6.10
 * @package AutomateWoo\Fields
 */
class Sensei_Question extends Searchable_Select_Abstract {

    
/**
     * The default name for this field.
     *
     * @var string
     */
    
protected $name 'sensei_question';

    
/**
     * Product constructor.
     */
    
public function __construct() {
        
parent::__construct();
        
$this->set_title__'Question''automatewoo' ) );
    }

    
/**
     * Get the ajax action to use for the search.
     *
     * @return string
     */
    
protected function get_search_ajax_action() {
        return 
'aw_json_search_sensei_questions';
    }

    
/**
     * Get the displayed value of a selected option.
     *
     * @param string $value
     *
     * @return string
     */
    
protected function get_select_option_display_value$value ) {
        
$question get_post$value );

        if ( 
$question ) {
            return 
get_the_title$question );
        }

        return 
__'(Question not found)''automatewoo' );
    }
}