Page tree

Versions Compared

Key

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

 

Description

Excerpt

This function changes the order of script hooks.

Panel
bgColor#F2F2F2
borderStylenone

Examples 


Panel
bgColor#FFFFFF
borderStylenone
Expand
titleJSON API
Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/json-api/reorder_hooks?api.version=1&id=HzEpGvT6QGUYwxuX3hWB8AUq%2CUNs8a8IbbAVf5oi_hXbcEw5a
Expand
titleXML API
Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/xml-api/reorder_hooks?api.version=1&id=HzEpGvT6QGUYwxuX3hWB8AUq%2CUNs8a8IbbAVf5oi_hXbcEw5a
Expand
titleCommand Line
Code Block
languagebash
whmapi1 reorder_hooks id=HzEpGvT6QGUYwxuX3hWB8AUq%2CUNs8a8IbbAVf5oi_hXbcEw5a

Include Page
_WHMAPI1CLINote
_WHMAPI1CLINote

Expand
titleOutput (JSON)
Code Block
languagetext
linenumberstrue
{
  "data": {
    "hook_order": [
      {
        "weight": 100,
        "id": "HzEpGvT6QGUYwxuX3hWB8AUq"
      },
      {
        "weight": 200,
        "id": "UNs8a8IbbAVf5oi_hXbcEw5a"
      }
    ]
  },
  "metadata": {
    "reason": "OK",
    "version": 1,
    "result": 1,
    "command": "reorder_hooks"
  }
}
Expand
titleOutput (XML)
Code Block
languagetext
linenumberstrue
<result>
    <data>
        <hook_order>
            <id>HzEpGvT6QGUYwxuX3hWB8AUq</id>
            <weight>100</weight>
        </hook_order>
        <hook_order>
            <id>UNs8a8IbbAVf5oi_hXbcEw5a</id>
            <weight>200</weight>
        </hook_order>
    </data>
    <metadata>
        <reason>OK</reason>
        <result>1</result>
        <version>1</version>
        <command>reorder_hooks</command>
    </metadata>
</result>

Include Page
LIB:_WHMAPIShellNote
LIB:_WHMAPIShellNote

   

Parameters

ParameterTypeDescriptionPossible valuesExample

id

string

Required

A list of script hook IDs in order of priority.

Note
titleNote:

To retrieve a hook's ID, use the list_hooks function.

A comma-separated and uuencoded list of strings.

 

HzEpGvT6QGUYwxuX3hWB8AUq%2CUNs8a8IbbAVf5oi_hXbcEw5a

Returns

ReturnTypeDescriptionPossible valuesExample

hook_order

hash

A hash of the script hook details.

This hash includes the id and weight returns. 

id

string

The script hook's ID.

The function returns this value in the hook_order hash.

A valid string.

HzEpGvT6QGUYwxuX3hWB8AUq

weight

integer

The script hook's weight.

The function returns this value in the hook_order hash.

A positive integer, where lower numbers represent greater priority.100