As an abstract class, your use this by extending your own hook class.
Property | Declared | Typ | Description |
---|---|---|---|
$id |
Public | string | The hook ID. Must be unique. |
$core |
Public | OBJECT | The main point type object. |
$point_types |
Public | ARRAY | All registered point type IDs. |
$is_main_type |
Public | BOOL | True if the current instance is the main point type (first instance) or false if not. |
$bonipress_type |
Public | BOOL | The current point type instance. |
$prefs |
Public | ARRAY | Associative array of the hooks saved settings. |
class boniPRESS_Custom_Hook extends boniPRESS_Hook { function __construct( $hook_prefs, $type = BONIPRESS_DEFAULT_TYPE_KEY ) { parent::__construct( array( 'id' => 'hookid', 'defaults' => array( 'creds' => 10, 'log' => '%plural% for a specific event' ) ), $hook_prefs, $type ); } }
Parameter | Type | Required | Description |
---|---|---|---|
$args |
ARRAY | Yes | The hook arguments containing the hooks ID and preferences. |
$hook_prefs |
ARRAY | Yes | The module settings array. |
$type |
string | Yes | The point type key instance. |
public function run() { |
||||
Description: | If a hook is enabled, this method is run for each point type instance. | |||
---|---|---|---|---|
Variable | Type | Required | Description | |
No variables | ||||
} |
public function preferences() { |
||||
Description: | Method that displays the hooks settings in the admin area. If this method is not defined in your class, the hook will appear to have no settings when viewed in the admin area. | |||
---|---|---|---|---|
Variable | Type | Required | Description | |
No variables | ||||
} |
public function sanitise_preferences( $data ) { |
||||
Description: | Method used to sanitize or setup hook settings after they have been saved by the user in the admin area. | |||
---|---|---|---|---|
Variable | Type | Required | Description | |
data |
ARRAY | Yes | The hooks newly submitted settings. | |
} |
public function field_name( $field = '' ) { |
||||
Description: | Returns the hook settings field name. Should be used when displaying settings in the admin area. Ensures that field names are always correct. | |||
---|---|---|---|---|
Variable | Type | Required | Description | |
field |
STRING or ARRAY | Yes | The field name. | |
} |
public function field_id( $field = '' ) { |
||||
Description: | Returns the hook settings field id. Should be used when displaying settings in the admin area. Ensures that field ids are always correct. | |||
---|---|---|---|---|
Variable | Type | Required | Description | |
field |
STRING or ARRAY | Yes | The field id. | |
} |
public function over_hook_limit( $instance = '', $reference = '', $user_id = NULL, $ref_id = NULL ) { |
||||
Description: | Returns true if the hook limit has been reached (assuming one has been set), else it returns false. | |||
---|---|---|---|---|
Variable | Type | Required | Description | |
instance |
STRING | Yes | The hook instance to check. | |
reference |
STRING | Yes | The reference to check. | |
user_id |
INT | Yes | The user ID to check. | |
ref_id |
INT | No | Optional reference ID to check. | |
} |
public function get_limit_types() { |
||||
Beschreibung: | Gibt ein Array von Optionen zurück, die in der Dropdown-Liste Hook-Limit-Einstellungen ausgewählt werden können. | |||
---|---|---|---|---|
Variable | Typ | Benötigt | Beschreibung | |
Keine Variablen | ||||
} |
public function hook_limit_setting( $name = '', $id = '', $selected = '' ) { |
||||
Beschreibung: | Gibt die Hook-Limit-Einstellungen zurück. Diese Methode kann nur in der Einstellungen () -Methode für Instanzen verwendet werden, die Grenzwerte unterstützen müssen. | |||
---|---|---|---|---|
Variable | Typ | Benötigt | Beschreibung | |
name |
STRING | Ja | Der zu verwendende Einstellungsname. | |
id |
STRING | Ja | Die zu verwendende Einstellungs-ID. | |
selected |
STRING | Ja | Die gespeicherten Einstellungen. | |
} |
public function has_entry( $reference = NULL, $ref_id = NULL, $user_id = NULL, $data = NULL, $type = NULL ) { |
||||
Beschreibung: | Überprüft, ob ein bestimmter Protokolleintrag in der Datenbank vorhanden ist. | |||
---|---|---|---|---|
Variable | Typ | Benötigt | Beschreibung | |
reference |
STRING | Nein | Die zu überprüfende Referenz. | |
ref_id |
INT | Nein | Die zu überprüfende Referenz-ID. | |
user_id |
INT | Nein | Die zu überprüfende Benutzer-ID. | |
data |
STRING | Nein | Die zu überprüfenden Daten. Wenn Du weist, dass es sich bei den Daten um ein Array handelt, stelle sicher, dass es sich bei diesem Wert um ein serialisiertes Array handelt. | |
type |
STRING | Nein | Der zu überprüfende Punkttyp. | |
} |
Untergeordnet: BuddyPress-Gruppenaktionen, BuddyPress-Profilaktionen, BoniPress Hooks Empfehlungen, BoniPress Hooks Ansehen von Videos, BoniPress Hooks Klicken auf Links, BoniPress Hooks Kommentare, BoniPress Hooks Inhalte löschen, BoniPress Hooks Veröffentlichen von Inhalten, BoniPress Hooks Einloggen, BoniPress Hooks Punkte für das Anzeigen von Inhalten