Skip to content

Commit

Permalink
doc, tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleBlanchette committed Dec 21, 2024
1 parent 48f2e34 commit 7e932f6
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/admin/class-admin-pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,6 @@ public static function register_block_editor_assets() {
/**
* Gets the data for frontend script use relating to tasks.
*
* @see $frontend_task_data
*
* @since 4.0.0
*
* @return array The data. Remember to JSON encode for use
Expand Down Expand Up @@ -444,8 +442,6 @@ private static function get_frontend_task_data() {
/**
* Gets the data for frontend script use relating to API requests.
*
* @see $frontend_task_data
*
* @since 4.0.0
*
* @return array The data. Remember to JSON encode for use
Expand Down Expand Up @@ -487,14 +483,14 @@ public static function get_frontend_api_data() : array {
);

/**
* Filters the actions for which nonces will
* Filters the API actions for which nonces will
* be created for frontend scripts to use.
*
* @since [unreleased]
*
* @param string[] $nonce_actions An array of frontend action names.
*/
$nonce_actions = apply_filters( 'ptc_completionist_frontend_nonce_actions', $nonce_actions );
$nonce_actions = apply_filters( 'ptc_completionist_frontend_api_nonce_actions', $nonce_actions );

foreach ( $nonce_actions as $action ) {
$api_data[ "nonce_{$action}" ] = wp_create_nonce( "ptc_completionist_{$action}" );
Expand All @@ -506,6 +502,16 @@ public static function get_frontend_api_data() : array {
return static::$frontend_api_data;
}

/**
* Gets the frontend API data for the specified context.
*
* @see get_frontend_api_data()
*
* @since [unreleased]
*
* @param string $context The context to select.
* @return array The selected frontend API data.
*/
public static function get_frontend_api_data_for_context( string $context ) : array {

$context_to_keys = array(
Expand Down

0 comments on commit 7e932f6

Please sign in to comment.