Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

...

VariableScript description
$jsLoaders
Default loaders that is usually added to the user sections for WordPress.
$jsLoadersCheckout
Scripts that is only loaded in the head, at checkout section.
$jsLoadersAdmin
Script loaded in the admin section.
$jsDependencies

Every script that has dependencies in other scripts should be added here. For example if some of the basic scripts needs jquery it is added like this:

Code Block
themeEmacs
private static $jsDependencies = ['resursbank' => ['jquery']];


$jsDependenciesAdmin
As the regular dependency variable above, but for admin section.
$styles
Every css that needs to be loaded.
$stylesAdmin
Css that resides in the admin section.

...

The ajax receiver for internally supported requests is very much automated from WordPress::setupAjaxActions. Each action name are added with the prefix rbwc_ as mentioned in theĀ Actions, filters, triggers section. Each snake_case-action are from there translated to a camelCase action, so that the entire codebase looks the same. The default actions all resides in the PluginApi-class in the mentioned camelCase format. To add more, you could continue add methods like this, or hook up with your own ideas via external plugins. The action list is also limiting the actions you can fire up from the PluginApi class.

Nonces in AJAX calls

Nonces are always added in the localizations and the ajaxifier itself so each call can be validated if necessary. For example, when we validate credentials from wp-admin, we always use the nonce to avoid problems.

...