mirror of
https://github.com/processwire/processwire.git
synced 2025-08-13 02:04:35 +02:00
Add support for feature requested in processwire/processwire-issues#1208
This commit is contained in:
@@ -711,6 +711,22 @@ class Field extends WireData implements Saveable, Exportable {
|
||||
return $fieldgroup->getFieldContext($this->id, $namespace);
|
||||
}
|
||||
|
||||
/**
|
||||
* Does this field have context settings for given Page/Template?
|
||||
*
|
||||
* #pw-group-retrieval
|
||||
*
|
||||
* @param Page|Template|Fieldgroup|string $for Specify Page, Template, or template name string
|
||||
* @param string $namespace Optional namespace (internal use)
|
||||
* @return Field|bool
|
||||
* @since 3.0.163
|
||||
* @see Field::getContext()
|
||||
*
|
||||
*/
|
||||
public function hasContext($for, $namespace = '') {
|
||||
return $this->getContext($for, $namespace, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the roles that are allowed to view or edit this field on pages.
|
||||
*
|
||||
|
Reference in New Issue
Block a user