| @@ 35-45 (lines=11) @@ | ||
| 32 | /** |
|
| 33 | * {@inheritDoc} |
|
| 34 | */ |
|
| 35 | public function __construct( $id, $title, $type, $condition_collection, $condition_translator ) { |
|
| 36 | parent::__construct( $id, $title, $type, $condition_collection, $condition_translator ); |
|
| 37 | ||
| 38 | if ( ! $this->get_datastore() ) { |
|
| 39 | $this->set_datastore( Datastore::make( 'theme_options' ), $this->has_default_datastore() ); |
|
| 40 | } |
|
| 41 | ||
| 42 | if ( apply_filters( 'carbon_fields_' . $type . '_container_admin_only_access', true, $title ) ) { |
|
| 43 | $this->where( 'current_user_capability', '=', 'manage_options' ); |
|
| 44 | } |
|
| 45 | } |
|
| 46 | ||
| 47 | /** |
|
| 48 | * 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 ) ) { |
|
| 25 | $this->where( 'current_user_capability', '=', 'manage_options' ); |
|
| 26 | } |
|
| 27 | } |
|
| 28 | ||
| 29 | /** |
|
| 30 | * Bind attach() and save() to the appropriate WordPress actions. |
|