2018-09-21 23:44:04 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* WooCommerce Admin (Dashboard) Notes.
|
|
|
|
*
|
|
|
|
* The WooCommerce admin notes class gets admin notes data from storage and checks validity.
|
|
|
|
*
|
2018-09-26 23:35:01 +00:00
|
|
|
* @package WooCommerce Admin/Classes
|
2018-09-21 23:44:04 +00:00
|
|
|
*/
|
2018-09-26 23:35:01 +00:00
|
|
|
|
2018-09-21 23:44:04 +00:00
|
|
|
defined( 'ABSPATH' ) || exit;
|
|
|
|
|
2018-09-26 23:35:01 +00:00
|
|
|
/**
|
|
|
|
* WC_Admin_Note class.
|
|
|
|
*/
|
2018-09-21 23:44:04 +00:00
|
|
|
class WC_Admin_Note extends WC_Data {
|
|
|
|
|
2018-09-26 23:35:01 +00:00
|
|
|
// Note types.
|
2018-09-26 23:38:50 +00:00
|
|
|
const E_WC_ADMIN_NOTE_ERROR = 'error'; // used for presenting error conditions.
|
|
|
|
const E_WC_ADMIN_NOTE_WARNING = 'warning'; // used for presenting warning conditions.
|
|
|
|
const E_WC_ADMIN_NOTE_UPDATE = 'update'; // i.e. used when a new version is available.
|
|
|
|
const E_WC_ADMIN_NOTE_INFORMATIONAL = 'info'; // used for presenting informational messages.
|
2018-09-21 23:44:04 +00:00
|
|
|
|
2018-09-26 23:35:01 +00:00
|
|
|
// Note status codes.
|
2018-09-26 23:38:50 +00:00
|
|
|
const E_WC_ADMIN_NOTE_UNACTIONED = 'unactioned'; // the note has not yet been actioned by a user.
|
|
|
|
const E_WC_ADMIN_NOTE_ACTIONED = 'actioned'; // the note has had its action completed by a user.
|
2018-09-25 00:09:39 +00:00
|
|
|
|
2018-09-21 23:44:04 +00:00
|
|
|
/**
|
|
|
|
* This is the name of this object type.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $object_type = 'admin-note';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Data array, with defaults.
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
protected $data = array(
|
|
|
|
'name' => '-',
|
|
|
|
'type' => self::E_WC_ADMIN_NOTE_INFORMATIONAL,
|
|
|
|
'locale' => 'en_US',
|
|
|
|
'title' => '-',
|
|
|
|
'content' => '-',
|
|
|
|
'icon' => 'info',
|
|
|
|
'content_data' => array(),
|
|
|
|
'status' => self::E_WC_ADMIN_NOTE_UNACTIONED,
|
|
|
|
'source' => 'woocommerce',
|
|
|
|
'date_created' => '0000-00-00 00:00:00',
|
|
|
|
'date_reminder' => '',
|
|
|
|
'actions' => array(),
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Cache group.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $cache_group = 'admin-note';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Note constructor. Loads note data.
|
|
|
|
*
|
|
|
|
* @param mixed $data Note data, object, or ID.
|
|
|
|
*/
|
|
|
|
public function __construct( $data = '' ) {
|
|
|
|
parent::__construct( $data );
|
|
|
|
|
|
|
|
if ( $data instanceof WC_Admin_Note ) {
|
|
|
|
$this->set_id( absint( $data->get_id() ) );
|
2018-10-10 23:46:08 +00:00
|
|
|
} elseif ( is_numeric( $data ) ) {
|
2018-09-21 23:44:04 +00:00
|
|
|
$this->set_id( $data );
|
|
|
|
} elseif ( is_object( $data ) && ! empty( $data->note_id ) ) {
|
|
|
|
$this->set_id( $data->note_id );
|
|
|
|
$this->set_props( (array) $data );
|
|
|
|
$this->set_object_read( true );
|
|
|
|
} else {
|
|
|
|
$this->set_object_read( true );
|
|
|
|
}
|
|
|
|
|
2018-09-24 19:19:57 +00:00
|
|
|
$this->data_store = WC_Data_Store::load( 'admin-note' );
|
2018-09-21 23:44:04 +00:00
|
|
|
if ( $this->get_id() > 0 ) {
|
|
|
|
$this->data_store->read( $this );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-09-25 23:55:03 +00:00
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Helpers
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Methods for getting allowed types, statuses.
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get allowed types.
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
2018-09-27 17:48:25 +00:00
|
|
|
public static function get_allowed_types() {
|
2018-09-25 23:55:03 +00:00
|
|
|
$allowed_types = array(
|
|
|
|
self::E_WC_ADMIN_NOTE_ERROR,
|
|
|
|
self::E_WC_ADMIN_NOTE_WARNING,
|
|
|
|
self::E_WC_ADMIN_NOTE_UPDATE,
|
|
|
|
self::E_WC_ADMIN_NOTE_INFORMATIONAL,
|
|
|
|
);
|
|
|
|
|
|
|
|
return apply_filters( 'woocommerce_admin_note_types', $allowed_types );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get allowed statuses.
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
2018-09-27 17:48:25 +00:00
|
|
|
public static function get_allowed_statuses() {
|
2018-09-25 23:55:03 +00:00
|
|
|
$allowed_statuses = array(
|
|
|
|
self::E_WC_ADMIN_NOTE_ACTIONED,
|
|
|
|
self::E_WC_ADMIN_NOTE_UNACTIONED,
|
|
|
|
);
|
|
|
|
|
|
|
|
return apply_filters( 'woocommerce_admin_note_statuses', $allowed_statuses );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-09-21 23:44:04 +00:00
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Getters
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Methods for getting data from the note object.
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get note name.
|
|
|
|
*
|
|
|
|
* @param string $context What the value is for. Valid values are 'view' and 'edit'.
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function get_name( $context = 'view' ) {
|
|
|
|
return $this->get_prop( 'name', $context );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get note type.
|
|
|
|
*
|
|
|
|
* @param string $context What the value is for. Valid values are 'view' and 'edit'.
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function get_type( $context = 'view' ) {
|
|
|
|
return $this->get_prop( 'type', $context );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get note locale.
|
|
|
|
*
|
|
|
|
* @param string $context What the value is for. Valid values are 'view' and 'edit'.
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function get_locale( $context = 'view' ) {
|
|
|
|
return $this->get_prop( 'locale', $context );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get note title.
|
|
|
|
*
|
|
|
|
* @param string $context What the value is for. Valid values are 'view' and 'edit'.
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function get_title( $context = 'view' ) {
|
|
|
|
return $this->get_prop( 'title', $context );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get note content.
|
|
|
|
*
|
|
|
|
* @param string $context What the value is for. Valid values are 'view' and 'edit'.
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function get_content( $context = 'view' ) {
|
|
|
|
return $this->get_prop( 'content', $context );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get note icon (Gridicon).
|
|
|
|
*
|
|
|
|
* @param string $context What the value is for. Valid values are 'view' and 'edit'.
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function get_icon( $context = 'view' ) {
|
|
|
|
return $this->get_prop( 'icon', $context );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get note content data (i.e. values that would be needed for re-localization)
|
|
|
|
*
|
|
|
|
* @param string $context What the value is for. Valid values are 'view' and 'edit'.
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function get_content_data( $context = 'view' ) {
|
|
|
|
return $this->get_prop( 'content_data', $context );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get note status.
|
|
|
|
*
|
|
|
|
* @param string $context What the value is for. Valid values are 'view' and 'edit'.
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function get_status( $context = 'view' ) {
|
|
|
|
return $this->get_prop( 'status', $context );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get note source.
|
|
|
|
*
|
|
|
|
* @param string $context What the value is for. Valid values are 'view' and 'edit'.
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function get_source( $context = 'view' ) {
|
|
|
|
return $this->get_prop( 'source', $context );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get date note was created.
|
|
|
|
*
|
|
|
|
* @param string $context What the value is for. Valid values are 'view' and 'edit'.
|
|
|
|
* @return WC_DateTime|NULL object if the date is set or null if there is no date.
|
|
|
|
*/
|
|
|
|
public function get_date_created( $context = 'view' ) {
|
|
|
|
return $this->get_prop( 'date_created', $context );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get date on which user should be reminded of the note (if any).
|
|
|
|
*
|
|
|
|
* @param string $context What the value is for. Valid values are 'view' and 'edit'.
|
|
|
|
* @return WC_DateTime|NULL object if the date is set or null if there is no date.
|
|
|
|
*/
|
|
|
|
public function get_date_reminder( $context = 'view' ) {
|
|
|
|
return $this->get_prop( 'date_reminder', $context );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get actions on the note (if any).
|
|
|
|
*
|
|
|
|
* @param string $context What the value is for. Valid values are 'view' and 'edit'.
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function get_actions( $context = 'view' ) {
|
|
|
|
return $this->get_prop( 'actions', $context );
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Setters
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Methods for setting note data. These should not update anything in the
|
|
|
|
| database itself and should only change what is stored in the class
|
|
|
|
| object.
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set note name.
|
|
|
|
*
|
|
|
|
* @param string $name Note name.
|
|
|
|
*/
|
|
|
|
public function set_name( $name ) {
|
2018-09-26 23:35:01 +00:00
|
|
|
// Don't allow empty names.
|
2018-09-25 00:09:39 +00:00
|
|
|
if ( empty( $name ) ) {
|
2018-09-27 17:48:25 +00:00
|
|
|
$this->error( 'admin_note_invalid_data', __( 'The admin note name prop cannot be empty.', 'wc-admin' ) );
|
2018-09-25 00:09:39 +00:00
|
|
|
}
|
|
|
|
|
2018-09-21 23:44:04 +00:00
|
|
|
$this->set_prop( 'name', $name );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set note type.
|
|
|
|
*
|
|
|
|
* @param string $type Note type.
|
|
|
|
*/
|
|
|
|
public function set_type( $type ) {
|
2018-09-25 00:09:39 +00:00
|
|
|
if ( empty( $type ) ) {
|
2018-09-27 17:48:25 +00:00
|
|
|
$this->error( 'admin_note_invalid_data', __( 'The admin note type prop cannot be empty.', 'wc-admin' ) );
|
2018-09-25 00:09:39 +00:00
|
|
|
}
|
|
|
|
|
2018-10-12 20:04:23 +00:00
|
|
|
if ( ! in_array( $type, self::get_allowed_types(), true ) ) {
|
2018-09-25 00:09:39 +00:00
|
|
|
$this->error(
|
|
|
|
'admin_note_invalid_data',
|
|
|
|
sprintf(
|
2018-09-26 23:35:01 +00:00
|
|
|
/* translators: %s: admin note type. */
|
2018-09-27 17:48:25 +00:00
|
|
|
__( 'The admin note type prop (%s) is not one of the supported types.', 'wc-admin' ),
|
2018-09-25 00:09:39 +00:00
|
|
|
$type
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2018-09-21 23:44:04 +00:00
|
|
|
$this->set_prop( 'type', $type );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set note locale.
|
|
|
|
*
|
|
|
|
* @param string $locale Note locale.
|
|
|
|
*/
|
|
|
|
public function set_locale( $locale ) {
|
2018-09-25 00:09:39 +00:00
|
|
|
if ( empty( $locale ) ) {
|
2018-09-27 17:48:25 +00:00
|
|
|
$this->error( 'admin_note_invalid_data', __( 'The admin note locale prop cannot be empty.', 'wc-admin' ) );
|
2018-09-25 00:09:39 +00:00
|
|
|
}
|
|
|
|
|
2018-09-21 23:44:04 +00:00
|
|
|
$this->set_prop( 'locale', $locale );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set note title.
|
|
|
|
*
|
|
|
|
* @param string $title Note title.
|
|
|
|
*/
|
|
|
|
public function set_title( $title ) {
|
2018-09-25 00:09:39 +00:00
|
|
|
if ( empty( $title ) ) {
|
2018-09-27 17:48:25 +00:00
|
|
|
$this->error( 'admin_note_invalid_data', __( 'The admin note title prop cannot be empty.', 'wc-admin' ) );
|
2018-09-25 00:09:39 +00:00
|
|
|
}
|
|
|
|
|
2018-09-21 23:44:04 +00:00
|
|
|
$this->set_prop( 'title', $title );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set note content.
|
|
|
|
*
|
|
|
|
* @param string $content Note content.
|
|
|
|
*/
|
|
|
|
public function set_content( $content ) {
|
2018-09-26 17:38:25 +00:00
|
|
|
$allowed_html = array(
|
2018-09-26 23:35:01 +00:00
|
|
|
'br' => array(),
|
|
|
|
'em' => array(),
|
2018-09-26 17:38:25 +00:00
|
|
|
'strong' => array(),
|
|
|
|
);
|
|
|
|
|
|
|
|
$content = wp_kses( $content, $allowed_html );
|
|
|
|
|
2018-09-25 00:09:39 +00:00
|
|
|
if ( empty( $content ) ) {
|
2018-09-27 17:48:25 +00:00
|
|
|
$this->error( 'admin_note_invalid_data', __( 'The admin note content prop cannot be empty.', 'wc-admin' ) );
|
2018-09-25 00:09:39 +00:00
|
|
|
}
|
|
|
|
|
2018-09-21 23:44:04 +00:00
|
|
|
$this->set_prop( 'content', $content );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set note icon (Gridicon).
|
|
|
|
*
|
|
|
|
* @param string $icon Note icon.
|
|
|
|
*/
|
|
|
|
public function set_icon( $icon ) {
|
2018-09-25 00:09:39 +00:00
|
|
|
if ( empty( $icon ) ) {
|
2018-09-27 17:48:25 +00:00
|
|
|
$this->error( 'admin_note_invalid_data', __( 'The admin note icon prop cannot be empty.', 'wc-admin' ) );
|
2018-09-25 00:09:39 +00:00
|
|
|
}
|
|
|
|
|
2018-09-21 23:44:04 +00:00
|
|
|
$this->set_prop( 'icon', $icon );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set note data for potential re-localization.
|
|
|
|
*
|
2018-09-26 23:35:01 +00:00
|
|
|
* @param object $content_data Note data.
|
2018-09-21 23:44:04 +00:00
|
|
|
*/
|
|
|
|
public function set_content_data( $content_data ) {
|
2018-09-25 00:09:39 +00:00
|
|
|
$allowed_type = false;
|
|
|
|
|
2018-09-26 23:35:01 +00:00
|
|
|
// Make sure $content_data is stdClass Object or an array.
|
2018-09-25 00:09:39 +00:00
|
|
|
if ( ! ( $content_data instanceof stdClass ) ) {
|
2018-09-27 17:48:25 +00:00
|
|
|
$this->error( 'admin_note_invalid_data', __( 'The admin note content_data prop must be an instance of stdClass.', 'wc-admin' ) );
|
2018-09-21 23:44:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
$this->set_prop( 'content_data', $content_data );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set note status.
|
|
|
|
*
|
|
|
|
* @param string $status Note status.
|
|
|
|
*/
|
|
|
|
public function set_status( $status ) {
|
2018-09-25 00:09:39 +00:00
|
|
|
if ( empty( $status ) ) {
|
2018-09-27 17:48:25 +00:00
|
|
|
$this->error( 'admin_note_invalid_data', __( 'The admin note status prop cannot be empty.', 'wc-admin' ) );
|
2018-09-25 00:09:39 +00:00
|
|
|
}
|
|
|
|
|
2018-10-12 20:04:23 +00:00
|
|
|
if ( ! in_array( $status, self::get_allowed_statuses(), true ) ) {
|
2018-09-25 00:09:39 +00:00
|
|
|
$this->error(
|
|
|
|
'admin_note_invalid_data',
|
|
|
|
sprintf(
|
2018-09-26 23:35:01 +00:00
|
|
|
/* translators: %s: admin note status property. */
|
2018-09-27 17:48:25 +00:00
|
|
|
__( 'The admin note status prop (%s) is not one of the supported statuses.', 'wc-admin' ),
|
2018-09-25 00:09:39 +00:00
|
|
|
$status
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2018-09-21 23:44:04 +00:00
|
|
|
$this->set_prop( 'status', $status );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set note source.
|
|
|
|
*
|
|
|
|
* @param string $source Note source.
|
|
|
|
*/
|
|
|
|
public function set_source( $source ) {
|
2018-09-25 00:09:39 +00:00
|
|
|
if ( empty( $source ) ) {
|
2018-09-27 17:48:25 +00:00
|
|
|
$this->error( 'admin_note_invalid_data', __( 'The admin note source prop cannot be empty.', 'wc-admin' ) );
|
2018-09-25 00:09:39 +00:00
|
|
|
}
|
|
|
|
|
2018-09-21 23:44:04 +00:00
|
|
|
$this->set_prop( 'source', $source );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set date note was created. NULL is not allowed
|
|
|
|
*
|
|
|
|
* @param string|integer $date UTC timestamp, or ISO 8601 DateTime. If the DateTime string has no timezone or offset, WordPress site timezone will be assumed.
|
|
|
|
*/
|
|
|
|
public function set_date_created( $date ) {
|
2018-09-25 00:09:39 +00:00
|
|
|
if ( empty( $date ) ) {
|
2018-09-27 17:48:25 +00:00
|
|
|
$this->error( 'admin_note_invalid_data', __( 'The admin note date prop cannot be empty.', 'wc-admin' ) );
|
2018-09-25 00:09:39 +00:00
|
|
|
}
|
|
|
|
|
2018-09-21 23:44:04 +00:00
|
|
|
$this->set_date_prop( 'date_created', $date );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set date admin should be reminded of note. NULL IS allowed
|
|
|
|
*
|
|
|
|
* @param string|integer|null $date UTC timestamp, or ISO 8601 DateTime. If the DateTime string has no timezone or offset, WordPress site timezone will be assumed. Null if there is no date.
|
|
|
|
*/
|
|
|
|
public function set_date_reminder( $date ) {
|
|
|
|
$this->set_date_prop( 'date_reminder', $date );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add an action to the note
|
2018-09-26 23:35:01 +00:00
|
|
|
*
|
|
|
|
* @param string $name Label name (not presented to user).
|
|
|
|
* @param string $label Note label (e.g. presented as button label).
|
|
|
|
* @param string $query Note query (for redirect).
|
2018-09-21 23:44:04 +00:00
|
|
|
*/
|
|
|
|
public function add_action( $name, $label, $query ) {
|
2018-09-26 23:35:01 +00:00
|
|
|
$name = wc_clean( $name );
|
2018-09-26 17:38:25 +00:00
|
|
|
$label = wc_clean( $label );
|
|
|
|
$query = wc_clean( $query );
|
|
|
|
|
|
|
|
if ( empty( $name ) ) {
|
2018-09-27 17:48:25 +00:00
|
|
|
$this->error( 'admin_note_invalid_data', __( 'The admin note action name prop cannot be empty.', 'wc-admin' ) );
|
2018-09-26 17:38:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( empty( $label ) ) {
|
2018-09-27 17:48:25 +00:00
|
|
|
$this->error( 'admin_note_invalid_data', __( 'The admin note action label prop cannot be empty.', 'wc-admin' ) );
|
2018-09-26 17:38:25 +00:00
|
|
|
}
|
2018-09-25 00:09:39 +00:00
|
|
|
|
2018-09-26 17:38:25 +00:00
|
|
|
if ( empty( $query ) ) {
|
2018-09-27 17:48:25 +00:00
|
|
|
$this->error( 'admin_note_invalid_data', __( 'The admin note action query prop cannot be empty.', 'wc-admin' ) );
|
2018-09-21 23:44:04 +00:00
|
|
|
}
|
2018-09-26 17:38:25 +00:00
|
|
|
|
|
|
|
$action = array(
|
|
|
|
'name' => $name,
|
|
|
|
'label' => $label,
|
|
|
|
'query' => $query,
|
|
|
|
);
|
|
|
|
|
2018-09-26 23:35:01 +00:00
|
|
|
$note_actions = $this->get_prop( 'actions', 'edit' );
|
2018-09-26 17:38:25 +00:00
|
|
|
$note_actions[] = (object) $action;
|
|
|
|
$this->set_prop( 'actions', $note_actions );
|
2018-09-21 23:44:04 +00:00
|
|
|
}
|
|
|
|
}
|