[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/js/dist/ -> notices.js (summary)

Higher-order reducer creator which creates a combined reducer object, keyed by a property on the action object.

File Size: 674 lines (22 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 9 functions

  createNotice()
  createSuccessNotice()
  createInfoNotice()
  createErrorNotice()
  createWarningNotice()
  removeNotice()
  removeAllNotices()
  removeNotices()
  getNotices()

Functions
Functions that are not part of a class:

createNotice(status = DEFAULT_STATUS, content, options = {})   X-Ref
Returns an action object used in signalling that a notice is to be created.

return: {Object} Action object.
param: {string|undefined}      status                       Notice status ("info" if undefined is passed).
param: {string}                content                      Notice message.
param: {Object}                [options]                    Notice options.
param: {string}                [options.context='global']   Context under which to
param: {string}                [options.id]                 Identifier for notice.
param: {boolean}               [options.isDismissible=true] Whether the notice can
param: {string}                [options.type='default']     Type of notice, one of
param: {boolean}               [options.speak=true]         Whether the notice
param: {Array<WPNoticeAction>} [options.actions]            User actions to be
param: {string}                [options.icon]               An icon displayed with the notice.
param: {boolean}               [options.explicitDismiss]    Whether the notice includes
param: {Function}              [options.onDismiss]          Called when the notice is dismissed.

createSuccessNotice(content, options)   X-Ref
Returns an action object used in signalling that a success notice is to be
created. Refer to `createNotice` for options documentation.

return: {Object} Action object.
param: {string} content   Notice message.
param: {Object} [options] Optional notice options.

createInfoNotice(content, options)   X-Ref
Returns an action object used in signalling that an info notice is to be
created. Refer to `createNotice` for options documentation.

return: {Object} Action object.
param: {string} content   Notice message.
param: {Object} [options] Optional notice options.

createErrorNotice(content, options)   X-Ref
Returns an action object used in signalling that an error notice is to be
created. Refer to `createNotice` for options documentation.

return: {Object} Action object.
param: {string} content   Notice message.
param: {Object} [options] Optional notice options.

createWarningNotice(content, options)   X-Ref
Returns an action object used in signalling that a warning notice is to be
created. Refer to `createNotice` for options documentation.

return: {Object} Action object.
param: {string} content   Notice message.
param: {Object} [options] Optional notice options.

removeNotice(id, context = DEFAULT_CONTEXT)   X-Ref
Returns an action object used in signalling that a notice is to be removed.

return: {Object} Action object.
param: {string} id                 Notice unique identifier.
param: {string} [context='global'] Optional context (grouping) in which the notice is

removeAllNotices(noticeType = 'default', context = DEFAULT_CONTEXT)   X-Ref
Removes all notices from a given context. Defaults to the default context.

return: {Object}        Action object.
param: {string} noticeType The context to remove all notices from.
param: {string} context    The context to remove all notices from.

removeNotices(ids, context = DEFAULT_CONTEXT)   X-Ref
Returns an action object used in signalling that several notices are to be removed.

return: {Object} Action object.
param: {string[]} ids                List of unique notice identifiers.
param: {string}   [context='global'] Optional context (grouping) in which the notices are

getNotices(state, context = DEFAULT_CONTEXT)   X-Ref
Returns all notices as an array, optionally for a given context. Defaults to
the global context.

return: {WPNotice[]} Array of notices.
param: {Object}  state   Notices state.
param: {?string} context Optional grouping context.



Generated : Sat Nov 23 08:20:01 2024 Cross-referenced by PHPXref