| @@ 36-46 (lines=11) @@ | ||
| 33 | /** |
|
| 34 | * {@inheritDoc} |
|
| 35 | */ |
|
| 36 | public function __construct( $id, $title, $type, $condition_collection, $condition_translator ) { |
|
| 37 | parent::__construct( $id, $title, $type, $condition_collection, $condition_translator ); |
|
| 38 | ||
| 39 | if ( ! $this->get_datastore() ) { |
|
| 40 | $this->set_datastore( Datastore::make( 'theme_options' ), $this->has_default_datastore() ); |
|
| 41 | } |
|
| 42 | ||
| 43 | if ( apply_filters( 'carbon_fields_' . $type . '_container_admin_only_access', true, $title, $this ) ) { |
|
| 44 | $this->where( 'current_user_capability', '=', 'manage_options' ); |
|
| 45 | } |
|
| 46 | } |
|
| 47 | ||
| 48 | /** |
|
| 49 | * Sanitize a title to a filename |
|
| @@ 17-27 (lines=11) @@ | ||
| 14 | /** |
|
| 15 | * {@inheritDoc} |
|
| 16 | */ |
|
| 17 | public function __construct( $id, $title, $type, $condition_collection, $condition_translator ) { |
|
| 18 | parent::__construct( $id, $title, $type, $condition_collection, $condition_translator ); |
|
| 19 | ||
| 20 | if ( ! $this->get_datastore() ) { |
|
| 21 | $this->set_datastore( Datastore::make( 'user_meta' ), $this->has_default_datastore() ); |
|
| 22 | } |
|
| 23 | ||
| 24 | if ( apply_filters( 'carbon_fields_' . $type . '_container_admin_only_access', true, $title, $this ) ) { |
|
| 25 | $this->where( 'current_user_capability', '=', 'manage_options' ); |
|
| 26 | } |
|
| 27 | } |
|
| 28 | ||
| 29 | /** |
|
| 30 | * Bind attach() and save() to the appropriate WordPress actions. |
|