Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter imazzara

    (@imazzara)

    Extend:

    On the contrusct of the class I have :

    class MyClass extends ANOTHERCLASS
    {
    function __construct($post_type = ‘project’) {
    $this->mail = new Fre_Mailing();
    $this->post_type = PROJECT;
    $this->disable_plan = ae_get_option(‘disable_plan’, false);
    $this->add_ajax(‘ae-fetch-projects’, ‘fetch_post’);
    $this->add_ajax(‘ae-project-sync’, ‘post_sync’); // post_sync is my method1()

    }
    }

    Thread Starter imazzara

    (@imazzara)

    The class is used to create a project and if is OK the method1() return the ajax call.

    Because of that I need to redefined the method1() because I need the some vars that has value inside this method.

    I don’t know if I’ve been clear of what I need to do.

    On the method1() there is :

    if ($this->disable_plan && $request[‘method’] == ‘create’) {

    // disable plan, free to post place
    $response = array(
    ‘success’ => true,
    ‘data’ => array(

    // set redirect url
    ‘redirect_url’ => $result->permalink
    ) ,
    ‘msg’ => __(“Submit place successfull.”, ET_DOMAIN)
    );

    // send response
    wp_send_json($response);
    }

    I need to add one line after the wp_send_json($response) because I need some $request and $this stuffs

Viewing 2 replies - 1 through 2 (of 2 total)