Function Hook_comcode_link_handler_media_rendering->bind
Definitions
sources/hooks/systems/comcode_link_handlers/media_rendering.php
- Bind function for Comcode link handler hooks. They see if they can bind a pasted URL to a lump of handler Tempcode.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: object
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $url | URLPATH | No | No | required parameter | N/A | N/A | Link to use or reject |
| $comcode_dangerous | boolean | No | No | required parameter | N/A | N/A | Whether we are allowed to proceed even if this tag is marked as 'dangerous' |
| $pass_id | string | No | No | required parameter | N/A | N/A | A special identifier to mark where the resultant Tempcode is going to end up (e.g. the ID of a post) |
| $pos | integer | No | No | required parameter | N/A | N/A | The position this tag occurred at in the Comcode |
| $source_member | MEMBER | No | No | required parameter | N/A | N/A | The member who is responsible for this Comcode |
| $as_admin | boolean | No | No | required parameter | N/A | N/A | Whether to check as arbitrary admin |
| $db | object | No | No | required parameter | N/A | N/A | The database connector to use |
| $comcode | string | No | No | required parameter | N/A | N/A | The whole chunk of Comcode |
| $structure_sweep | boolean | No | No | required parameter | N/A | N/A | Whether this is only a structure sweep |
| $semiparse_mode | boolean | No | No | required parameter | N/A | N/A | Whether we are in semi-parse-mode (some tags might convert differently) |
| $highlight_bits | array | No | No | required parameter | N/A | N/A | A list of words to highlight |
Returns
- Handled link (null: reject due to inappropriate link pattern)
- Type: ?Tempcode
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Bind function for Comcode link handler hooks. They see if they can bind a pasted URL to a lump of handler Tempcode.
*
* @param URLPATH $url Link to use or reject
* @param boolean $comcode_dangerous Whether we are allowed to proceed even if this tag is marked as 'dangerous'
* @param string $pass_id A special identifier to mark where the resultant Tempcode is going to end up (e.g. the ID of a post)
* @param integer $pos The position this tag occurred at in the Comcode
* @param MEMBER $source_member The member who is responsible for this Comcode
* @param boolean $as_admin Whether to check as arbitrary admin
* @param object $db The database connector to use
* @param string $comcode The whole chunk of Comcode
* @param boolean $structure_sweep Whether this is only a structure sweep
* @param boolean $semiparse_mode Whether we are in semi-parse-mode (some tags might convert differently)
* @param array $highlight_bits A list of words to highlight
* @return ?Tempcode Handled link (null: reject due to inappropriate link pattern)
*/
public function bind(string $url, bool $comcode_dangerous, string $pass_id, int $pos, int $source_member, bool $as_admin, object $db, string $comcode, bool $structure_sweep, bool $semiparse_mode, array $highlight_bits) : ?object
* Bind function for Comcode link handler hooks. They see if they can bind a pasted URL to a lump of handler Tempcode.
*
* @param URLPATH $url Link to use or reject
* @param boolean $comcode_dangerous Whether we are allowed to proceed even if this tag is marked as 'dangerous'
* @param string $pass_id A special identifier to mark where the resultant Tempcode is going to end up (e.g. the ID of a post)
* @param integer $pos The position this tag occurred at in the Comcode
* @param MEMBER $source_member The member who is responsible for this Comcode
* @param boolean $as_admin Whether to check as arbitrary admin
* @param object $db The database connector to use
* @param string $comcode The whole chunk of Comcode
* @param boolean $structure_sweep Whether this is only a structure sweep
* @param boolean $semiparse_mode Whether we are in semi-parse-mode (some tags might convert differently)
* @param array $highlight_bits A list of words to highlight
* @return ?Tempcode Handled link (null: reject due to inappropriate link pattern)
*/
public function bind(string $url, bool $comcode_dangerous, string $pass_id, int $pos, int $source_member, bool $as_admin, object $db, string $comcode, bool $structure_sweep, bool $semiparse_mode, array $highlight_bits) : ?object

